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) {
|
||||
assert.equal(message.runtimeId, 'foo')
|
||||
assert.deepEqual(message.storageItems, {foo: 'bar'})
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
|
17
spec/fixtures/devtools-extensions/foo/index.html
vendored
17
spec/fixtures/devtools-extensions/foo/index.html
vendored
|
@ -4,11 +4,20 @@
|
|||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<script>
|
||||
var message = JSON.stringify({
|
||||
runtimeId: chrome.runtime.id
|
||||
function testStorage (callback) {
|
||||
chrome.storage.sync.set({foo: 'bar'}, function () {
|
||||
chrome.storage.sync.get([{foo: 'baz'}], callback)
|
||||
})
|
||||
}
|
||||
|
||||
testStorage(function (items) {
|
||||
var message = JSON.stringify({
|
||||
runtimeId: chrome.runtime.id,
|
||||
storageItems: items
|
||||
})
|
||||
var sendMessage = `require('electron').ipcRenderer.send('answer', ${message})`
|
||||
window.chrome.devtools.inspectedWindow.eval(sendMessage, function () {})
|
||||
})
|
||||
var sendMessage = `require('electron').ipcRenderer.send('answer', ${message})`
|
||||
window.chrome.devtools.inspectedWindow.eval(sendMessage, function () {})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
Loading…
Reference in a new issue