Skip to content

Commit 6131ab3

Browse files
committed
Bug 1591873 - Make browser_mixedcontent_aboutblocked.js work when fission is enabled. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D51114 --HG-- extra : moz-landing-system : lando
1 parent cff6e48 commit 6131ab3

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

browser/components/safebrowsing/content/test/browser.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ support-files =
99
skip-if = os == "mac" || e10s # e10s: Bug 1248632
1010
[browser_whitelisted.js]
1111
[browser_mixedcontent_aboutblocked.js]
12-
skip-if = fission # Times out under Fission with DocumentChannel enabled.

browser/components/safebrowsing/content/test/browser_mixedcontent_aboutblocked.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,27 @@ add_task(async function testNormalBrowsing() {
1212
// black list has been added to the database.
1313
await new Promise(resolve => waitForDBInit(resolve));
1414

15-
await ContentTask.spawn(browser, PHISH_URL, async function(aPhishUrl) {
16-
return new Promise(resolve => {
17-
// Register listener before loading phish URL.
18-
let listener = e => {
19-
removeEventListener("AboutBlockedLoaded", listener, false, true);
15+
let promise = new Promise(resolve => {
16+
// Register listener before loading phish URL.
17+
let removeFunc = BrowserTestUtils.addContentEventListener(
18+
browser,
19+
"AboutBlockedLoaded",
20+
() => {
21+
removeFunc();
2022
resolve();
21-
};
22-
addEventListener("AboutBlockedLoaded", listener, false, true);
23+
},
24+
{ wantUntrusted: true }
25+
);
26+
});
2327

24-
// Create an iframe which is going to load a phish url.
25-
let iframe = content.document.createElement("iframe");
26-
iframe.src = aPhishUrl;
27-
content.document.body.appendChild(iframe);
28-
});
28+
await ContentTask.spawn(browser, PHISH_URL, async function(aPhishUrl) {
29+
// Create an iframe which is going to load a phish url.
30+
let iframe = content.document.createElement("iframe");
31+
iframe.src = aPhishUrl;
32+
content.document.body.appendChild(iframe);
2933
});
3034

35+
await promise;
3136
ok(true, "about:blocked is successfully loaded!");
3237
});
3338
});

0 commit comments

Comments
 (0)