diff --git a/browser/base/content/tabbrowser.js b/browser/base/content/tabbrowser.js index 92a70cb09e7d..6eee239dc597 100644 --- a/browser/base/content/tabbrowser.js +++ b/browser/base/content/tabbrowser.js @@ -6403,24 +6403,9 @@ // before the location changed. this.mBrowser.userTypedValue = null; - // When browser.tabs.documentchannel.parent-controlled pref and SHIP - // are enabled and a load gets cancelled due to another one - // starting, the error is NS_BINDING_CANCELLED_OLD_LOAD. - // When these prefs are not enabled, the error is different and - // that's why we still want to look at the isNavigating flag. - // We could add a workaround and make sure that in the alternative - // codepaths we would also omit the same error, but considering - // how we will be enabling fission by default soon, we can keep - // using isNavigating for now, and remove it when the - // parent-controlled pref and SHIP are enabled by default. - // Bug 1725716 has been filed to consider removing isNavigating - // field alltogether. + let isNavigating = this.mBrowser.isNavigating; - if ( - this.mTab.selected && - aStatus != Cr.NS_BINDING_CANCELLED_OLD_LOAD && - !isNavigating - ) { + if (this.mTab.selected && !isNavigating) { gURLBar.setURI(); } } else if (isSuccessful) { diff --git a/browser/base/content/test/tabs/browser_progress_keyword_search_handling.js b/browser/base/content/test/tabs/browser_progress_keyword_search_handling.js index 99af24ac8f1e..32b8f124b7f6 100644 --- a/browser/base/content/test/tabs/browser_progress_keyword_search_handling.js +++ b/browser/base/content/test/tabs/browser_progress_keyword_search_handling.js @@ -50,10 +50,6 @@ add_task(async function test_unknown_host() { EventUtils.synthesizeKey("KEY_Enter"); await searchPromise; - // With parent initiated loads, we need to give XULBrowserWindow - // time to process the STATE_START event and set the attribute to true. - await new Promise(resolve => executeSoon(resolve)); - ok(kButton.hasAttribute("displaystop"), "Should be showing stop"); await TestUtils.waitForCondition( diff --git a/browser/components/downloads/test/browser/browser_download_overwrite.js b/browser/components/downloads/test/browser/browser_download_overwrite.js index 53b23d7f1cd8..1e79c34cd355 100644 --- a/browser/components/downloads/test/browser/browser_download_overwrite.js +++ b/browser/components/downloads/test/browser/browser_download_overwrite.js @@ -63,43 +63,35 @@ add_task(async function test_overwrite_does_not_delete_first() { let dialogPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); // Now try and download a thing to the file: - await BrowserTestUtils.withNewTab( - { - gBrowser, - opening: TEST_ROOT + "foo.txt", - waitForLoad: false, - waitForStateStop: true, - }, - async function() { - if ( - !Services.prefs.getBoolPref( - "browser.download.improvements_to_download_panel" - ) - ) { - let dialog = await dialogPromise; - info("Got dialog."); - let saveEl = dialog.document.getElementById("save"); - dialog.document.getElementById("mode").selectedItem = saveEl; - // Allow accepting the dialog (to avoid the delay helper): - dialog.document - .getElementById("unknownContentType") - .getButton("accept").disabled = false; - // Then accept it: - dialog.document.querySelector("dialog").acceptDialog(); - } - - ok(await transferCompletePromise, "download should succeed"); - ok( - gTestTargetFile.exists(), - "File should still exist and not have been deleted." - ); - // Note: the download transfer is fake so data won't have been written to - // the file, so we can't verify that the download actually overwrites data - // like this. - mockTransferRegisterer.unregister(); - unregisteredTransfer = true; + await BrowserTestUtils.withNewTab(TEST_ROOT + "foo.txt", async function() { + if ( + !Services.prefs.getBoolPref( + "browser.download.improvements_to_download_panel" + ) + ) { + let dialog = await dialogPromise; + info("Got dialog."); + let saveEl = dialog.document.getElementById("save"); + dialog.document.getElementById("mode").selectedItem = saveEl; + // Allow accepting the dialog (to avoid the delay helper): + dialog.document + .getElementById("unknownContentType") + .getButton("accept").disabled = false; + // Then accept it: + dialog.document.querySelector("dialog").acceptDialog(); } - ); + + ok(await transferCompletePromise, "download should succeed"); + ok( + gTestTargetFile.exists(), + "File should still exist and not have been deleted." + ); + // Note: the download transfer is fake so data won't have been written to + // the file, so we can't verify that the download actually overwrites data + // like this. + mockTransferRegisterer.unregister(); + unregisteredTransfer = true; + }); }); // If we download a file and the user accepts overwriting an existing one, @@ -122,43 +114,35 @@ add_task(async function test_overwrite_works() { }); }); // Now try and download a thing to the file: - await BrowserTestUtils.withNewTab( - { - gBrowser, - opening: TEST_ROOT + "foo.txt", - waitForLoad: false, - waitForStateStop: true, - }, - async function() { - if ( - !Services.prefs.getBoolPref( - "browser.download.improvements_to_download_panel" - ) - ) { - let dialog = await dialogPromise; - info("Got dialog."); - let saveEl = dialog.document.getElementById("save"); - dialog.document.getElementById("mode").selectedItem = saveEl; - // Allow accepting the dialog (to avoid the delay helper): - dialog.document - .getElementById("unknownContentType") - .getButton("accept").disabled = false; - // Then accept it: - dialog.document.querySelector("dialog").acceptDialog(); - } - - info("wait for download to finish"); - let download = await downloadFinishedPromise; - ok(download.succeeded, "Download should succeed"); - ok( - gTestTargetFile.exists(), - "File should still exist and not have been deleted." - ); - let contents = new TextDecoder().decode( - await IOUtils.read(gTestTargetFile.path) - ); - info("Got: " + contents); - ok(contents.startsWith("Dummy"), "The file was overwritten."); + await BrowserTestUtils.withNewTab(TEST_ROOT + "foo.txt", async function() { + if ( + !Services.prefs.getBoolPref( + "browser.download.improvements_to_download_panel" + ) + ) { + let dialog = await dialogPromise; + info("Got dialog."); + let saveEl = dialog.document.getElementById("save"); + dialog.document.getElementById("mode").selectedItem = saveEl; + // Allow accepting the dialog (to avoid the delay helper): + dialog.document + .getElementById("unknownContentType") + .getButton("accept").disabled = false; + // Then accept it: + dialog.document.querySelector("dialog").acceptDialog(); } - ); + + info("wait for download to finish"); + let download = await downloadFinishedPromise; + ok(download.succeeded, "Download should succeed"); + ok( + gTestTargetFile.exists(), + "File should still exist and not have been deleted." + ); + let contents = new TextDecoder().decode( + await IOUtils.read(gTestTargetFile.path) + ); + info("Got: " + contents); + ok(contents.startsWith("Dummy"), "The file was overwritten."); + }); }); diff --git a/browser/components/extensions/test/browser/browser.ini b/browser/components/extensions/test/browser/browser.ini index 54d6bf317457..d53809d29f17 100644 --- a/browser/components/extensions/test/browser/browser.ini +++ b/browser/components/extensions/test/browser/browser.ini @@ -339,7 +339,6 @@ skip-if = https_first_disabled = true [browser_ext_user_events.js] [browser_ext_webRequest.js] -[browser_ext_webRequest_error_after_stopped_or_closed.js] [browser_ext_webrtc.js] skip-if = os == 'mac' # Bug 1565738 [browser_ext_webNavigation_containerIsolation.js] diff --git a/browser/components/extensions/test/browser/browser_ext_webRequest_error_after_stopped_or_closed.js b/browser/components/extensions/test/browser/browser_ext_webRequest_error_after_stopped_or_closed.js deleted file mode 100644 index acf8b4446a3b..000000000000 --- a/browser/components/extensions/test/browser/browser_ext_webRequest_error_after_stopped_or_closed.js +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -const SLOW_PAGE = - getRootDirectory(gTestPath).replace( - "chrome://mochitests/content", - "http://www.example.com" - ) + "file_slowed_document.sjs"; - -async function runTest(stopLoadFunc) { - async function background() { - let urls = ["http://www.example.com/*"]; - browser.webRequest.onCompleted.addListener( - details => { - browser.test.sendMessage("done", { - msg: "onCompleted", - requestId: details.requestId, - }); - }, - { urls } - ); - - browser.webRequest.onBeforeRequest.addListener( - details => { - browser.test.sendMessage("onBeforeRequest", { - requestId: details.requestId, - }); - }, - { urls }, - ["blocking"] - ); - - browser.webRequest.onErrorOccurred.addListener( - details => { - browser.test.sendMessage("done", { - msg: "onErrorOccurred", - requestId: details.requestId, - }); - }, - { urls } - ); - } - - let extension = ExtensionTestUtils.loadExtension({ - manifest: { - permissions: [ - "webRequest", - "webRequestBlocking", - "http://www.example.com/*", - ], - }, - background, - }); - await extension.startup(); - - // Open a SLOW_PAGE and don't wait for it to load - let slowTab = await BrowserTestUtils.openNewForegroundTab( - gBrowser, - SLOW_PAGE, - false - ); - - stopLoadFunc(slowTab); - - // Retrieve the requestId from onBeforeRequest - let requestIdOnBeforeRequest = await extension.awaitMessage( - "onBeforeRequest" - ); - - // Now verify that we got the correct event and request id - let doneMessage = await extension.awaitMessage("done"); - - // We shouldn't get the onCompleted message here - is(doneMessage.msg, "onErrorOccurred", "received onErrorOccurred message"); - is( - requestIdOnBeforeRequest.requestId, - doneMessage.requestId, - "request Ids match" - ); - - BrowserTestUtils.removeTab(slowTab); - await extension.unload(); -} - -/** - * Check that after we cancel a slow page load, we get an error associated with - * our request. - */ -add_task(async function test_click_stop_button() { - await runTest(async slowTab => { - // Stop the load - let stopButton = document.getElementById("stop-button"); - await TestUtils.waitForCondition(() => { - return !stopButton.disabled; - }); - stopButton.click(); - }); -}); - -/** - * Check that after we close the tab corresponding to a slow page load, - * that we get an error associated with our request. - */ -add_task(async function test_remove_tab() { - await runTest(slowTab => { - // Remove the tab - BrowserTestUtils.removeTab(slowTab); - }); -}); diff --git a/browser/components/preferences/tests/browser_open_download_preferences.js b/browser/components/preferences/tests/browser_open_download_preferences.js index 9ec71de0f18f..27357384ff9b 100644 --- a/browser/components/preferences/tests/browser_open_download_preferences.js +++ b/browser/components/preferences/tests/browser_open_download_preferences.js @@ -112,12 +112,10 @@ add_task(async function alwaysAskPreferenceWorks() { ); let domWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + "empty_pdf_file.pdf", - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + "empty_pdf_file.pdf" + ); let domWindow = await domWindowPromise; let dialog = domWindow.document.querySelector("#unknownContentType"); @@ -156,12 +154,10 @@ add_task(async function handleInternallyPreferenceWorks() { "Should have selected 'handle internally' for pdf" ); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + "empty_pdf_file.pdf", - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + "empty_pdf_file.pdf" + ); await ContentTask.spawn(loadingTab.linkedBrowser, null, async () => { await ContentTaskUtils.waitForCondition( @@ -207,12 +203,10 @@ add_task(async function saveToDiskPreferenceWorks() { let downloadFinishedPromise = downloadHadFinished(publicList); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + "empty_pdf_file.pdf", - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + "empty_pdf_file.pdf" + ); let download = await downloadFinishedPromise; BrowserTestUtils.removeTab(loadingTab); @@ -269,12 +263,10 @@ add_task(async function useSystemDefaultPreferenceWorks() { let downloadFinishedPromise = downloadHadFinished(publicList); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + "empty_pdf_file.pdf", - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + "empty_pdf_file.pdf" + ); info("Downloading had finished"); let download = await downloadFinishedPromise; @@ -338,12 +330,10 @@ add_task(async function useSystemDefaultAndAskForDestinationWorks() { MockFilePicker.cleanup(); }); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + "empty_pdf_file.pdf", - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + "empty_pdf_file.pdf" + ); await filePickerShown; diff --git a/browser/components/search/test/browser/browser_google_behavior.js b/browser/components/search/test/browser/browser_google_behavior.js index 726d23418d9b..e02124fd2caf 100644 --- a/browser/components/search/test/browser/browser_google_behavior.js +++ b/browser/components/search/test/browser/browser_google_behavior.js @@ -193,11 +193,12 @@ async function testSearchEngine(engineDetails) { await test.preTest(tab); } - let googleUrl = - "https://www.google.com/search?client=" + test.code + "&q=foo"; let promises = [ - BrowserTestUtils.waitForDocLoadAndStopIt(googleUrl, tab), - BrowserTestUtils.browserStopped(tab.linkedBrowser, googleUrl, true), + BrowserTestUtils.waitForDocLoadAndStopIt( + "https://www.google.com/search?client=" + test.code + "&q=foo", + tab + ), + BrowserTestUtils.browserStopped(tab.linkedBrowser, null, true), ]; await test.run(tab); diff --git a/browser/components/search/test/browser/browser_searchEngine_behaviors.js b/browser/components/search/test/browser/browser_searchEngine_behaviors.js index 819bf92caf9b..527f70f22bab 100644 --- a/browser/components/search/test/browser/browser_searchEngine_behaviors.js +++ b/browser/components/search/test/browser/browser_searchEngine_behaviors.js @@ -173,8 +173,8 @@ async function testSearchEngine(engineDetails) { async preTest(tab) { let browser = tab.linkedBrowser; BrowserTestUtils.loadURI(browser, "about:newtab"); - await BrowserTestUtils.browserLoaded(browser, false, "about:newtab"); + await promiseContentSearchReady(browser); }, async run(tab) { @@ -199,7 +199,7 @@ async function testSearchEngine(engineDetails) { let promises = [ BrowserTestUtils.waitForDocLoadAndStopIt(test.searchURL, tab), - BrowserTestUtils.browserStopped(tab.linkedBrowser, test.searchURL, true), + BrowserTestUtils.browserStopped(tab.linkedBrowser, null, true), ]; await test.run(tab); diff --git a/browser/components/urlbar/tests/browser/browser_stop_pending.js b/browser/components/urlbar/tests/browser/browser_stop_pending.js index 9d6aabda38fb..3b9c509f95ed 100644 --- a/browser/components/urlbar/tests/browser/browser_stop_pending.js +++ b/browser/components/urlbar/tests/browser/browser_stop_pending.js @@ -218,242 +218,3 @@ add_task(async function() { BrowserTestUtils.removeTab(newTab); BrowserTestUtils.removeTab(tab); }); - -/** - * 1) Try to load page 0 and wait for it to finish loading. - * 2) Try to load page 1 and wait for it to finish loading. - * 3) Try to load SLOW_PAGE, and then before it finishes loading, navigate back. - * - We should be taken to page 0. - */ -add_task(async function testCorrectUrlBarAfterGoingBackDuringAnotherLoad() { - // Load example.org - let page0 = "http://example.org/"; - let tab = await BrowserTestUtils.openNewForegroundTab( - gBrowser, - page0, - true, - true - ); - - // Load example.com in the same browser - let page1 = "http://example.com/"; - let loaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, page1); - BrowserTestUtils.loadURI(tab.linkedBrowser, page1); - await loaded; - - let initialValue = gURLBar.untrimmedValue; - let expectedURLBarChange = SLOW_PAGE; - let sawChange = false; - let goneBack = false; - let handler = () => { - if (!goneBack) { - isnot( - gURLBar.untrimmedValue, - initialValue, - `Should not revert URL bar value to ${initialValue}` - ); - } - - if (gURLBar.getAttribute("pageproxystate") == "valid") { - sawChange = true; - is( - gURLBar.untrimmedValue, - expectedURLBarChange, - `Should set expected URL bar value - ${expectedURLBarChange}` - ); - } - }; - - let obs = new MutationObserver(handler); - - obs.observe(gURLBar.textbox, { attributes: true }); - // Set the value of url bar to SLOW_PAGE - gURLBar.value = SLOW_PAGE; - gURLBar.handleCommand(); - - // Copied from the first test case: - // If this ever starts going intermittent, we've broken this. - await new Promise(resolve => setTimeout(resolve, 200)); - - expectedURLBarChange = page0; - let pageLoadPromise = BrowserTestUtils.browserStopped( - tab.linkedBrowser, - page0 - ); - - // Wait until we can go back - await TestUtils.waitForCondition(() => tab.linkedBrowser.canGoBack); - ok(tab.linkedBrowser.canGoBack, "can go back"); - - // Navigate back from SLOW_PAGE. We should be taken to page 0 now. - tab.linkedBrowser.goBack(); - goneBack = true; - is( - gURLBar.untrimmedValue, - SLOW_PAGE, - "Should not have changed URL bar value synchronously." - ); - // Wait until page 0 have finished loading. - await pageLoadPromise; - is( - gURLBar.untrimmedValue, - page0, - "Should not have changed URL bar value synchronously." - ); - ok( - sawChange, - "The URL bar change handler should have been called by the time the page was loaded" - ); - obs.disconnect(); - obs = null; - BrowserTestUtils.removeTab(tab); -}); - -/** - * 1) Try to load page 1 and wait for it to finish loading. - * 2) Start loading SLOW_PAGE (it won't finish loading) - * 3) Reload the page. We should have loaded page 1 now. - */ -add_task(async function testCorrectUrlBarAfterReloadingDuringSlowPageLoad() { - // Load page 1 - example.com - let page1 = "http://example.com/"; - let tab = await BrowserTestUtils.openNewForegroundTab( - gBrowser, - page1, - true, - true - ); - - let initialValue = gURLBar.untrimmedValue; - let expectedURLBarChange = SLOW_PAGE; - let sawChange = false; - let hasReloaded = false; - let handler = () => { - if (!hasReloaded) { - isnot( - gURLBar.untrimmedValue, - initialValue, - "Should not revert URL bar value!" - ); - } - if (gURLBar.getAttribute("pageproxystate") == "valid") { - sawChange = true; - is( - gURLBar.untrimmedValue, - expectedURLBarChange, - "Should set expected URL bar value!" - ); - } - }; - - let obs = new MutationObserver(handler); - - obs.observe(gURLBar.textbox, { attributes: true }); - // Start loading SLOW_PAGE - gURLBar.value = SLOW_PAGE; - gURLBar.handleCommand(); - - // Copied from the first test: If this ever starts going intermittent, - // we've broken this. - await new Promise(resolve => setTimeout(resolve, 200)); - - expectedURLBarChange = page1; - let pageLoadPromise = BrowserTestUtils.browserLoaded( - tab.linkedBrowser, - false, - page1 - ); - // Reload the page - tab.linkedBrowser.reload(); - hasReloaded = true; - is( - gURLBar.untrimmedValue, - SLOW_PAGE, - "Should not have changed URL bar value synchronously." - ); - // Wait for page1 to be loaded due to a reload while the slow page was still loading - await pageLoadPromise; - ok( - sawChange, - "The URL bar change handler should have been called by the time the page was loaded" - ); - obs.disconnect(); - obs = null; - BrowserTestUtils.removeTab(tab); -}); - -/** - * 1) Try to load example.com and wait for it to finish loading. - * 2) Start loading SLOW_PAGE and then stop the load before the load completes - * 3) Check that example.com has been loaded as a result of stopping SLOW_PAGE - * load. - */ -add_task(async function testCorrectUrlBarAfterStoppingTheLoad() { - // Load page 1 - let page1 = "http://example.com/"; - let tab = await BrowserTestUtils.openNewForegroundTab( - gBrowser, - page1, - true, - true - ); - - let initialValue = gURLBar.untrimmedValue; - let expectedURLBarChange = SLOW_PAGE; - let sawChange = false; - let hasStopped = false; - let handler = () => { - if (!hasStopped) { - isnot( - gURLBar.untrimmedValue, - initialValue, - "Should not revert URL bar value!" - ); - } - if (gURLBar.getAttribute("pageproxystate") == "valid") { - sawChange = true; - is( - gURLBar.untrimmedValue, - expectedURLBarChange, - "Should set expected URL bar value!" - ); - } - }; - - let obs = new MutationObserver(handler); - - obs.observe(gURLBar.textbox, { attributes: true }); - // Start loading SLOW_PAGE - gURLBar.value = SLOW_PAGE; - gURLBar.handleCommand(); - - // Copied from the first test case: - // If this ever starts going intermittent, we've broken this. - await new Promise(resolve => setTimeout(resolve, 200)); - - // We expect page 1 to be loaded after the SLOW_PAGE load is stopped. - expectedURLBarChange = page1; - let pageLoadPromise = BrowserTestUtils.browserStopped( - tab.linkedBrowser, - SLOW_PAGE, - true - ); - // Stop the SLOW_PAGE load - tab.linkedBrowser.stop(); - hasStopped = true; - is( - gURLBar.untrimmedValue, - SLOW_PAGE, - "Should not have changed URL bar value synchronously." - ); - // Wait for SLOW_PAGE load to stop - await pageLoadPromise; - - ok( - sawChange, - "The URL bar change handler should have been called by the time the page was loaded" - ); - obs.disconnect(); - obs = null; - BrowserTestUtils.removeTab(tab); -}); diff --git a/devtools/server/actors/network-monitor/utils/network-utils.js b/devtools/server/actors/network-monitor/utils/network-utils.js index 8a3f4b3e4627..61d8454b23d9 100644 --- a/devtools/server/actors/network-monitor/utils/network-utils.js +++ b/devtools/server/actors/network-monitor/utils/network-utils.js @@ -407,7 +407,6 @@ const ErrorCodes = { NS_ERROR_SAVE_LINK_AS_TIMEOUT: 0x805d0020, NS_ERROR_PARSED_DATA_CACHED: 0x805d0021, NS_REFRESHURI_HEADER_FOUND: 0x5d0002, - NS_BINDING_CANCELLED_OLD_LOAD: 0x805d0027, NS_ERROR_CONTENT_BLOCKED: 0x805e0006, NS_ERROR_CONTENT_BLOCKED_SHOW_ALT: 0x805e0007, NS_PROPTABLE_PROP_NOT_THERE: 0x805e000a, diff --git a/docshell/base/BrowsingContext.cpp b/docshell/base/BrowsingContext.cpp index aac26e138fc0..492246ef394b 100644 --- a/docshell/base/BrowsingContext.cpp +++ b/docshell/base/BrowsingContext.cpp @@ -3173,11 +3173,6 @@ auto BrowsingContext::CanSet(FieldIndex, return CanSetResult::Allow; } -bool BrowsingContext::CanSet(FieldIndex, - const uint64_t& aValue, ContentParent* aSource) { - return XRE_IsParentProcess() && !aSource; -} - void BrowsingContext::DidSet(FieldIndex) { RefPtr prevWindowContext = mCurrentWindowContext.forget(); mCurrentWindowContext = WindowContext::GetById(GetCurrentInnerWindowId()); diff --git a/docshell/base/BrowsingContext.h b/docshell/base/BrowsingContext.h index 930f26bf0502..eeb742c95e51 100644 --- a/docshell/base/BrowsingContext.h +++ b/docshell/base/BrowsingContext.h @@ -221,11 +221,7 @@ enum class ExplicitActiveStatus : uint8_t { /* The count of request that are used to prevent the browsing context tree \ * from being suspended, which would ONLY be modified on the top level \ * context in the chrome process because that's a non-atomic counter */ \ - FIELD(PageAwakeRequestCount, uint32_t) \ - /* This field only gets incrememented when we start navigations in the \ - * parent process. This is used for keeping track of the racing navigations \ - * between the parent and content processes. */ \ - FIELD(ParentInitiatedNavigationEpoch, uint64_t) + FIELD(PageAwakeRequestCount, uint32_t) // BrowsingContext, in this context, is the cross process replicated // environment in which information about documents is stored. In @@ -1055,9 +1051,6 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { void DidSet(FieldIndex); - bool CanSet(FieldIndex, - const uint64_t& aValue, ContentParent* aSource); - bool CanSet(FieldIndex, const bool& aValue, ContentParent* aSource); diff --git a/docshell/base/CanonicalBrowsingContext.cpp b/docshell/base/CanonicalBrowsingContext.cpp index 06916dfec347..440ff57b4086 100644 --- a/docshell/base/CanonicalBrowsingContext.cpp +++ b/docshell/base/CanonicalBrowsingContext.cpp @@ -69,9 +69,6 @@ static mozilla::LazyLogModule sPBContext("PBContext"); // Global count of canonical browsing contexts with the private attribute set static uint32_t gNumberOfPrivateContexts = 0; -// Current parent process epoch for parent initiated navigations -static uint64_t gParentInitiatedNavigationEpoch = 0; - static void IncreasePrivateCount() { gNumberOfPrivateContexts++; MOZ_LOG(sPBContext, mozilla::LogLevel::Debug, @@ -1138,10 +1135,6 @@ void CanonicalBrowsingContext::CanonicalDiscard() { mTabMediaController = nullptr; } - if (mCurrentLoad) { - mCurrentLoad->Cancel(NS_BINDING_ABORTED); - } - if (mWebProgress) { RefPtr progress = mWebProgress; progress->ContextDiscarded(); @@ -1297,7 +1290,7 @@ void CanonicalBrowsingContext::GoBack( // Stop any known network loads if necessary. if (mCurrentLoad) { - mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD); + mCurrentLoad->Cancel(NS_BINDING_ABORTED); } if (nsDocShell* docShell = nsDocShell::Cast(GetDocShell())) { @@ -1323,7 +1316,7 @@ void CanonicalBrowsingContext::GoForward( // Stop any known network loads if necessary. if (mCurrentLoad) { - mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD); + mCurrentLoad->Cancel(NS_BINDING_ABORTED); } if (auto* docShell = nsDocShell::Cast(GetDocShell())) { @@ -1349,7 +1342,7 @@ void CanonicalBrowsingContext::GoToIndex( // Stop any known network loads if necessary. if (mCurrentLoad) { - mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD); + mCurrentLoad->Cancel(NS_BINDING_ABORTED); } if (auto* docShell = nsDocShell::Cast(GetDocShell())) { @@ -1373,7 +1366,7 @@ void CanonicalBrowsingContext::Reload(uint32_t aReloadFlags) { // Stop any known network loads if necessary. if (mCurrentLoad) { - mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD); + mCurrentLoad->Cancel(NS_BINDING_ABORTED); } if (auto* docShell = nsDocShell::Cast(GetDocShell())) { @@ -2037,8 +2030,7 @@ bool CanonicalBrowsingContext::LoadInParent(nsDocShellLoadState* aLoadState, // We currently only support starting loads directly from the // CanonicalBrowsingContext for top-level BCs. if (!IsTopContent() || !GetContentParent() || - !StaticPrefs::browser_tabs_documentchannel_parent_controlled() || - !mozilla::SessionHistoryInParent()) { + !StaticPrefs::browser_tabs_documentchannel_parent_controlled()) { return false; } @@ -2047,10 +2039,6 @@ bool CanonicalBrowsingContext::LoadInParent(nsDocShellLoadState* aLoadState, return false; } - MOZ_ASSERT(!net::SchemeIsJavascript(aLoadState->URI())); - - MOZ_ALWAYS_SUCCEEDS( - SetParentInitiatedNavigationEpoch(++gParentInitiatedNavigationEpoch)); // Note: If successful, this will recurse into StartDocumentLoad and // set mCurrentLoad to the DocumentLoadListener instance created. // Ideally in the future we will only start loads from here, and we can @@ -2066,8 +2054,7 @@ bool CanonicalBrowsingContext::AttemptSpeculativeLoadInParent( // We currently only support starting loads directly from the // CanonicalBrowsingContext for top-level BCs. if (!IsTopContent() || !GetContentParent() || - (StaticPrefs::browser_tabs_documentchannel_parent_controlled() && - mozilla::SessionHistoryInParent())) { + StaticPrefs::browser_tabs_documentchannel_parent_controlled()) { return false; } @@ -2087,14 +2074,8 @@ bool CanonicalBrowsingContext::StartDocumentLoad( // If we're controlling loads from the parent, then starting a new load means // that we need to cancel any existing ones. if (StaticPrefs::browser_tabs_documentchannel_parent_controlled() && - mozilla::SessionHistoryInParent() && mCurrentLoad) { - // Make sure we are not loading a javascript URI. - MOZ_ASSERT(!aLoad->IsLoadingJSURI()); - - // If we want to do a download, don't cancel the current navigation. - if (!aLoad->IsDownload()) { - mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD); - } + mCurrentLoad) { + mCurrentLoad->Cancel(NS_BINDING_ABORTED); } mCurrentLoad = aLoad; diff --git a/dom/security/test/general/browser_test_referrer_loadInOtherProcess.js b/dom/security/test/general/browser_test_referrer_loadInOtherProcess.js index 4ad4de92630a..2d63f2eae03b 100644 --- a/dom/security/test/general/browser_test_referrer_loadInOtherProcess.js +++ b/dom/security/test/general/browser_test_referrer_loadInOtherProcess.js @@ -142,8 +142,6 @@ add_task(async function test_navigation() { // Navigate from remote to non-remote gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, TEST_PAGE); - // Wait for the non-blank page to finish loading - await BrowserTestUtils.browserStopped(gBrowser, TEST_PAGE); testURI = "about:mozilla"; permanentKey = gBrowser.selectedBrowser.permanentKey; await waitForLoad(testURI); diff --git a/js/xpconnect/src/xpc.msg b/js/xpconnect/src/xpc.msg index 0c59109f2fb0..3e90f43e8821 100644 --- a/js/xpconnect/src/xpc.msg +++ b/js/xpconnect/src/xpc.msg @@ -250,6 +250,3 @@ XPC_MSG_DEF(NS_ERROR_SOCIALTRACKING_URI , "The URI is social track /* Profile manager error codes */ XPC_MSG_DEF(NS_ERROR_DATABASE_CHANGED , "Flushing the profiles to disk would have overwritten changes made elsewhere.") - -/* Codes related to URILoader */ -XPC_MSG_DEF(NS_BINDING_CANCELLED_OLD_LOAD , "The async request has been cancelled by another async request") diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index dee800a3e4e4..188e038663ef 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -1335,7 +1335,7 @@ # from parent-process BrowsingContexts - name: browser.tabs.documentchannel.parent-controlled type: bool - value: true + value: false mirror: always # Testing-only pref which makes data: URIs be loaded in a "web" content process diff --git a/netwerk/ipc/DocumentChannelChild.cpp b/netwerk/ipc/DocumentChannelChild.cpp index e3006798bd44..0a052c388d6a 100644 --- a/netwerk/ipc/DocumentChannelChild.cpp +++ b/netwerk/ipc/DocumentChannelChild.cpp @@ -113,8 +113,6 @@ DocumentChannelChild::AsyncOpen(nsIStreamListener* aListener) { args.cacheKey() = mCacheKey; args.channelId() = mChannelId; args.asyncOpenTime() = TimeStamp::Now(); - args.parentInitiatedNavigationEpoch() = - loadingContext->GetParentInitiatedNavigationEpoch(); Maybe ipcClientInfo; if (mInitialClientInfo.isSome()) { diff --git a/netwerk/ipc/DocumentChannelParent.cpp b/netwerk/ipc/DocumentChannelParent.cpp index e162b7c5f283..20ab03ed4c6a 100644 --- a/netwerk/ipc/DocumentChannelParent.cpp +++ b/netwerk/ipc/DocumentChannelParent.cpp @@ -35,11 +35,6 @@ bool DocumentChannelParent::Init(dom::CanonicalBrowsingContext* aContext, new nsDocShellLoadState(aArgs.loadState()); LOG(("DocumentChannelParent Init [this=%p, uri=%s]", this, loadState->URI()->GetSpecOrDefault().get())); - if (aArgs.parentInitiatedNavigationEpoch() < - aContext->GetParentInitiatedNavigationEpoch()) { - nsresult rv = NS_BINDING_ABORTED; - return SendFailedAsyncOpen(rv); - } ContentParent* contentParent = static_cast(Manager()->Manager()); diff --git a/netwerk/ipc/DocumentLoadListener.cpp b/netwerk/ipc/DocumentLoadListener.cpp index dd259e51ff25..5aaf1775e6d7 100644 --- a/netwerk/ipc/DocumentLoadListener.cpp +++ b/netwerk/ipc/DocumentLoadListener.cpp @@ -532,9 +532,6 @@ auto DocumentLoadListener::Open(nsDocShellLoadState* aLoadState, loadingContext->GetOriginAttributes(attrs); mLoadIdentifier = aLoadState->GetLoadIdentifier(); - // See description of mFileName in nsDocShellLoadState.h - mIsDownload = !aLoadState->FileName().IsVoid(); - mIsLoadingJSURI = net::SchemeIsJavascript(aLoadState->URI()); // Check for infinite recursive object or iframe loads if (aLoadState->OriginalFrameSrc() || !mIsDocumentLoad) { @@ -762,22 +759,6 @@ auto DocumentLoadListener::Open(nsDocShellLoadState* aLoadState, "mismatched parent window context?"); } - // For content-initiated loads, this flag is set in nsDocShell::LoadURI. - // For parent-initiated loads, we have to set it here. - // Below comment is copied from nsDocShell::LoadURI - - // If we have a system triggering principal, we can assume that this load was - // triggered by some UI in the browser chrome, such as the URL bar or - // bookmark bar. This should count as a user interaction for the current sh - // entry, so that the user may navigate back to the current entry, from the - // entry that is going to be added as part of this load. - if (!mSupportsRedirectToRealChannel && aLoadState->TriggeringPrincipal() && - aLoadState->TriggeringPrincipal()->IsSystemPrincipal()) { - WindowContext* topWc = loadingContext->GetTopWindowContext(); - if (topWc && !topWc->IsDiscarded()) { - MOZ_ALWAYS_SUCCEEDS(topWc->SetSHEntryHasUserInteraction(true)); - } - } - *aRv = NS_OK; mOpenPromise = new OpenPromise::Private(__func__); // We make the promise use direct task dispatch in order to reduce the number @@ -2253,6 +2234,10 @@ DocumentLoadListener::OnStartRequest(nsIRequest* aRequest) { DisconnectListeners(NS_BINDING_ABORTED, NS_BINDING_ABORTED, true); + // XXX(anny) This is currently a dead code path because parent-controlled + // DC pref is off. When we enable the pref, we might get extra STATE_START + // progress events + // Notify the docshell that it should load using the newly connected // channel browserParent->ResumeLoad(mLoadIdentifier); diff --git a/netwerk/ipc/DocumentLoadListener.h b/netwerk/ipc/DocumentLoadListener.h index a581268d88c2..9d1a102fd068 100644 --- a/netwerk/ipc/DocumentLoadListener.h +++ b/netwerk/ipc/DocumentLoadListener.h @@ -282,8 +282,6 @@ class DocumentLoadListener : public nsIInterfaceRequestor, uint64_t GetLoadIdentifier() const { return mLoadIdentifier; } uint32_t GetLoadType() const { return mLoadStateLoadType; } - bool IsDownload() const { return mIsDownload; } - bool IsLoadingJSURI() const { return mIsLoadingJSURI; } mozilla::dom::LoadingSessionHistoryInfo* GetLoadingSessionHistoryInfo() { return mLoadingSessionHistoryInfo.get(); @@ -540,12 +538,6 @@ class DocumentLoadListener : public nsIInterfaceRequestor, uint32_t mLoadStateInternalLoadFlags = 0; uint32_t mLoadStateLoadType = 0; - // Indicates if this load is a download. - bool mIsDownload = false; - - // Indicates if we are loading a javascript URI. - bool mIsLoadingJSURI = false; - // Corresponding redirect channel registrar Id for the final channel that // we want to use when redirecting the child, or doing a process switch. // 0 means redirection is not started. @@ -576,7 +568,6 @@ class DocumentLoadListener : public nsIInterfaceRequestor, Maybe mOriginalUriString; - // Parent-initiated loads do not support redirects to real channels. bool mSupportsRedirectToRealChannel = true; Maybe mRemoteTypeOverride; diff --git a/netwerk/ipc/NeckoChannelParams.ipdlh b/netwerk/ipc/NeckoChannelParams.ipdlh index 13c98e5bcd1b..dad3d32a10a3 100644 --- a/netwerk/ipc/NeckoChannelParams.ipdlh +++ b/netwerk/ipc/NeckoChannelParams.ipdlh @@ -440,7 +440,6 @@ struct DocumentChannelCreationArgs { nsDOMNavigationTiming? timing; IPCClientInfo? initialClientInfo; DocumentChannelElementCreationArgs elementCreationArgs; - uint64_t parentInitiatedNavigationEpoch; }; struct RedirectToRealChannelArgs { diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js b/toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js index 64ada4497e69..71174716fd07 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js @@ -476,9 +476,7 @@ add_task(async function test_contentscripts_register_js() { let completePromise = new Promise(resolve => { extension.onMessage("script-run-complete", () => { completeCount++; - if (completeCount == 2) { - resolve(); - } + resolve(); }); }); diff --git a/uriloader/exthandler/tests/mochitest/browser_download_open_with_internal_handler.js b/uriloader/exthandler/tests/mochitest/browser_download_open_with_internal_handler.js index 46f9d6cc1128..f9af76bf3b57 100644 --- a/uriloader/exthandler/tests/mochitest/browser_download_open_with_internal_handler.js +++ b/uriloader/exthandler/tests/mochitest/browser_download_open_with_internal_handler.js @@ -147,12 +147,10 @@ add_task(async function test_check_open_with_internal_handler() { await publicList.removeFinished(); }); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + file, - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + file + ); // Add an extra tab after the loading tab so we can test that // pdf.js is opened in the adjacent tab and not at the end of // the tab strip. @@ -344,12 +342,10 @@ add_task(async function test_check_open_with_external_application() { await publicList.removeFinished(); }); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + file, - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + file + ); let dialogWindow = await dialogWindowPromise; is( dialogWindow.location.href, @@ -448,12 +444,10 @@ add_task(async function test_check_open_with_external_then_internal() { let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); // Open a new tab to the PDF file which will trigger the Unknown Content Type dialog // and choose to open the PDF with an external application. - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + file, - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + file + ); let dialogWindow = await dialogWindowPromise; is( dialogWindow.location.href, @@ -507,12 +501,10 @@ add_task(async function test_check_open_with_external_then_internal() { // and choose to open the PDF internally. The previously used external application should be shown as // the external option. dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); - loadingTab = await BrowserTestUtils.openNewForegroundTab({ + loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + file, - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + file + ); dialogWindow = await dialogWindowPromise; is( dialogWindow.location.href, @@ -592,12 +584,10 @@ add_task( ["file_xml_attachment_test.xml", true], ]) { let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + file, - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + file + ); let dialogWindow = await dialogWindowPromise; is( dialogWindow.location.href, @@ -645,12 +635,10 @@ add_task(async function test_internal_handler_hidden_with_other_type() { }); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + "file_txt_attachment_test.txt", - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + "file_txt_attachment_test.txt" + ); let dialogWindow = await dialogWindowPromise; is( dialogWindow.location.href, @@ -701,12 +689,10 @@ add_task(async function test_internal_handler_hidden_with_pdf_pref_disabled() { "file_pdf_binary_octet_stream.pdf", ]) { let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + file, - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + file + ); let dialogWindow = await dialogWindowPromise; is( dialogWindow.location.href, @@ -745,12 +731,10 @@ add_task( set: [["browser.helperApps.showOpenOptionForViewableInternally", false]], }); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + "file_xml_attachment_test.xml", - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + "file_xml_attachment_test.xml" + ); let dialogWindow = await dialogWindowPromise; is( dialogWindow.location.href, diff --git a/uriloader/exthandler/tests/mochitest/browser_download_skips_dialog.js b/uriloader/exthandler/tests/mochitest/browser_download_skips_dialog.js index a4bdc447ca9d..42bc7158fddd 100644 --- a/uriloader/exthandler/tests/mochitest/browser_download_skips_dialog.js +++ b/uriloader/exthandler/tests/mochitest/browser_download_skips_dialog.js @@ -24,12 +24,10 @@ add_task(async function skipDialogAndDownloadFile() { let initialTabsCount = gBrowser.tabs.length; - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + "file_image_svgxml.svg", - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + "file_image_svgxml.svg" + ); // We just open the file to be downloaded... and wait for it to be downloaded! // We see no dialogs to be accepted in the process. diff --git a/uriloader/exthandler/tests/mochitest/browser_download_spam_permissions.js b/uriloader/exthandler/tests/mochitest/browser_download_spam_permissions.js index b82f31b1b217..46ed9b7a2181 100644 --- a/uriloader/exthandler/tests/mochitest/browser_download_spam_permissions.js +++ b/uriloader/exthandler/tests/mochitest/browser_download_spam_permissions.js @@ -88,7 +88,7 @@ add_task(async function check_download_spam_permissions() { }); let download = await downloadFinishedPromise; - await TestUtils.waitForCondition( + TestUtils.waitForCondition( () => gBrowser.tabs.length == INITIAL_TABS_COUNT + 1 ); is( @@ -109,8 +109,7 @@ add_task(async function check_download_spam_permissions() { "An other file should be blocked" ); - info("Will wait for blockedDownloadsCount to be >= 99"); - await TestUtils.waitForCondition(() => blockedDownloadsCount >= 99); + TestUtils.waitForCondition(() => blockedDownloadsCount >= 99); is(blockedDownloadsCount, 99, "Browser should block 99 downloads"); is( blockedDownloadsURI, diff --git a/uriloader/exthandler/tests/mochitest/browser_extension_correction.js b/uriloader/exthandler/tests/mochitest/browser_extension_correction.js index 508635a2b23f..3b0248b227ae 100644 --- a/uriloader/exthandler/tests/mochitest/browser_extension_correction.js +++ b/uriloader/exthandler/tests/mochitest/browser_extension_correction.js @@ -167,12 +167,10 @@ add_task(async function test_broken_saved_handlerinfo_and_useless_mimetypes() { handlerSvc.store(bogusType); let tabToClean = null; let task = function() { - return BrowserTestUtils.openNewForegroundTab({ + return BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + "file_as.exe?foo=bar", - waitForLoad: false, - waitForStateStop: true, - }).then(tab => { + TEST_PATH + "file_as.exe?foo=bar" + ).then(tab => { return (tabToClean = tab); }); }; diff --git a/uriloader/exthandler/tests/mochitest/browser_launched_app_save_directory.js b/uriloader/exthandler/tests/mochitest/browser_launched_app_save_directory.js index 362d2a945ff9..6d92100ce9fa 100644 --- a/uriloader/exthandler/tests/mochitest/browser_launched_app_save_directory.js +++ b/uriloader/exthandler/tests/mochitest/browser_launched_app_save_directory.js @@ -33,12 +33,10 @@ async function aDownloadLaunchedWithAppIsSavedInFolder(downloadDir) { let downloadFinishedPromise = promiseDownloadFinished(publicList); let initialTabsCount = gBrowser.tabs.length; - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + "file_image_svgxml.svg", - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + "file_image_svgxml.svg" + ); let download = await downloadFinishedPromise; await BrowserTestUtils.waitForCondition( diff --git a/uriloader/exthandler/tests/mochitest/browser_open_internal_choice_persistence.js b/uriloader/exthandler/tests/mochitest/browser_open_internal_choice_persistence.js index b770bd4515b9..4a6d2875ce18 100644 --- a/uriloader/exthandler/tests/mochitest/browser_open_internal_choice_persistence.js +++ b/uriloader/exthandler/tests/mochitest/browser_open_internal_choice_persistence.js @@ -172,12 +172,10 @@ add_task(async function test_check_saving_handler_choices() { ensureMIMEState(testCase.preDialogState); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + file, - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + file + ); let dialogWindow = await dialogWindowPromise; is( dialogWindow.location.href, @@ -389,12 +387,10 @@ add_task( info("Load window and tabs"); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + file, - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + file + ); // See if UCT window appears in loaded tab. let dialogWindow = await Promise.race([ diff --git a/uriloader/exthandler/tests/mochitest/browser_shows_where_to_save_dialog.js b/uriloader/exthandler/tests/mochitest/browser_shows_where_to_save_dialog.js index 40ba3d8daceb..81dcd413d645 100644 --- a/uriloader/exthandler/tests/mochitest/browser_shows_where_to_save_dialog.js +++ b/uriloader/exthandler/tests/mochitest/browser_shows_where_to_save_dialog.js @@ -51,12 +51,10 @@ add_task(async function aDownloadLaunchedWithAppPromptsForFolder() { }; }); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + "file_txt_attachment_test.txt", - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + "file_txt_attachment_test.txt" + ); await filePickerShown; @@ -70,12 +68,10 @@ add_task(async function testFilesHandledInternally() { ensureMIMEState({ preferredAction: handleInternally }); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + "file_image_svgxml.svg", - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + "file_image_svgxml.svg" + ); await TestUtils.waitForCondition(() => { return ( @@ -110,12 +106,10 @@ add_task(async function testFilesHandledBySystemDefaultApp() { }; }); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + "file_pdf_application_pdf.pdf", - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + "file_pdf_application_pdf.pdf" + ); await launchFileCalled; @@ -176,12 +170,10 @@ add_task(async function testFilesHandledByHelperApp() { }; }); - let loadingTab = await BrowserTestUtils.openNewForegroundTab({ + let loadingTab = await BrowserTestUtils.openNewForegroundTab( gBrowser, - opening: TEST_PATH + "file_pdf_application_pdf.pdf", - waitForLoad: false, - waitForStateStop: true, - }); + TEST_PATH + "file_pdf_application_pdf.pdf" + ); await downloadFinishedPromise; await launchFileCalled; diff --git a/xpcom/base/ErrorList.py b/xpcom/base/ErrorList.py index 92c37f26ff02..70f9d588fa04 100755 --- a/xpcom/base/ErrorList.py +++ b/xpcom/base/ErrorList.py @@ -939,11 +939,6 @@ with modules["URILOADER"]: # successfully setup. errors["NS_REFRESHURI_HEADER_FOUND"] = SUCCESS(2) - # When browser.tabs.documentchannel.parent-controlled pref and SHIP - # are enabled and a load gets cancelled due to another one - # starting, the error is NS_BINDING_CANCELLED_OLD_LOAD. - errors["NS_BINDING_CANCELLED_OLD_LOAD"] = FAILURE(39) - # ======================================================================= # 25: NS_ERROR_MODULE_CONTENT