summaryrefslogtreecommitdiffstats
path: root/browser/components/safebrowsing/content/test/browser_mixedcontent_aboutblocked.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /browser/components/safebrowsing/content/test/browser_mixedcontent_aboutblocked.js
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/safebrowsing/content/test/browser_mixedcontent_aboutblocked.js')
-rw-r--r--browser/components/safebrowsing/content/test/browser_mixedcontent_aboutblocked.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/browser/components/safebrowsing/content/test/browser_mixedcontent_aboutblocked.js b/browser/components/safebrowsing/content/test/browser_mixedcontent_aboutblocked.js
new file mode 100644
index 0000000000..5e26fe3b29
--- /dev/null
+++ b/browser/components/safebrowsing/content/test/browser_mixedcontent_aboutblocked.js
@@ -0,0 +1,38 @@
+/* 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));
+
+ let promise = new Promise(resolve => {
+ // Register listener before loading phish URL.
+ let removeFunc = BrowserTestUtils.addContentEventListener(
+ browser,
+ "AboutBlockedLoaded",
+ () => {
+ removeFunc();
+ resolve();
+ },
+ { wantUntrusted: true }
+ );
+ });
+
+ await SpecialPowers.spawn(browser, [PHISH_URL], async function(aPhishUrl) {
+ // 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);
+ });
+
+ await promise;
+ ok(true, "about:blocked is successfully loaded!");
+ });
+});