Add spec
This commit is contained in:
parent
9f64c39f8c
commit
0ed10658a3
4 changed files with 15 additions and 2 deletions
|
@ -865,6 +865,7 @@ describe('browser-window module', function () {
|
|||
ipcMain.once('answer', function (event, message) {
|
||||
assert.equal(message.runtimeId, 'foo')
|
||||
assert.equal(message.tabId, w.webContents.id)
|
||||
assert.equal(message.i18nString, 'foo - bar (baz)')
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
|
10
spec/fixtures/devtools-extensions/foo/_locales/en/messages.json
vendored
Normal file
10
spec/fixtures/devtools-extensions/foo/_locales/en/messages.json
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"foo": {
|
||||
"message": "foo - $BAZ$ ($2)",
|
||||
"placeholders": {
|
||||
"baz": {
|
||||
"content": "$1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,7 +6,8 @@
|
|||
<script>
|
||||
var message = JSON.stringify({
|
||||
runtimeId: chrome.runtime.id,
|
||||
tabId: chrome.devtools.inspectedWindow.tabId
|
||||
tabId: chrome.devtools.inspectedWindow.tabId,
|
||||
i18nString: chrome.i18n.getMessage('foo', ['bar', 'baz'])
|
||||
})
|
||||
var sendMessage = `require('electron').ipcRenderer.send('answer', ${message})`
|
||||
window.chrome.devtools.inspectedWindow.eval(sendMessage, function () {})
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"name": "foo",
|
||||
"version": "1.0",
|
||||
"devtools_page": "foo.html"
|
||||
"devtools_page": "foo.html",
|
||||
"default_locale": "en"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue