This commit is contained in:
Jessica Lord 2016-06-09 14:14:20 -07:00
parent 41d6ddd588
commit d6b108b272
2 changed files with 14 additions and 4 deletions

View file

@ -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()
}) })
}) })

View file

@ -4,11 +4,20 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title></title> <title></title>
<script> <script>
var message = JSON.stringify({ function testStorage (callback) {
runtimeId: chrome.runtime.id 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> </script>
</head> </head>
<body> <body>