Bug 1199842 - [webext] Add missing XUL_NS variable for browser_action (r=gabor)

This commit is contained in:
Bill McCloskey 2015-08-28 17:11:16 -07:00
parent fdb75efced
commit 1acf39a61c
3 changed files with 38 additions and 0 deletions

View File

@ -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");

View File

@ -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]

View File

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