browser_overlink.js (911B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 ChromeUtils.defineESModuleGetters(this, { 7 UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.sys.mjs", 8 }); 9 10 const TEST_PATH = getRootDirectory(gTestPath).replace( 11 "chrome://mochitests/content", 12 "https://example.com" 13 ); 14 15 add_task(async function test_stripAuthCredentials() { 16 await BrowserTestUtils.withNewTab( 17 TEST_PATH + "overlink_test.html", 18 async function (browser) { 19 await SpecialPowers.spawn(browser, [], function () { 20 content.document.getElementById("link").focus(); 21 }); 22 23 await TestUtils.waitForCondition( 24 () => 25 XULBrowserWindow.overLink == 26 UrlbarTestUtils.trimURL("https://example.com"), 27 "Overlink should be missing auth credentials" 28 ); 29 30 ok(true, "Test successful"); 31 } 32 ); 33 });