Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 // ----------------------------------------------------------------------------
2 // Test whether passing a simple string to InstallTrigger.install throws an
3 // exception
4 function test() {
5 waitForExplicitFinish();
7 var triggers = encodeURIComponent(JSON.stringify(TESTROOT + "unsigned.xpi"));
8 gBrowser.selectedTab = gBrowser.addTab();
9 gBrowser.selectedBrowser.addEventListener("load", function() {
10 gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
11 // Allow the in-page load handler to run first
12 executeSoon(page_loaded);
13 }, true);
14 expectUncaughtException();
15 gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
16 }
18 function page_loaded() {
19 var doc = gBrowser.contentDocument;
20 is(doc.getElementById("return").textContent, "exception", "installTrigger should have failed");
21 gBrowser.removeCurrentTab();
22 finish();
23 }
24 // ----------------------------------------------------------------------------