Merge pull request #10307 from liusy182/10240-theme-color-2

return null when theme color is transparent or not found
This commit is contained in:
Cheng Zhao 2017-09-11 18:40:35 +09:00 committed by GitHub
commit cc9771a3d0
4 changed files with 28 additions and 2 deletions

View file

@ -660,4 +660,21 @@ describe('webContents module', function () {
gen.next()
})
})
describe('did-change-theme-color event', () => {
it('is triggered with correct theme color', (done) => {
var count = 0
w.webContents.on('did-change-theme-color', (e, color) => {
if (count === 0) {
count++
assert.equal(color, '#FFEEDD')
w.loadURL('file://' + path.join(__dirname, 'fixtures', 'pages', 'base-page.html'))
} else if (count === 1) {
assert.equal(color, null)
done()
}
})
w.loadURL('file://' + path.join(__dirname, 'fixtures', 'pages', 'theme-color.html'))
})
})
})