Commit 4c87b2e4 authored by Narcis Beleuzu's avatar Narcis Beleuzu
Browse files

Backed out 12 changesets (bug 1721217) for bc failures on browser_TopLevelNavigationDelegate.js

Backed out changeset 5fe3c617d521 (bug 1721217)
Backed out changeset c131e4a6d9d5 (bug 1721217)
Backed out changeset a59210a5b400 (bug 1721217)
Backed out changeset 74362b0c39c0 (bug 1721217)
Backed out changeset c8075b91d660 (bug 1721217)
Backed out changeset 46512deaf0e5 (bug 1721217)
Backed out changeset b38bc569d227 (bug 1721217)
Backed out changeset ee9bd012fda8 (bug 1721217)
Backed out changeset 7aa2726a0982 (bug 1721217)
Backed out changeset 885ced5f4bb4 (bug 1721217)
Backed out changeset 7d3f99ca3f44 (bug 1721217)
Backed out changeset 2f5a0164679a (bug 1721217)
parent 6b76c9ed
Loading
Loading
Loading
Loading
+2 −17
Original line number Diff line number Diff line
@@ -6543,24 +6543,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) {
+0 −4
Original line number Diff line number Diff line
@@ -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(
+58 −74
Original line number Diff line number Diff line
@@ -63,14 +63,7 @@ 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() {
  await BrowserTestUtils.withNewTab(TEST_ROOT + "foo.txt", async function() {
    if (
      !Services.prefs.getBoolPref(
        "browser.download.improvements_to_download_panel"
@@ -98,8 +91,7 @@ add_task(async function test_overwrite_does_not_delete_first() {
    // like this.
    mockTransferRegisterer.unregister();
    unregisteredTransfer = true;
    }
  );
  });
});

// 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:
  await BrowserTestUtils.withNewTab(
    {
      gBrowser,
      opening: TEST_ROOT + "foo.txt",
      waitForLoad: false,
      waitForStateStop: true,
    },
    async function() {
  await BrowserTestUtils.withNewTab(TEST_ROOT + "foo.txt", async function() {
    if (
      !Services.prefs.getBoolPref(
        "browser.download.improvements_to_download_panel"
@@ -159,6 +144,5 @@ add_task(async function test_overwrite_works() {
    );
    info("Got: " + contents);
    ok(contents.startsWith("Dummy"), "The file was overwritten.");
    }
  );
  });
});
+0 −1
Original line number Diff line number Diff line
@@ -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]
+0 −110
Original line number Diff line number Diff line
/* -*- 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);
  });
});
Loading