Backed out 2 changesets (bug 1594786) for perma fails on test_ext_all_apis.html. CLOSED TREE
authorRazvan Maries <rmaries@mozilla.com>
Fri, 22 Nov 2019 15:09:00 +0200
changeset 503350 b2cc8d30ec219c323cbf979efb713592fcde059f
parent 503349 317361f21066c40e887df888be57e9ee0c171f15
child 503351 283b309498e08fb3e62dac82694a9c70dbbda83c
push id36833
push userbtara@mozilla.com
push dateFri, 22 Nov 2019 21:40:53 +0000
treeherdermozilla-central@2c912e46295e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1594786
milestone72.0a1
backs out6f9f1ab3675637dc26e84197b2c43938566eeca9
da5d5f59a7da9645dc99a684a4f4564c46dda24f
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 2 changesets (bug 1594786) for perma fails on test_ext_all_apis.html. CLOSED TREE Backed out changeset 6f9f1ab36756 (bug 1594786) Backed out changeset da5d5f59a7da (bug 1594786)
browser/components/urlbar/tests/ext/api.js
browser/components/urlbar/tests/ext/browser/browser.ini
browser/components/urlbar/tests/ext/browser/browser_ext_urlbar_openClearHistoryDialog.js
browser/components/urlbar/tests/ext/schema.json
toolkit/components/extensions/child/ext-test.js
toolkit/components/extensions/schemas/test.json
--- a/browser/components/urlbar/tests/ext/api.js
+++ b/browser/components/urlbar/tests/ext/api.js
@@ -8,18 +8,16 @@ const { XPCOMUtils } = ChromeUtils.impor
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   AppMenuNotifications: "resource://gre/modules/AppMenuNotifications.jsm",
   BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
   Preferences: "resource://gre/modules/Preferences.jsm",
   ProfileAge: "resource://gre/modules/ProfileAge.jsm",
   Services: "resource://gre/modules/Services.jsm",
   ResetProfile: "resource://gre/modules/ResetProfile.jsm",
-  PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
-  Sanitizer: "resource:///modules/Sanitizer.jsm",
 });
 
 XPCOMUtils.defineLazyServiceGetter(
   this,
   "updateService",
   "@mozilla.org/updates/update-service;1",
   "nsIApplicationUpdateService"
 );
@@ -135,26 +133,16 @@ this.experiments_urlbar = class extends 
             let age = await ProfileAge();
             return (await age.firstUse) || age.created;
           },
 
           openViewOnFocus: this._getDefaultSettingsAPI(
             "browser.urlbar.openViewOnFocus"
           ),
 
-          openClearHistoryDialog() {
-            let window = BrowserWindowTracker.getTopWindow();
-            // The behaviour of the Clear Recent History dialog in PBM does
-            // not have the expected effect (bug 463607).
-            if (PrivateBrowsingUtils.isWindowPrivate(window)) {
-              return;
-            }
-            Sanitizer.showUI(window);
-          },
-
           restartBrowser() {
             // Notify all windows that an application quit has been requested.
             let cancelQuit = Cc[
               "@mozilla.org/supports-PRBool;1"
             ].createInstance(Ci.nsISupportsPRBool);
             Services.obs.notifyObservers(
               cancelQuit,
               "quit-application-requested",
--- a/browser/components/urlbar/tests/ext/browser/browser.ini
+++ b/browser/components/urlbar/tests/ext/browser/browser.ini
@@ -8,11 +8,10 @@ support-files =
   ../api.js
   ../schema.json
   head.js
 
 [browser_ext_urlbar_engagementTelemetry.js]
 [browser_ext_urlbar_isBrowserShowingNotification.js]
 [browser_ext_urlbar_isBrowserUpdateReadyToInstall.js]
 [browser_ext_urlbar_lastBrowserUpdateDate.js]
-[browser_ext_urlbar_openClearHistoryDialog.js]
 [browser_ext_urlbar_openViewOnFocus.js]
 [browser_ext_urlbar_resetBrowser.js]
deleted file mode 100644
--- a/browser/components/urlbar/tests/ext/browser/browser_ext_urlbar_openClearHistoryDialog.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/* global browser */
-
-// This tests the browser.experiments.urlbar.openClearHistoryDialog
-// WebExtension Experiment API.
-
-"use strict";
-
-add_task(async function normalMode() {
-  await checkExtension();
-});
-
-add_task(async function privateBrowsingMode() {
-  const privateWindow = await BrowserTestUtils.openNewBrowserWindow({
-    private: true,
-  });
-  await checkExtension(/* isPrivate */ true);
-  await BrowserTestUtils.closeWindow(privateWindow);
-});
-
-async function checkExtension(isPrivate = false) {
-  let ext = await loadExtension(async () => {
-    browser.test.onMessage.addListener(async () => {
-      // Testing without user input. We expect the call to fail.
-      await browser.test.assertRejects(
-        browser.experiments.urlbar.openClearHistoryDialog(),
-        "experiments.urlbar.openClearHistoryDialog may only be called from a user input handler",
-        "browser.experiments.urlbar.openClearHistoryDialog should fail when called from outside a user input handler."
-      );
-      // Testing with user input.
-      browser.test.withHandlingUserInput(() => {
-        browser.experiments.urlbar.openClearHistoryDialog();
-      });
-    });
-  });
-
-  let dialogPromise = new Promise((resolve, reject) => {
-    function onOpen(subj, topic, data) {
-      if (topic == "domwindowopened" && subj instanceof Ci.nsIDOMWindow) {
-        subj.addEventListener(
-          "load",
-          function() {
-            if (
-              subj.document.documentURI ==
-              "chrome://browser/content/sanitize.xul"
-            ) {
-              Services.ww.unregisterNotification(onOpen);
-              Assert.ok(true, "Observed Clear Recent History window open");
-              // On macOS the Clear Recent History dialog gets opened as an
-              // app-modal window, so its opener is null.
-              is(
-                subj.opener,
-                AppConstants.platform == "macosx" ? null : window,
-                "openClearHistoryDialog opened a sanitizer window."
-              );
-              subj.close();
-              resolve();
-            }
-          },
-          { once: true }
-        );
-      }
-    }
-    Services.ww.registerNotification(onOpen);
-    if (isPrivate) {
-      // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
-      setTimeout(() => {
-        Services.ww.unregisterNotification(onOpen);
-        reject("No window opened.");
-      }, 500);
-    }
-  });
-
-  ext.sendMessage("begin-test");
-
-  if (isPrivate) {
-    await dialogPromise.catch(() => {
-      Assert.ok(true, "Promise should have timed out in PBM.");
-    });
-  } else {
-    await dialogPromise;
-    Assert.ok(true, "Clear history browser dialog was shown.");
-  }
-
-  await ext.unload();
-}
--- a/browser/components/urlbar/tests/ext/schema.json
+++ b/browser/components/urlbar/tests/ext/schema.json
@@ -30,24 +30,16 @@
       {
         "name": "lastBrowserUpdateDate",
         "type": "function",
         "async": true,
         "description": "Returns the date of the last browser update. If there's no update history, then the date the profile was first used is returned instead. The return value is milliseconds since 1 January 1970 UTC (i.e., suitable for passing to <code>new Date()</code>).",
         "parameters": []
       },
       {
-        "name": "openClearHistoryDialog",
-        "type": "function",
-        "async": true,
-        "description": "Shows the 'Clear Recent History' dialog unless the user is in Private Browsing Mode.",
-        "parameters": [],
-        "requireUserInput": true
-      },
-      {
         "name": "restartBrowser",
         "type": "function",
         "async": true,
         "description": "Restarts the application.",
         "requireUserInput": true,
         "parameters": []
       },
       {
--- a/toolkit/components/extensions/child/ext-test.js
+++ b/toolkit/components/extensions/child/ext-test.js
@@ -106,23 +106,16 @@ this.test = class extends ExtensionAPI {
             assertTrue(false, `${e}\n${e.stack}`);
           }
         }, ...args);
       }
     }
 
     return {
       test: {
-        withHandlingUserInput(callback) {
-          ExtensionCommon.withHandlingUserInput(
-            context.contentWindow,
-            callback
-          );
-        },
-
         sendMessage(...args) {
           extension.emit("test-message", ...args);
         },
 
         notifyPass(msg) {
           extension.emit("test-done", true, msg, getStack());
         },
 
--- a/toolkit/components/extensions/schemas/test.json
+++ b/toolkit/components/extensions/schemas/test.json
@@ -5,24 +5,16 @@
 [
   {
     "namespace": "test",
     "allowedContexts": ["content", "devtools"],
     "defaultContexts": ["content", "devtools"],
     "description": "none",
     "functions": [
       {
-        "name": "withHandlingUserInput",
-        "type": "function",
-        "description": "Calls the callback function wrapped with user input set.  This is only used for internal unit testing.",
-        "parameters": [
-          {"type": "function", "name": "callback"}
-        ]
-      },
-      {
         "name": "notifyFail",
         "type": "function",
         "description": "Notifies the browser process that test code running in the extension failed.  This is only used for internal unit testing.",
         "parameters": [
           {"type": "string", "name": "message"}
         ]
       },
       {