Backed out changeset 5e7653247208 (bug 1676956) for causing failures on test_ext_webRequest_startup.js.
authorButkovits Atila <abutkovits@mozilla.com>
Thu, 17 Dec 2020 19:07:43 +0200
changeset 561155 24bbee27225215f88023d917d0c502a2c3b4f969
parent 561154 9db38d8a088ceed2559a0f45b733e97b075a787e
child 561156 85c071060feea5e8e87d589ca553aa6c7c7d2ae4
push id133045
push userabutkovits@mozilla.com
push dateThu, 17 Dec 2020 17:27:27 +0000
treeherderautoland@a70c8a3cd9ae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1676956
milestone86.0a1
backs out5e7653247208f42860d6c52b8b8a43ed25ba9dfd
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 5e7653247208 (bug 1676956) for causing failures on test_ext_webRequest_startup.js.
toolkit/components/extensions/test/xpcshell/test_ext_webRequest_startup.js
toolkit/components/extensions/test/xpcshell/test_ext_webRequest_startup_StreamFilter.js
toolkit/components/extensions/test/xpcshell/xpcshell-common-e10s.ini
toolkit/components/extensions/test/xpcshell/xpcshell-common.ini
toolkit/components/extensions/test/xpcshell/xpcshell-e10s.ini
toolkit/components/extensions/test/xpcshell/xpcshell-remote.ini
toolkit/components/extensions/test/xpcshell/xpcshell.ini
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_startup.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_startup.js
@@ -167,16 +167,76 @@ add_task(async function test_2() {
 
   Services.obs.notifyObservers(null, "sessionstore-windows-restored");
   await extension.awaitMessage("ready");
 
   await extension.unload();
   await promiseShutdownManager();
 });
 
+// Test that a blocking listener that uses filterResponseData() works
+// properly (i.e., that the delayed call to registerTraceableChannel
+// works properly).
+add_task(async function test_3() {
+  const DATA = `<!DOCTYPE html>
+<html>
+<body>
+  <h1>This is a modified page</h1>
+</body>
+</html>`;
+
+  function background(data) {
+    browser.webRequest.onBeforeRequest.addListener(
+      details => {
+        let filter = browser.webRequest.filterResponseData(details.requestId);
+        filter.onstop = () => {
+          let encoded = new TextEncoder("utf-8").encode(data);
+          filter.write(encoded);
+          filter.close();
+        };
+      },
+      { urls: ["http://example.com/data/file_sample.html"] },
+      ["blocking"]
+    );
+  }
+
+  await promiseStartupManager();
+
+  let extension = ExtensionTestUtils.loadExtension({
+    useAddonManager: "permanent",
+    manifest: {
+      permissions: ["webRequest", "webRequestBlocking", "http://example.com/"],
+    },
+
+    background: `(${background})(${uneval(DATA)})`,
+  });
+
+  await extension.startup();
+
+  await promiseRestartManager();
+  await extension.awaitStartup();
+
+  let dataPromise = ExtensionTestUtils.fetch(
+    "http://example.com/",
+    "http://example.com/data/file_sample.html"
+  );
+
+  Services.obs.notifyObservers(null, "browser-delayed-startup-finished");
+  let data = await dataPromise;
+
+  equal(
+    data,
+    DATA,
+    "Stream filter was properly installed for a load during startup"
+  );
+
+  await extension.unload();
+  await promiseShutdownManager();
+});
+
 // Tests that moving permission to optional retains permission and that the
 // persistent listeners are used as expected.
 add_task(async function test_persistent_listener_after_sideload_upgrade() {
   let id = "permission-sideload-upgrade@test";
   let extensionData = {
     useAddonManager: "permanent",
     manifest: {
       version: "1.0",
deleted file mode 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_startup_StreamFilter.js
+++ /dev/null
@@ -1,84 +0,0 @@
-"use strict";
-
-AddonTestUtils.init(this);
-AddonTestUtils.overrideCertDB();
-AddonTestUtils.createAppInfo(
-  "xpcshell@tests.mozilla.org",
-  "XPCShell",
-  "1",
-  "43"
-);
-
-let {
-  promiseRestartManager,
-  promiseShutdownManager,
-  promiseStartupManager,
-} = AddonTestUtils;
-
-const server = createHttpServer({ hosts: ["example.com"] });
-server.registerDirectory("/data/", do_get_file("data"));
-
-Services.prefs.setBoolPref(
-  "extensions.webextensions.background-delayed-startup",
-  true
-);
-
-// Test that a blocking listener that uses filterResponseData() works
-// properly (i.e., that the delayed call to registerTraceableChannel
-// works properly).
-add_task(async function test_StreamFilter_at_restart() {
-  const DATA = `<!DOCTYPE html>
-<html>
-<body>
-  <h1>This is a modified page</h1>
-</body>
-</html>`;
-
-  function background(data) {
-    browser.webRequest.onBeforeRequest.addListener(
-      details => {
-        let filter = browser.webRequest.filterResponseData(details.requestId);
-        filter.onstop = () => {
-          let encoded = new TextEncoder("utf-8").encode(data);
-          filter.write(encoded);
-          filter.close();
-        };
-      },
-      { urls: ["http://example.com/data/file_sample.html"] },
-      ["blocking"]
-    );
-  }
-
-  await promiseStartupManager();
-
-  let extension = ExtensionTestUtils.loadExtension({
-    useAddonManager: "permanent",
-    manifest: {
-      permissions: ["webRequest", "webRequestBlocking", "http://example.com/"],
-    },
-
-    background: `(${background})(${uneval(DATA)})`,
-  });
-
-  await extension.startup();
-
-  await promiseRestartManager();
-  await extension.awaitStartup();
-
-  let dataPromise = ExtensionTestUtils.fetch(
-    "http://example.com/",
-    "http://example.com/data/file_sample.html"
-  );
-
-  Services.obs.notifyObservers(null, "browser-delayed-startup-finished");
-  let data = await dataPromise;
-
-  equal(
-    data,
-    DATA,
-    "Stream filter was properly installed for a load during startup"
-  );
-
-  await extension.unload();
-  await promiseShutdownManager();
-});
deleted file mode 100644
--- a/toolkit/components/extensions/test/xpcshell/xpcshell-common-e10s.ini
+++ /dev/null
@@ -1,10 +0,0 @@
-# Similar to xpcshell-common.ini, except tests here only run
-# when e10s is enabled (with or without out-of-process extensions).
-
-[test_ext_webRequest_filterResponseData.js]
-# tsan failure is for test_filter_301 timing out, bug 1674773
-skip-if = tsan || os == "android" && debug
-[test_ext_webRequest_responseBody.js]
-skip-if = os == "android" && debug
-[test_ext_webRequest_startup_StreamFilter.js]
-skip-if = os == "android" && debug
--- a/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini
@@ -215,18 +215,16 @@ skip-if = os == "android" && debug
 [test_ext_webRequest_permission.js]
 skip-if = os == "android" && debug
 [test_ext_webRequest_redirect_mozextension.js]
 skip-if = os == "android" # Android: Bug 1680132
 [test_ext_webRequest_requestSize.js]
 skip-if = socketprocess_networking
 [test_ext_webRequest_set_cookie.js]
 skip-if = appname == "thunderbird"
-[test_ext_webRequest_startup.js]
-skip-if = os == "android" && debug
 [test_ext_webRequest_style_cache.js]
 skip-if = os == "android" # Android: Bug 1680132
 [test_ext_webRequest_suspend.js]
 [test_ext_webRequest_userContextId.js]
 [test_ext_webRequest_viewsource.js]
 [test_ext_webRequest_webSocket.js]
 skip-if = appname == "thunderbird"
 [test_ext_xhr_capabilities.js]
--- a/toolkit/components/extensions/test/xpcshell/xpcshell-e10s.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell-e10s.ini
@@ -13,16 +13,20 @@ tags = webextensions webextensions-e10s
 # Make sure that loading the default settings for url-classifier-skip-urls
 # doesn't interfere with running our tests while IDB operations are in
 # flight by overriding the default remote settings bucket pref name to
 # ensure that the IDB database isn't created in the first place.
 prefs =
   services.settings.server=http://localhost:7777/remote-settings-dummy/v1
   services.settings.default_bucket=nonexistent-bucket-foo
 
-[include:xpcshell-common-e10s.ini]
 [include:xpcshell-content.ini]
 
-# Tests that need to run with e10s only must NOT be placed here,
-# but in xpcshell-common-e10s.ini.
-# A test here will only run on one configuration, e10s + in-process extensions,
-# while the primary target is e10s + out-of-process extensions.
-# xpcshell-common-e10s.ini runs in both configurations.
+[test_ext_webRequest_filterResponseData.js]
+# tsan failure is for test_filter_301 timing out, bug 1674773
+skip-if = tsan || os == "android" && debug
+# streamFilter is supported with e10s only
+[test_ext_webRequest_responseBody.js]
+skip-if = os == "android" && debug
+# streamFilter is supported with e10s only
+[test_ext_webRequest_startup.js]
+skip-if = os == "android" && debug
+# streamFilter is supported with e10s only
\ No newline at end of file
--- a/toolkit/components/extensions/test/xpcshell/xpcshell-remote.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell-remote.ini
@@ -14,17 +14,16 @@ tags = webextensions remote-webextension
 # doesn't interfere with running our tests while IDB operations are in
 # flight by overriding the default remote settings bucket pref name to
 # ensure that the IDB database isn't created in the first place.
 prefs =
   services.settings.server=http://localhost:7777/remote-settings-dummy/v1
   services.settings.default_bucket=nonexistent-bucket-foo
 
 [include:xpcshell-common.ini]
-[include:xpcshell-common-e10s.ini]
 [include:xpcshell-content.ini]
 
 [test_ext_contentscript_perf_observers.js] # Inexplicably, PerformanceObserver used in the test doesn't fire in non-e10s mode.
 skip-if = tsan
 [test_ext_contentscript_xorigin_frame.js]
 [test_WebExtensionContentScript.js]
 [test_ext_ipcBlob.js]
 skip-if = os == 'android' && processor == 'x86_64'
--- a/toolkit/components/extensions/test/xpcshell/xpcshell.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell.ini
@@ -20,24 +20,22 @@ prefs =
 # configuration, or do not support out-of-process content or extensions
 # for one reason or another.
 #
 # Tests which are affected by remote content or remote extensions should
 # go in one of:
 #
 #  - xpcshell-common.ini
 #    For tests which should run in all configurations.
-#  - xpcshell-common-e10s.ini
-#    For tests which should run in all configurations where e10s is enabled.
 #  - xpcshell-remote.ini
 #    For tests which should only run with both remote extensions and remote content.
 #  - xpcshell-content.ini
 #    For tests which rely on content pages, and should run in all configurations.
 #  - xpcshell-e10s.ini
-#    For tests which rely on content pages, and should only run with remote content
+#    For tests which rely on conetn pages, and should only run with remote content
 #    but in-process extensions.
 
 [test_ExtensionStorageSync_migration_kinto.js]
 skip-if = os == 'android' # Not shipped on Android
 [test_MatchPattern.js]
 [test_StorageSyncService.js]
 skip-if = os == 'android' && processor == 'x86_64'
 [test_WebExtensionPolicy.js]