Backed out 11 changesets (bug 1721217) for bc failures on browser_scrollPositions.js . CLOSED TREE

Backed out changeset 750f4a84b30e (bug 1721217)
Backed out changeset c4eb4ad769ad (bug 1721217)
Backed out changeset 81af11d67439 (bug 1721217)
Backed out changeset 548f2441b7c6 (bug 1721217)
Backed out changeset cd584129321a (bug 1721217)
Backed out changeset f5f5291d1da8 (bug 1721217)
Backed out changeset 9ad66ceec1e2 (bug 1721217)
Backed out changeset 10b53a21bb23 (bug 1721217)
Backed out changeset 3755cfbe22fe (bug 1721217)
Backed out changeset 71436dc6c4c4 (bug 1721217)
Backed out changeset ecf33b73ae60 (bug 1721217)
This commit is contained in:
Narcis Beleuzu
2021-11-26 01:51:03 +02:00
parent 89a56c2178
commit 96c4882d22
30 changed files with 150 additions and 655 deletions

View File

@@ -6403,24 +6403,9 @@
// before the location changed. // before the location changed.
this.mBrowser.userTypedValue = null; 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; let isNavigating = this.mBrowser.isNavigating;
if ( if (this.mTab.selected && !isNavigating) {
this.mTab.selected &&
aStatus != Cr.NS_BINDING_CANCELLED_OLD_LOAD &&
!isNavigating
) {
gURLBar.setURI(); gURLBar.setURI();
} }
} else if (isSuccessful) { } else if (isSuccessful) {

View File

@@ -50,10 +50,6 @@ add_task(async function test_unknown_host() {
EventUtils.synthesizeKey("KEY_Enter"); EventUtils.synthesizeKey("KEY_Enter");
await searchPromise; 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"); ok(kButton.hasAttribute("displaystop"), "Should be showing stop");
await TestUtils.waitForCondition( await TestUtils.waitForCondition(

View File

@@ -63,14 +63,7 @@ add_task(async function test_overwrite_does_not_delete_first() {
let dialogPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); let dialogPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
// Now try and download a thing to the file: // Now try and download a thing to the file:
await BrowserTestUtils.withNewTab( await BrowserTestUtils.withNewTab(TEST_ROOT + "foo.txt", async function() {
{
gBrowser,
opening: TEST_ROOT + "foo.txt",
waitForLoad: false,
waitForStateStop: true,
},
async function() {
if ( if (
!Services.prefs.getBoolPref( !Services.prefs.getBoolPref(
"browser.download.improvements_to_download_panel" "browser.download.improvements_to_download_panel"
@@ -98,8 +91,7 @@ add_task(async function test_overwrite_does_not_delete_first() {
// like this. // like this.
mockTransferRegisterer.unregister(); mockTransferRegisterer.unregister();
unregisteredTransfer = true; unregisteredTransfer = true;
} });
);
}); });
// If we download a file and the user accepts overwriting an existing one, // If we download a file and the user accepts overwriting an existing one,
@@ -122,14 +114,7 @@ add_task(async function test_overwrite_works() {
}); });
}); });
// Now try and download a thing to the file: // Now try and download a thing to the file:
await BrowserTestUtils.withNewTab( await BrowserTestUtils.withNewTab(TEST_ROOT + "foo.txt", async function() {
{
gBrowser,
opening: TEST_ROOT + "foo.txt",
waitForLoad: false,
waitForStateStop: true,
},
async function() {
if ( if (
!Services.prefs.getBoolPref( !Services.prefs.getBoolPref(
"browser.download.improvements_to_download_panel" "browser.download.improvements_to_download_panel"
@@ -159,6 +144,5 @@ add_task(async function test_overwrite_works() {
); );
info("Got: " + contents); info("Got: " + contents);
ok(contents.startsWith("Dummy"), "The file was overwritten."); ok(contents.startsWith("Dummy"), "The file was overwritten.");
} });
);
}); });

View File

@@ -339,7 +339,6 @@ skip-if =
https_first_disabled = true https_first_disabled = true
[browser_ext_user_events.js] [browser_ext_user_events.js]
[browser_ext_webRequest.js] [browser_ext_webRequest.js]
[browser_ext_webRequest_error_after_stopped_or_closed.js]
[browser_ext_webrtc.js] [browser_ext_webrtc.js]
skip-if = os == 'mac' # Bug 1565738 skip-if = os == 'mac' # Bug 1565738
[browser_ext_webNavigation_containerIsolation.js] [browser_ext_webNavigation_containerIsolation.js]

View File

@@ -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);
});
});

View File

@@ -112,12 +112,10 @@ add_task(async function alwaysAskPreferenceWorks() {
); );
let domWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); let domWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + "empty_pdf_file.pdf", TEST_PATH + "empty_pdf_file.pdf"
waitForLoad: false, );
waitForStateStop: true,
});
let domWindow = await domWindowPromise; let domWindow = await domWindowPromise;
let dialog = domWindow.document.querySelector("#unknownContentType"); let dialog = domWindow.document.querySelector("#unknownContentType");
@@ -156,12 +154,10 @@ add_task(async function handleInternallyPreferenceWorks() {
"Should have selected 'handle internally' for pdf" "Should have selected 'handle internally' for pdf"
); );
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + "empty_pdf_file.pdf", TEST_PATH + "empty_pdf_file.pdf"
waitForLoad: false, );
waitForStateStop: true,
});
await ContentTask.spawn(loadingTab.linkedBrowser, null, async () => { await ContentTask.spawn(loadingTab.linkedBrowser, null, async () => {
await ContentTaskUtils.waitForCondition( await ContentTaskUtils.waitForCondition(
@@ -207,12 +203,10 @@ add_task(async function saveToDiskPreferenceWorks() {
let downloadFinishedPromise = downloadHadFinished(publicList); let downloadFinishedPromise = downloadHadFinished(publicList);
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + "empty_pdf_file.pdf", TEST_PATH + "empty_pdf_file.pdf"
waitForLoad: false, );
waitForStateStop: true,
});
let download = await downloadFinishedPromise; let download = await downloadFinishedPromise;
BrowserTestUtils.removeTab(loadingTab); BrowserTestUtils.removeTab(loadingTab);
@@ -269,12 +263,10 @@ add_task(async function useSystemDefaultPreferenceWorks() {
let downloadFinishedPromise = downloadHadFinished(publicList); let downloadFinishedPromise = downloadHadFinished(publicList);
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + "empty_pdf_file.pdf", TEST_PATH + "empty_pdf_file.pdf"
waitForLoad: false, );
waitForStateStop: true,
});
info("Downloading had finished"); info("Downloading had finished");
let download = await downloadFinishedPromise; let download = await downloadFinishedPromise;
@@ -338,12 +330,10 @@ add_task(async function useSystemDefaultAndAskForDestinationWorks() {
MockFilePicker.cleanup(); MockFilePicker.cleanup();
}); });
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + "empty_pdf_file.pdf", TEST_PATH + "empty_pdf_file.pdf"
waitForLoad: false, );
waitForStateStop: true,
});
await filePickerShown; await filePickerShown;

View File

@@ -193,11 +193,12 @@ async function testSearchEngine(engineDetails) {
await test.preTest(tab); await test.preTest(tab);
} }
let googleUrl =
"https://www.google.com/search?client=" + test.code + "&q=foo";
let promises = [ let promises = [
BrowserTestUtils.waitForDocLoadAndStopIt(googleUrl, tab), BrowserTestUtils.waitForDocLoadAndStopIt(
BrowserTestUtils.browserStopped(tab.linkedBrowser, googleUrl, true), "https://www.google.com/search?client=" + test.code + "&q=foo",
tab
),
BrowserTestUtils.browserStopped(tab.linkedBrowser, null, true),
]; ];
await test.run(tab); await test.run(tab);

View File

@@ -173,8 +173,8 @@ async function testSearchEngine(engineDetails) {
async preTest(tab) { async preTest(tab) {
let browser = tab.linkedBrowser; let browser = tab.linkedBrowser;
BrowserTestUtils.loadURI(browser, "about:newtab"); BrowserTestUtils.loadURI(browser, "about:newtab");
await BrowserTestUtils.browserLoaded(browser, false, "about:newtab"); await BrowserTestUtils.browserLoaded(browser, false, "about:newtab");
await promiseContentSearchReady(browser); await promiseContentSearchReady(browser);
}, },
async run(tab) { async run(tab) {
@@ -199,7 +199,7 @@ async function testSearchEngine(engineDetails) {
let promises = [ let promises = [
BrowserTestUtils.waitForDocLoadAndStopIt(test.searchURL, tab), BrowserTestUtils.waitForDocLoadAndStopIt(test.searchURL, tab),
BrowserTestUtils.browserStopped(tab.linkedBrowser, test.searchURL, true), BrowserTestUtils.browserStopped(tab.linkedBrowser, null, true),
]; ];
await test.run(tab); await test.run(tab);

View File

@@ -218,242 +218,3 @@ add_task(async function() {
BrowserTestUtils.removeTab(newTab); BrowserTestUtils.removeTab(newTab);
BrowserTestUtils.removeTab(tab); 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);
});

View File

@@ -407,7 +407,6 @@ const ErrorCodes = {
NS_ERROR_SAVE_LINK_AS_TIMEOUT: 0x805d0020, NS_ERROR_SAVE_LINK_AS_TIMEOUT: 0x805d0020,
NS_ERROR_PARSED_DATA_CACHED: 0x805d0021, NS_ERROR_PARSED_DATA_CACHED: 0x805d0021,
NS_REFRESHURI_HEADER_FOUND: 0x5d0002, NS_REFRESHURI_HEADER_FOUND: 0x5d0002,
NS_BINDING_CANCELLED_OLD_LOAD: 0x805d0027,
NS_ERROR_CONTENT_BLOCKED: 0x805e0006, NS_ERROR_CONTENT_BLOCKED: 0x805e0006,
NS_ERROR_CONTENT_BLOCKED_SHOW_ALT: 0x805e0007, NS_ERROR_CONTENT_BLOCKED_SHOW_ALT: 0x805e0007,
NS_PROPTABLE_PROP_NOT_THERE: 0x805e000a, NS_PROPTABLE_PROP_NOT_THERE: 0x805e000a,

View File

@@ -3173,11 +3173,6 @@ auto BrowsingContext::CanSet(FieldIndex<IDX_CurrentInnerWindowId>,
return CanSetResult::Allow; return CanSetResult::Allow;
} }
bool BrowsingContext::CanSet(FieldIndex<IDX_ParentInitiatedNavigationEpoch>,
const uint64_t& aValue, ContentParent* aSource) {
return XRE_IsParentProcess() && !aSource;
}
void BrowsingContext::DidSet(FieldIndex<IDX_CurrentInnerWindowId>) { void BrowsingContext::DidSet(FieldIndex<IDX_CurrentInnerWindowId>) {
RefPtr<WindowContext> prevWindowContext = mCurrentWindowContext.forget(); RefPtr<WindowContext> prevWindowContext = mCurrentWindowContext.forget();
mCurrentWindowContext = WindowContext::GetById(GetCurrentInnerWindowId()); mCurrentWindowContext = WindowContext::GetById(GetCurrentInnerWindowId());

View File

@@ -221,11 +221,7 @@ enum class ExplicitActiveStatus : uint8_t {
/* The count of request that are used to prevent the browsing context tree \ /* 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 \ * from being suspended, which would ONLY be modified on the top level \
* context in the chrome process because that's a non-atomic counter */ \ * context in the chrome process because that's a non-atomic counter */ \
FIELD(PageAwakeRequestCount, uint32_t) \ 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)
// BrowsingContext, in this context, is the cross process replicated // BrowsingContext, in this context, is the cross process replicated
// environment in which information about documents is stored. In // environment in which information about documents is stored. In
@@ -1055,9 +1051,6 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {
void DidSet(FieldIndex<IDX_CurrentInnerWindowId>); void DidSet(FieldIndex<IDX_CurrentInnerWindowId>);
bool CanSet(FieldIndex<IDX_ParentInitiatedNavigationEpoch>,
const uint64_t& aValue, ContentParent* aSource);
bool CanSet(FieldIndex<IDX_IsPopupSpam>, const bool& aValue, bool CanSet(FieldIndex<IDX_IsPopupSpam>, const bool& aValue,
ContentParent* aSource); ContentParent* aSource);

View File

@@ -69,9 +69,6 @@ static mozilla::LazyLogModule sPBContext("PBContext");
// Global count of canonical browsing contexts with the private attribute set // Global count of canonical browsing contexts with the private attribute set
static uint32_t gNumberOfPrivateContexts = 0; static uint32_t gNumberOfPrivateContexts = 0;
// Current parent process epoch for parent initiated navigations
static uint64_t gParentInitiatedNavigationEpoch = 0;
static void IncreasePrivateCount() { static void IncreasePrivateCount() {
gNumberOfPrivateContexts++; gNumberOfPrivateContexts++;
MOZ_LOG(sPBContext, mozilla::LogLevel::Debug, MOZ_LOG(sPBContext, mozilla::LogLevel::Debug,
@@ -1138,10 +1135,6 @@ void CanonicalBrowsingContext::CanonicalDiscard() {
mTabMediaController = nullptr; mTabMediaController = nullptr;
} }
if (mCurrentLoad) {
mCurrentLoad->Cancel(NS_BINDING_ABORTED);
}
if (mWebProgress) { if (mWebProgress) {
RefPtr<BrowsingContextWebProgress> progress = mWebProgress; RefPtr<BrowsingContextWebProgress> progress = mWebProgress;
progress->ContextDiscarded(); progress->ContextDiscarded();
@@ -1297,7 +1290,7 @@ void CanonicalBrowsingContext::GoBack(
// Stop any known network loads if necessary. // Stop any known network loads if necessary.
if (mCurrentLoad) { if (mCurrentLoad) {
mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD); mCurrentLoad->Cancel(NS_BINDING_ABORTED);
} }
if (nsDocShell* docShell = nsDocShell::Cast(GetDocShell())) { if (nsDocShell* docShell = nsDocShell::Cast(GetDocShell())) {
@@ -1323,7 +1316,7 @@ void CanonicalBrowsingContext::GoForward(
// Stop any known network loads if necessary. // Stop any known network loads if necessary.
if (mCurrentLoad) { if (mCurrentLoad) {
mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD); mCurrentLoad->Cancel(NS_BINDING_ABORTED);
} }
if (auto* docShell = nsDocShell::Cast(GetDocShell())) { if (auto* docShell = nsDocShell::Cast(GetDocShell())) {
@@ -1349,7 +1342,7 @@ void CanonicalBrowsingContext::GoToIndex(
// Stop any known network loads if necessary. // Stop any known network loads if necessary.
if (mCurrentLoad) { if (mCurrentLoad) {
mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD); mCurrentLoad->Cancel(NS_BINDING_ABORTED);
} }
if (auto* docShell = nsDocShell::Cast(GetDocShell())) { if (auto* docShell = nsDocShell::Cast(GetDocShell())) {
@@ -1373,7 +1366,7 @@ void CanonicalBrowsingContext::Reload(uint32_t aReloadFlags) {
// Stop any known network loads if necessary. // Stop any known network loads if necessary.
if (mCurrentLoad) { if (mCurrentLoad) {
mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD); mCurrentLoad->Cancel(NS_BINDING_ABORTED);
} }
if (auto* docShell = nsDocShell::Cast(GetDocShell())) { if (auto* docShell = nsDocShell::Cast(GetDocShell())) {
@@ -2037,8 +2030,7 @@ bool CanonicalBrowsingContext::LoadInParent(nsDocShellLoadState* aLoadState,
// We currently only support starting loads directly from the // We currently only support starting loads directly from the
// CanonicalBrowsingContext for top-level BCs. // CanonicalBrowsingContext for top-level BCs.
if (!IsTopContent() || !GetContentParent() || if (!IsTopContent() || !GetContentParent() ||
!StaticPrefs::browser_tabs_documentchannel_parent_controlled() || !StaticPrefs::browser_tabs_documentchannel_parent_controlled()) {
!mozilla::SessionHistoryInParent()) {
return false; return false;
} }
@@ -2047,10 +2039,6 @@ bool CanonicalBrowsingContext::LoadInParent(nsDocShellLoadState* aLoadState,
return false; return false;
} }
MOZ_ASSERT(!net::SchemeIsJavascript(aLoadState->URI()));
MOZ_ALWAYS_SUCCEEDS(
SetParentInitiatedNavigationEpoch(++gParentInitiatedNavigationEpoch));
// Note: If successful, this will recurse into StartDocumentLoad and // Note: If successful, this will recurse into StartDocumentLoad and
// set mCurrentLoad to the DocumentLoadListener instance created. // set mCurrentLoad to the DocumentLoadListener instance created.
// Ideally in the future we will only start loads from here, and we can // 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 // We currently only support starting loads directly from the
// CanonicalBrowsingContext for top-level BCs. // CanonicalBrowsingContext for top-level BCs.
if (!IsTopContent() || !GetContentParent() || if (!IsTopContent() || !GetContentParent() ||
(StaticPrefs::browser_tabs_documentchannel_parent_controlled() && StaticPrefs::browser_tabs_documentchannel_parent_controlled()) {
mozilla::SessionHistoryInParent())) {
return false; return false;
} }
@@ -2087,14 +2074,8 @@ bool CanonicalBrowsingContext::StartDocumentLoad(
// If we're controlling loads from the parent, then starting a new load means // If we're controlling loads from the parent, then starting a new load means
// that we need to cancel any existing ones. // that we need to cancel any existing ones.
if (StaticPrefs::browser_tabs_documentchannel_parent_controlled() && if (StaticPrefs::browser_tabs_documentchannel_parent_controlled() &&
mozilla::SessionHistoryInParent() && mCurrentLoad) { mCurrentLoad) {
// Make sure we are not loading a javascript URI. mCurrentLoad->Cancel(NS_BINDING_ABORTED);
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 = aLoad; mCurrentLoad = aLoad;

View File

@@ -142,8 +142,6 @@ add_task(async function test_navigation() {
// Navigate from remote to non-remote // Navigate from remote to non-remote
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, TEST_PAGE); 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"; testURI = "about:mozilla";
permanentKey = gBrowser.selectedBrowser.permanentKey; permanentKey = gBrowser.selectedBrowser.permanentKey;
await waitForLoad(testURI); await waitForLoad(testURI);

View File

@@ -250,6 +250,3 @@ XPC_MSG_DEF(NS_ERROR_SOCIALTRACKING_URI , "The URI is social track
/* Profile manager error codes */ /* Profile manager error codes */
XPC_MSG_DEF(NS_ERROR_DATABASE_CHANGED , "Flushing the profiles to disk would have overwritten changes made elsewhere.") 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")

View File

@@ -1335,7 +1335,7 @@
# from parent-process BrowsingContexts # from parent-process BrowsingContexts
- name: browser.tabs.documentchannel.parent-controlled - name: browser.tabs.documentchannel.parent-controlled
type: bool type: bool
value: true value: false
mirror: always mirror: always
# Testing-only pref which makes data: URIs be loaded in a "web" content process # Testing-only pref which makes data: URIs be loaded in a "web" content process

View File

@@ -113,8 +113,6 @@ DocumentChannelChild::AsyncOpen(nsIStreamListener* aListener) {
args.cacheKey() = mCacheKey; args.cacheKey() = mCacheKey;
args.channelId() = mChannelId; args.channelId() = mChannelId;
args.asyncOpenTime() = TimeStamp::Now(); args.asyncOpenTime() = TimeStamp::Now();
args.parentInitiatedNavigationEpoch() =
loadingContext->GetParentInitiatedNavigationEpoch();
Maybe<IPCClientInfo> ipcClientInfo; Maybe<IPCClientInfo> ipcClientInfo;
if (mInitialClientInfo.isSome()) { if (mInitialClientInfo.isSome()) {

View File

@@ -35,11 +35,6 @@ bool DocumentChannelParent::Init(dom::CanonicalBrowsingContext* aContext,
new nsDocShellLoadState(aArgs.loadState()); new nsDocShellLoadState(aArgs.loadState());
LOG(("DocumentChannelParent Init [this=%p, uri=%s]", this, LOG(("DocumentChannelParent Init [this=%p, uri=%s]", this,
loadState->URI()->GetSpecOrDefault().get())); loadState->URI()->GetSpecOrDefault().get()));
if (aArgs.parentInitiatedNavigationEpoch() <
aContext->GetParentInitiatedNavigationEpoch()) {
nsresult rv = NS_BINDING_ABORTED;
return SendFailedAsyncOpen(rv);
}
ContentParent* contentParent = ContentParent* contentParent =
static_cast<ContentParent*>(Manager()->Manager()); static_cast<ContentParent*>(Manager()->Manager());

View File

@@ -532,9 +532,6 @@ auto DocumentLoadListener::Open(nsDocShellLoadState* aLoadState,
loadingContext->GetOriginAttributes(attrs); loadingContext->GetOriginAttributes(attrs);
mLoadIdentifier = aLoadState->GetLoadIdentifier(); 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 // Check for infinite recursive object or iframe loads
if (aLoadState->OriginalFrameSrc() || !mIsDocumentLoad) { if (aLoadState->OriginalFrameSrc() || !mIsDocumentLoad) {
@@ -762,22 +759,6 @@ auto DocumentLoadListener::Open(nsDocShellLoadState* aLoadState,
"mismatched parent window context?"); "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; *aRv = NS_OK;
mOpenPromise = new OpenPromise::Private(__func__); mOpenPromise = new OpenPromise::Private(__func__);
// We make the promise use direct task dispatch in order to reduce the number // 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); 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 // Notify the docshell that it should load using the newly connected
// channel // channel
browserParent->ResumeLoad(mLoadIdentifier); browserParent->ResumeLoad(mLoadIdentifier);

View File

@@ -282,8 +282,6 @@ class DocumentLoadListener : public nsIInterfaceRequestor,
uint64_t GetLoadIdentifier() const { return mLoadIdentifier; } uint64_t GetLoadIdentifier() const { return mLoadIdentifier; }
uint32_t GetLoadType() const { return mLoadStateLoadType; } uint32_t GetLoadType() const { return mLoadStateLoadType; }
bool IsDownload() const { return mIsDownload; }
bool IsLoadingJSURI() const { return mIsLoadingJSURI; }
mozilla::dom::LoadingSessionHistoryInfo* GetLoadingSessionHistoryInfo() { mozilla::dom::LoadingSessionHistoryInfo* GetLoadingSessionHistoryInfo() {
return mLoadingSessionHistoryInfo.get(); return mLoadingSessionHistoryInfo.get();
@@ -540,12 +538,6 @@ class DocumentLoadListener : public nsIInterfaceRequestor,
uint32_t mLoadStateInternalLoadFlags = 0; uint32_t mLoadStateInternalLoadFlags = 0;
uint32_t mLoadStateLoadType = 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 // Corresponding redirect channel registrar Id for the final channel that
// we want to use when redirecting the child, or doing a process switch. // we want to use when redirecting the child, or doing a process switch.
// 0 means redirection is not started. // 0 means redirection is not started.
@@ -576,7 +568,6 @@ class DocumentLoadListener : public nsIInterfaceRequestor,
Maybe<nsCString> mOriginalUriString; Maybe<nsCString> mOriginalUriString;
// Parent-initiated loads do not support redirects to real channels.
bool mSupportsRedirectToRealChannel = true; bool mSupportsRedirectToRealChannel = true;
Maybe<nsCString> mRemoteTypeOverride; Maybe<nsCString> mRemoteTypeOverride;

View File

@@ -440,7 +440,6 @@ struct DocumentChannelCreationArgs {
nsDOMNavigationTiming? timing; nsDOMNavigationTiming? timing;
IPCClientInfo? initialClientInfo; IPCClientInfo? initialClientInfo;
DocumentChannelElementCreationArgs elementCreationArgs; DocumentChannelElementCreationArgs elementCreationArgs;
uint64_t parentInitiatedNavigationEpoch;
}; };
struct RedirectToRealChannelArgs { struct RedirectToRealChannelArgs {

View File

@@ -476,9 +476,7 @@ add_task(async function test_contentscripts_register_js() {
let completePromise = new Promise(resolve => { let completePromise = new Promise(resolve => {
extension.onMessage("script-run-complete", () => { extension.onMessage("script-run-complete", () => {
completeCount++; completeCount++;
if (completeCount == 2) {
resolve(); resolve();
}
}); });
}); });

View File

@@ -147,12 +147,10 @@ add_task(async function test_check_open_with_internal_handler() {
await publicList.removeFinished(); await publicList.removeFinished();
}); });
let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + file, TEST_PATH + file
waitForLoad: false, );
waitForStateStop: true,
});
// Add an extra tab after the loading tab so we can test that // 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 // pdf.js is opened in the adjacent tab and not at the end of
// the tab strip. // the tab strip.
@@ -344,12 +342,10 @@ add_task(async function test_check_open_with_external_application() {
await publicList.removeFinished(); await publicList.removeFinished();
}); });
let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + file, TEST_PATH + file
waitForLoad: false, );
waitForStateStop: true,
});
let dialogWindow = await dialogWindowPromise; let dialogWindow = await dialogWindowPromise;
is( is(
dialogWindow.location.href, dialogWindow.location.href,
@@ -448,12 +444,10 @@ add_task(async function test_check_open_with_external_then_internal() {
let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
// Open a new tab to the PDF file which will trigger the Unknown Content Type dialog // 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. // and choose to open the PDF with an external application.
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + file, TEST_PATH + file
waitForLoad: false, );
waitForStateStop: true,
});
let dialogWindow = await dialogWindowPromise; let dialogWindow = await dialogWindowPromise;
is( is(
dialogWindow.location.href, 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 // and choose to open the PDF internally. The previously used external application should be shown as
// the external option. // the external option.
dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
loadingTab = await BrowserTestUtils.openNewForegroundTab({ loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + file, TEST_PATH + file
waitForLoad: false, );
waitForStateStop: true,
});
dialogWindow = await dialogWindowPromise; dialogWindow = await dialogWindowPromise;
is( is(
dialogWindow.location.href, dialogWindow.location.href,
@@ -592,12 +584,10 @@ add_task(
["file_xml_attachment_test.xml", true], ["file_xml_attachment_test.xml", true],
]) { ]) {
let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + file, TEST_PATH + file
waitForLoad: false, );
waitForStateStop: true,
});
let dialogWindow = await dialogWindowPromise; let dialogWindow = await dialogWindowPromise;
is( is(
dialogWindow.location.href, dialogWindow.location.href,
@@ -645,12 +635,10 @@ add_task(async function test_internal_handler_hidden_with_other_type() {
}); });
let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + "file_txt_attachment_test.txt", TEST_PATH + "file_txt_attachment_test.txt"
waitForLoad: false, );
waitForStateStop: true,
});
let dialogWindow = await dialogWindowPromise; let dialogWindow = await dialogWindowPromise;
is( is(
dialogWindow.location.href, 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", "file_pdf_binary_octet_stream.pdf",
]) { ]) {
let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + file, TEST_PATH + file
waitForLoad: false, );
waitForStateStop: true,
});
let dialogWindow = await dialogWindowPromise; let dialogWindow = await dialogWindowPromise;
is( is(
dialogWindow.location.href, dialogWindow.location.href,
@@ -745,12 +731,10 @@ add_task(
set: [["browser.helperApps.showOpenOptionForViewableInternally", false]], set: [["browser.helperApps.showOpenOptionForViewableInternally", false]],
}); });
let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + "file_xml_attachment_test.xml", TEST_PATH + "file_xml_attachment_test.xml"
waitForLoad: false, );
waitForStateStop: true,
});
let dialogWindow = await dialogWindowPromise; let dialogWindow = await dialogWindowPromise;
is( is(
dialogWindow.location.href, dialogWindow.location.href,

View File

@@ -24,12 +24,10 @@ add_task(async function skipDialogAndDownloadFile() {
let initialTabsCount = gBrowser.tabs.length; let initialTabsCount = gBrowser.tabs.length;
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + "file_image_svgxml.svg", TEST_PATH + "file_image_svgxml.svg"
waitForLoad: false, );
waitForStateStop: true,
});
// We just open the file to be downloaded... and wait for it to be downloaded! // 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. // We see no dialogs to be accepted in the process.

View File

@@ -88,7 +88,7 @@ add_task(async function check_download_spam_permissions() {
}); });
let download = await downloadFinishedPromise; let download = await downloadFinishedPromise;
await TestUtils.waitForCondition( TestUtils.waitForCondition(
() => gBrowser.tabs.length == INITIAL_TABS_COUNT + 1 () => gBrowser.tabs.length == INITIAL_TABS_COUNT + 1
); );
is( is(
@@ -109,8 +109,7 @@ add_task(async function check_download_spam_permissions() {
"An other file should be blocked" "An other file should be blocked"
); );
info("Will wait for blockedDownloadsCount to be >= 99"); TestUtils.waitForCondition(() => blockedDownloadsCount >= 99);
await TestUtils.waitForCondition(() => blockedDownloadsCount >= 99);
is(blockedDownloadsCount, 99, "Browser should block 99 downloads"); is(blockedDownloadsCount, 99, "Browser should block 99 downloads");
is( is(
blockedDownloadsURI, blockedDownloadsURI,

View File

@@ -167,12 +167,10 @@ add_task(async function test_broken_saved_handlerinfo_and_useless_mimetypes() {
handlerSvc.store(bogusType); handlerSvc.store(bogusType);
let tabToClean = null; let tabToClean = null;
let task = function() { let task = function() {
return BrowserTestUtils.openNewForegroundTab({ return BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + "file_as.exe?foo=bar", TEST_PATH + "file_as.exe?foo=bar"
waitForLoad: false, ).then(tab => {
waitForStateStop: true,
}).then(tab => {
return (tabToClean = tab); return (tabToClean = tab);
}); });
}; };

View File

@@ -33,12 +33,10 @@ async function aDownloadLaunchedWithAppIsSavedInFolder(downloadDir) {
let downloadFinishedPromise = promiseDownloadFinished(publicList); let downloadFinishedPromise = promiseDownloadFinished(publicList);
let initialTabsCount = gBrowser.tabs.length; let initialTabsCount = gBrowser.tabs.length;
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + "file_image_svgxml.svg", TEST_PATH + "file_image_svgxml.svg"
waitForLoad: false, );
waitForStateStop: true,
});
let download = await downloadFinishedPromise; let download = await downloadFinishedPromise;
await BrowserTestUtils.waitForCondition( await BrowserTestUtils.waitForCondition(

View File

@@ -172,12 +172,10 @@ add_task(async function test_check_saving_handler_choices() {
ensureMIMEState(testCase.preDialogState); ensureMIMEState(testCase.preDialogState);
let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + file, TEST_PATH + file
waitForLoad: false, );
waitForStateStop: true,
});
let dialogWindow = await dialogWindowPromise; let dialogWindow = await dialogWindowPromise;
is( is(
dialogWindow.location.href, dialogWindow.location.href,
@@ -389,12 +387,10 @@ add_task(
info("Load window and tabs"); info("Load window and tabs");
let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); let dialogWindowPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + file, TEST_PATH + file
waitForLoad: false, );
waitForStateStop: true,
});
// See if UCT window appears in loaded tab. // See if UCT window appears in loaded tab.
let dialogWindow = await Promise.race([ let dialogWindow = await Promise.race([

View File

@@ -51,12 +51,10 @@ add_task(async function aDownloadLaunchedWithAppPromptsForFolder() {
}; };
}); });
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + "file_txt_attachment_test.txt", TEST_PATH + "file_txt_attachment_test.txt"
waitForLoad: false, );
waitForStateStop: true,
});
await filePickerShown; await filePickerShown;
@@ -70,12 +68,10 @@ add_task(async function testFilesHandledInternally() {
ensureMIMEState({ preferredAction: handleInternally }); ensureMIMEState({ preferredAction: handleInternally });
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + "file_image_svgxml.svg", TEST_PATH + "file_image_svgxml.svg"
waitForLoad: false, );
waitForStateStop: true,
});
await TestUtils.waitForCondition(() => { await TestUtils.waitForCondition(() => {
return ( return (
@@ -110,12 +106,10 @@ add_task(async function testFilesHandledBySystemDefaultApp() {
}; };
}); });
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + "file_pdf_application_pdf.pdf", TEST_PATH + "file_pdf_application_pdf.pdf"
waitForLoad: false, );
waitForStateStop: true,
});
await launchFileCalled; await launchFileCalled;
@@ -176,12 +170,10 @@ add_task(async function testFilesHandledByHelperApp() {
}; };
}); });
let loadingTab = await BrowserTestUtils.openNewForegroundTab({ let loadingTab = await BrowserTestUtils.openNewForegroundTab(
gBrowser, gBrowser,
opening: TEST_PATH + "file_pdf_application_pdf.pdf", TEST_PATH + "file_pdf_application_pdf.pdf"
waitForLoad: false, );
waitForStateStop: true,
});
await downloadFinishedPromise; await downloadFinishedPromise;
await launchFileCalled; await launchFileCalled;

View File

@@ -939,11 +939,6 @@ with modules["URILOADER"]:
# successfully setup. # successfully setup.
errors["NS_REFRESHURI_HEADER_FOUND"] = SUCCESS(2) 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 # 25: NS_ERROR_MODULE_CONTENT