fune/browser/components/safebrowsing/content/test/browser_mixedcontent_aboutblocked.js
Victor Porof 1f830c96da Bug 1561435 - Format browser/components/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D36042

--HG--
extra : source : d3afcafdce650a6f36cebbc126ee93b17f13cf52
2019-07-05 09:53:32 +02:00

33 lines
1.2 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const SECURE_CONTAINER_URL =
"https://example.com/browser/browser/components/safebrowsing/content/test/empty_file.html";
add_task(async function testNormalBrowsing() {
await BrowserTestUtils.withNewTab(SECURE_CONTAINER_URL, async function(
browser
) {
// Before we load the phish url, we have to make sure the hard-coded
// black list has been added to the database.
await new Promise(resolve => waitForDBInit(resolve));
await ContentTask.spawn(browser, PHISH_URL, async function(aPhishUrl) {
return new Promise(resolve => {
// Register listener before loading phish URL.
let listener = e => {
removeEventListener("AboutBlockedLoaded", listener, false, true);
resolve();
};
addEventListener("AboutBlockedLoaded", listener, false, true);
// Create an iframe which is going to load a phish url.
let iframe = content.document.createElement("iframe");
iframe.src = aPhishUrl;
content.document.body.appendChild(iframe);
});
});
ok(true, "about:blocked is successfully loaded!");
});
});