Add spec
This commit is contained in:
parent
41d6ddd588
commit
d6b108b272
2 changed files with 14 additions and 4 deletions
|
@ -864,6 +864,7 @@ describe('browser-window module', function () {
|
||||||
|
|
||||||
ipcMain.once('answer', function (event, message) {
|
ipcMain.once('answer', function (event, message) {
|
||||||
assert.equal(message.runtimeId, 'foo')
|
assert.equal(message.runtimeId, 'foo')
|
||||||
|
assert.deepEqual(message.storageItems, {foo: 'bar'})
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
11
spec/fixtures/devtools-extensions/foo/index.html
vendored
11
spec/fixtures/devtools-extensions/foo/index.html
vendored
|
@ -4,11 +4,20 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title></title>
|
<title></title>
|
||||||
<script>
|
<script>
|
||||||
|
function testStorage (callback) {
|
||||||
|
chrome.storage.sync.set({foo: 'bar'}, function () {
|
||||||
|
chrome.storage.sync.get([{foo: 'baz'}], callback)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
testStorage(function (items) {
|
||||||
var message = JSON.stringify({
|
var message = JSON.stringify({
|
||||||
runtimeId: chrome.runtime.id
|
runtimeId: chrome.runtime.id,
|
||||||
|
storageItems: items
|
||||||
})
|
})
|
||||||
var sendMessage = `require('electron').ipcRenderer.send('answer', ${message})`
|
var sendMessage = `require('electron').ipcRenderer.send('answer', ${message})`
|
||||||
window.chrome.devtools.inspectedWindow.eval(sendMessage, function () {})
|
window.chrome.devtools.inspectedWindow.eval(sendMessage, function () {})
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
Loading…
Reference in a new issue