Bug 1578584 - Follow-up test fix: Quantumbar WebExt API: Add onResultPicked event.
☠☠ backed out by d4935c57c337 ☠ ☠
authorDrew Willcoxon <adw@mozilla.com>
Thu, 26 Sep 2019 02:47:29 +0000
changeset 495034 4730635520c69050e623c240989454107ad069f5
parent 495033 7758d58238863e28823f5ba51aaf9dca0f12df8f
child 495035 e5af40c83e2f41975a17f4fb12a69e71379bfb1f
push id114131
push userdluca@mozilla.com
push dateThu, 26 Sep 2019 09:47:34 +0000
treeherdermozilla-inbound@1dc1a755079a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1578584
milestone71.0a1
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
Bug 1578584 - Follow-up test fix: Quantumbar WebExt API: Add onResultPicked event. Increase the extension notification timeout to prevent intermittent test failures. Like this existing test does: https://searchfox.org/mozilla-central/rev/f43ae7e1c43a4a940b658381157a6ea6c5a185c1/browser/components/extensions/test/xpcshell/test_ext_urlbar.js#43 Differential Revision: https://phabricator.services.mozilla.com/D47199
browser/components/extensions/test/browser/browser_ext_urlbar.js
--- a/browser/components/extensions/test/browser/browser_ext_urlbar.js
+++ b/browser/components/extensions/test/browser/browser_ext_urlbar.js
@@ -1,11 +1,12 @@
 "use strict";
 
 XPCOMUtils.defineLazyModuleGetters(this, {
+  UrlbarProviderExtension: "resource:///modules/UrlbarProviderExtension.jsm",
   UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.jsm",
 });
 
 async function loadExtension(options = {}) {
   let ext = ExtensionTestUtils.loadExtension({
     manifest: {
       permissions: ["urlbar"],
     },
@@ -41,16 +42,26 @@ async function loadExtension(options = {
       });
     },
   });
   await ext.startup();
   await Promise.all([ext.sendMessage(options), ext.awaitMessage("ready")]);
   return ext;
 }
 
+add_task(async function setUp() {
+  // Set the notification timeout to a really high value to avoid intermittent
+  // failures due to the mock extensions not responding in time.
+  let originalTimeout = UrlbarProviderExtension.notificationTimeout;
+  UrlbarProviderExtension.notificationTimeout = 5000;
+  registerCleanupFunction(() => {
+    UrlbarProviderExtension.notificationTimeout = originalTimeout;
+  });
+});
+
 // Loads an extension without a main button URL and presses enter on the main
 // button.
 add_task(async function testOnResultPicked_mainButton_noURL_enter() {
   let ext = await loadExtension();
   await UrlbarTestUtils.promiseAutocompleteResultPopup({
     window,
     waitForFocus,
     value: "test",