Assert on tab id as well
This commit is contained in:
parent
bf47056561
commit
4f7bde38a9
3 changed files with 5 additions and 1 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.equal(message.tabId, w.webContents.id)
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -875,6 +876,7 @@ describe('browser-window module', function () {
|
||||||
|
|
||||||
ipcMain.once('answer', function (event, message, extensionId) {
|
ipcMain.once('answer', function (event, message, extensionId) {
|
||||||
assert.equal(message.runtimeId, 'foo')
|
assert.equal(message.runtimeId, 'foo')
|
||||||
|
assert.equal(message.tabId, w.webContents.id)
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
<title></title>
|
<title></title>
|
||||||
<script>
|
<script>
|
||||||
var message = JSON.stringify({
|
var message = JSON.stringify({
|
||||||
runtimeId: chrome.runtime.id
|
runtimeId: chrome.runtime.id,
|
||||||
|
tabId: chrome.devtools.inspectedWindow.tabId
|
||||||
})
|
})
|
||||||
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 () {})
|
||||||
|
|
|
@ -929,6 +929,7 @@ describe('<webview> tag', function () {
|
||||||
|
|
||||||
ipcMain.once('answer', function (event, message) {
|
ipcMain.once('answer', function (event, message) {
|
||||||
assert.equal(message.runtimeId, 'foo')
|
assert.equal(message.runtimeId, 'foo')
|
||||||
|
assert.notEqual(message.tabId, w.webContents.id)
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue