зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1199842 - [webext] Add missing XUL_NS variable for browser_action (r=gabor)
This commit is contained in:
Родитель
1b946c60b2
Коммит
06a195312a
|
@ -140,6 +140,7 @@ BrowserAction.prototype = {
|
|||
panel.setAttribute("flip", "slide");
|
||||
node.appendChild(panel);
|
||||
|
||||
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
let browser = document.createElementNS(XUL_NS, "browser");
|
||||
browser.setAttribute("type", "content");
|
||||
browser.setAttribute("disableglobalhistory", "true");
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
[browser_extensions_simple.js]
|
||||
[browser_ext_browserAction_simple.js]
|
||||
[browser_ext_tabs_executeScript.js]
|
||||
[browser_ext_tabs_query.js]
|
||||
[browser_ext_tabs_update.js]
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
add_task(function* () {
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
"browser_action": {
|
||||
"default_popup": "popup.html"
|
||||
}
|
||||
},
|
||||
|
||||
files: {
|
||||
"popup.html": `
|
||||
<!DOCTYPE html>
|
||||
<html><body>
|
||||
<script src="popup.js"></script>
|
||||
</body></html>
|
||||
`,
|
||||
|
||||
"popup.js": function() {
|
||||
browser.runtime.sendMessage("from-popup");
|
||||
}
|
||||
},
|
||||
|
||||
background: function() {
|
||||
browser.runtime.onMessage.addListener(msg => {
|
||||
browser.test.assertEq(msg, "from-popup", "correct message received");
|
||||
browser.test.notifyPass("browser_action.simple");
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
yield extension.startup();
|
||||
|
||||
// FIXME: Should really test opening the popup here.
|
||||
|
||||
yield extension.awaitFinish("browser_action.simple");
|
||||
yield extension.unload();
|
||||
});
|
Загрузка…
Ссылка в новой задаче