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) {
|
ipcMain.once('answer', function (event, message) {
|
||||||
assert.equal(message.runtimeId, 'foo')
|
assert.equal(message.runtimeId, 'foo')
|
||||||
assert.equal(message.tabId, w.webContents.id)
|
assert.equal(message.tabId, w.webContents.id)
|
||||||
|
assert.equal(message.i18nString, 'foo - bar (baz)')
|
||||||
done()
|
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>
|
<script>
|
||||||
var message = JSON.stringify({
|
var message = JSON.stringify({
|
||||||
runtimeId: chrome.runtime.id,
|
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})`
|
var sendMessage = `require('electron').ipcRenderer.send('answer', ${message})`
|
||||||
window.chrome.devtools.inspectedWindow.eval(sendMessage, function () {})
|
window.chrome.devtools.inspectedWindow.eval(sendMessage, function () {})
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "foo",
|
"name": "foo",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"devtools_page": "foo.html"
|
"devtools_page": "foo.html",
|
||||||
|
"default_locale": "en"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue