Backed out 3 changesets (bug 1531347) for bc failures at browser_privateBrowsingWindowChange.js on a CLOSED TREE
authorAndreea Pavel <apavel@mozilla.com>
Sat, 02 Mar 2019 14:14:59 +0200
changeset 520030 9ee8480e23e7cb86d5cb934e2259c26c31130679
parent 520029 89e9e71a6b0c0d424545c7af89a94714041febe0
child 520031 a193a626803d2412d50e1ef7325c04049036def8
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1531347
milestone67.0a1
backs out9a7e65e00bc0bfe9b539eb5f5e4467a5a13e3f5e
f6c1385bf921c607a4db0ba1877448c131e7c80b
4c03b8915c8eb90367be19212650901f24395bc7
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 3 changesets (bug 1531347) for bc failures at browser_privateBrowsingWindowChange.js on a CLOSED TREE Backed out changeset 9a7e65e00bc0 (bug 1531347) Backed out changeset f6c1385bf921 (bug 1531347) Backed out changeset 4c03b8915c8e (bug 1531347)
browser/components/urlbar/tests/browser/browser.ini
browser/components/urlbar/tests/browser/browser_autoFill_backspaced.js
browser/components/urlbar/tests/browser/browser_autoFill_canonize.js
browser/components/urlbar/tests/browser/browser_autoFill_preserveCase.js
browser/components/urlbar/tests/browser/browser_autoFill_trimURLs.js
browser/components/urlbar/tests/browser/browser_keepStateAcrossTabSwitches.js
browser/components/urlbar/tests/browser/browser_privateBrowsingWindowChange.js
browser/components/urlbar/tests/browser/browser_raceWithTabs.js
browser/components/urlbar/tests/browser/browser_searchTelemetry.js
browser/components/urlbar/tests/browser/browser_stop_pending.js
browser/components/urlbar/tests/browser/browser_switchTab_decodeuri.js
browser/components/urlbar/tests/browser/browser_switchTab_override.js
browser/components/urlbar/tests/browser/head.js
browser/components/urlbar/tests/legacy/browser.ini
browser/components/urlbar/tests/legacy/browser_switchtab_decodeuri.js
browser/components/urlbar/tests/legacy/browser_switchtab_override.js
browser/components/urlbar/tests/legacy/browser_urlbarAutoFillTrimURLs.js
browser/components/urlbar/tests/legacy/browser_urlbarAutofillPreserveCase.js
browser/components/urlbar/tests/legacy/browser_urlbarKeepStateAcrossTabSwitches.js
browser/components/urlbar/tests/legacy/browser_urlbarPrivateBrowsingWindowChange.js
browser/components/urlbar/tests/legacy/browser_urlbarRaceWithTabs.js
browser/components/urlbar/tests/legacy/browser_urlbarSearchTelemetry.js
browser/components/urlbar/tests/legacy/browser_urlbar_autoFill_backspaced.js
browser/components/urlbar/tests/legacy/browser_urlbar_canonize_on_autofill.js
browser/components/urlbar/tests/legacy/browser_urlbar_stop_pending.js
--- a/browser/components/urlbar/tests/browser/browser.ini
+++ b/browser/components/urlbar/tests/browser/browser.ini
@@ -18,63 +18,39 @@ skip-if = true # Bug 1524539 - need to f
 [browser_autocomplete_autoselect.js]
 [browser_autocomplete_cursor.js]
 [browser_autocomplete_edit_completed.js]
 [browser_autocomplete_enter_race.js]
 [browser_autocomplete_no_title.js]
 [browser_autocomplete_readline_navigation.js]
 skip-if = os != "mac" # Mac only feature
 [browser_autocomplete_tag_star_visibility.js]
-[browser_autoFill_backspaced.js]
-skip-if = true # Bug 1531348 - Failing with QuantumBar.
-[browser_autoFill_canonize.js]
-skip-if = true # Bug 1531348 - Failing with QuantumBar.
-[browser_autoFill_preserveCase.js]
-skip-if = true # Bug 1531348 - Failing with QuantumBar.
-[browser_autoFill_trimURLs.js]
-skip-if = true # Bug 1531348 - Failing with QuantumBar.
 [browser_canonizeURL.js]
 [browser_dragdropURL.js]
-[browser_keepStateAcrossTabSwitches.js]
 [browser_keyword_override.js]
 [browser_keyword_select_and_type.js]
 [browser_keyword.js]
 support-files =
   print_postdata.sjs
 [browser_locationBarCommand.js]
 [browser_locationBarExternalLoad.js]
 [browser_moz_action_link.js]
 [browser_new_tab_urlbar_reset.js]
 [browser_pasteAndGo.js]
 subsuite = clipboard
 [browser_populateAfterPushState.js]
-[browser_privateBrowsingWindowChange.js]
-[browser_raceWithTabs.js]
-skip-if = true # Bug 1531787 - Fails with QuantumBar
-# skip-if = os == "linux" # Bug 1382456
 [browser_redirect_error.js]
 support-files = redirect_error.sjs
 [browser_remotetab.js]
 [browser_removeUnsafeProtocolsFromURLBarPaste.js]
 subsuite = clipboard
 [browser_search_favicon.js]
 skip-if = true # Bug 1526222 - Doesn't currently work with QuantumBar
-[browser_searchTelemetry.js]
-support-files =
-  searchSuggestionEngine.xml
-  searchSuggestionEngine.sjs
-[browser_stop_pending.js]
-support-files =
-  slow-page.sjs
 [browser_switchTab_closesUrlbarPopup.js]
-[browser_switchTab_decodeuri.js]
-[browser_switchTab_override.js]
-skip-if = ((os == 'win') && verify && debug)
 [browser_switchToTab_closes_newtab.js]
-skip-if = true # Bug 1531737 - fails when run after browser_switchTab_override.js
 [browser_switchToTabHavingURI_aOpenParams.js]
 [browser_tabMatchesInAwesomebar_perwindowpb.js]
 skip-if = os == 'linux' # Bug 1104755 (Intermittent failure)
 [browser_tabMatchesInAwesomebar.js]
 support-files =
   moz.png
 [browser_urlbar_blanking.js]
 support-files =
--- a/browser/components/urlbar/tests/browser/head.js
+++ b/browser/components/urlbar/tests/browser/head.js
@@ -8,17 +8,16 @@
 "use strict";
 
 let sandbox;
 
 var {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetters(this, {
   AppConstants: "resource://gre/modules/AppConstants.jsm",
   PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
-  TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.jsm",
   UrlbarController: "resource:///modules/UrlbarController.jsm",
   UrlbarResult: "resource:///modules/UrlbarResult.jsm",
   UrlbarQueryContext: "resource:///modules/UrlbarUtils.jsm",
   UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
 });
 
 /* import-globals-from head-common.js */
 Services.scriptloader.loadSubScript(
--- a/browser/components/urlbar/tests/legacy/browser.ini
+++ b/browser/components/urlbar/tests/legacy/browser.ini
@@ -7,36 +7,47 @@ support-files =
   head.js
 
 # XXX Bug 1514162: These are tests that have not yet been ported to the new
 # QuantumBar.
 #
 # If you port a test, please move it to the section below to make it clearer
 # to identify the remaining tests.
 
-# Not porting browser_switchtab_override_keynav.js/browser_switchtab_copy.js
-# to QuantumBar as we no longer have moz-action uris, so they aren't relevant
-# any more.
 [browser_switchtab_copy.js]
 subsuite = clipboard
+[browser_switchtab_decodeuri.js]
 [browser_switchtab_override_keynav.js]
-# Not porting browser_urlbarAddonIframe.js - we'll be implementing new
-# WebExtension APIs
+[browser_switchtab_override.js]
+skip-if = (verify && debug && (os == 'win'))
 [browser_urlbarAddonIframe.js]
 support-files =
   ../browser/Panel.jsm
   ../browser/urlbarAddonIframe.html
   ../browser/urlbarAddonIframe.js
   ../browser/urlbarAddonIframeContentScript.js
-# Not porting browser_urlbarSearchSuggestions_opt-out.js - search suggestion
-# prompt not in QuantumBar
+[browser_urlbarAutofillPreserveCase.js]
+[browser_urlbarAutoFillTrimURLs.js]
+[browser_urlbarKeepStateAcrossTabSwitches.js]
+[browser_urlbarPrivateBrowsingWindowChange.js]
+[browser_urlbarRaceWithTabs.js]
+skip-if = os == "linux" # Bug 1382456
 [browser_urlbarSearchSuggestions_opt-out.js]
 support-files =
   ../browser/searchSuggestionEngine.xml
   ../browser/searchSuggestionEngine.sjs
+[browser_urlbarSearchTelemetry.js]
+support-files =
+  ../browser/searchSuggestionEngine.xml
+  ../browser/searchSuggestionEngine.sjs
+[browser_urlbar_autoFill_backspaced.js]
+[browser_urlbar_canonize_on_autofill.js]
+[browser_urlbar_stop_pending.js]
+support-files =
+  ../browser/slow-page.sjs
 
 
 # These are tests that are already running with QuantumBar, but we want to run them
 # against both the legacy urlbar and the new QuantumBar. The references in this
 # directory will run them against the old urlbar as per the pref above.
 
 [../browser/browser_action_searchengine.js]
 [../browser/browser_action_searchengine_alias.js]
@@ -44,58 +55,40 @@ support-files =
 skip-if = (verify && !debug && (os == 'win'))
 [../browser/browser_autocomplete_autoselect.js]
 [../browser/browser_autocomplete_cursor.js]
 [../browser/browser_autocomplete_edit_completed.js]
 [../browser/browser_autocomplete_enter_race.js]
 [../browser/browser_autocomplete_no_title.js]
 [../browser/browser_autocomplete_readline_navigation.js]
 skip-if = os != "mac" # Mac only feature
-[../browser/browser_autoFill_backspaced.js]
-[../browser/browser_autoFill_canonize.js]
-[../browser/browser_autoFill_preserveCase.js]
-[../browser/browser_autoFill_trimURLs.js]
 [../browser/browser_autocomplete_tag_star_visibility.js]
 [../browser/browser_canonizeURL.js]
 [../browser/browser_dragdropURL.js]
-[../browser/browser_keepStateAcrossTabSwitches.js]
 [../browser/browser_keyword_override.js]
 [../browser/browser_keyword_select_and_type.js]
 [../browser/browser_keyword.js]
 support-files =
   ../browser/print_postdata.sjs
 [../browser/browser_URLBarSetURI.js]
 skip-if = (os == "linux" || os == "mac") && debug # bug 970052, bug 970053
 [../browser/browser_locationBarCommand.js]
 [../browser/browser_locationBarExternalLoad.js]
 [../browser/browser_moz_action_link.js]
 [../browser/browser_new_tab_urlbar_reset.js]
 [../browser/browser_pasteAndGo.js]
 subsuite = clipboard
 [../browser/browser_populateAfterPushState.js]
-[../browser/browser_privateBrowsingWindowChange.js]
-[../browser/browser_raceWithTabs.js]
-skip-if = os == "linux" # Bug 1382456
 [../browser/browser_redirect_error.js]
 support-files = ../browser/redirect_error.sjs
 [../browser/browser_remotetab.js]
 [../browser/browser_removeUnsafeProtocolsFromURLBarPaste.js]
 subsuite = clipboard
 [../browser/browser_search_favicon.js]
-[../browser/browser_searchTelemetry.js]
-support-files =
-  ../browser/searchSuggestionEngine.xml
-  ../browser/searchSuggestionEngine.sjs
-[../browser/browser_stop_pending.js]
-support-files =
-  ../browser/slow-page.sjs
 [../browser/browser_switchTab_closesUrlbarPopup.js]
-[../browser/browser_switchTab_decodeuri.js]
-[../browser/browser_switchTab_override.js]
-skip-if = ((os == 'win') && verify && debug)
 [../browser/browser_switchToTab_closes_newtab.js]
 [../browser/browser_switchToTabHavingURI_aOpenParams.js]
 [../browser/browser_tabMatchesInAwesomebar_perwindowpb.js]
 skip-if = os == 'linux' # Bug 1104755
 [../browser/browser_tabMatchesInAwesomebar.js]
 support-files =
   ../browser/moz.png
 [../browser/browser_urlbarAboutHomeLoading.js]
rename from browser/components/urlbar/tests/browser/browser_switchTab_decodeuri.js
rename to browser/components/urlbar/tests/legacy/browser_switchtab_decodeuri.js
--- a/browser/components/urlbar/tests/browser/browser_switchTab_decodeuri.js
+++ b/browser/components/urlbar/tests/legacy/browser_switchtab_decodeuri.js
@@ -1,40 +1,31 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This test ensures that switch to tab still works when the URI contains an
- * encoded part.
- */
-
-"use strict";
-
 const TEST_PATH = getRootDirectory(gTestPath)
   .replace("chrome://mochitests/content", "http://example.org");
 const TEST_URL = `${TEST_PATH}dummy_page.html#test%7C1`;
 
 add_task(async function test_switchtab_decodeuri() {
   info("Opening first tab");
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URL);
 
   info("Opening and selecting second tab");
   gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   info("Wait for autocomplete");
   await promiseAutocompleteResultPopup("dummy_page");
 
   info("Select autocomplete popup entry");
   EventUtils.synthesizeKey("KEY_ArrowDown");
-  let result = await UrlbarTestUtils.getDetailsOfResultAt(window,
-    UrlbarTestUtils.getSelectedIndex(window));
-  Assert.equal(result.type, UrlbarUtils.RESULT_TYPE.TAB_SWITCH);
+  ok(gURLBar.value.startsWith("moz-action:switchtab"), "switch to tab entry found");
 
   info("switch-to-tab");
-  let tabSelectPromise = BrowserTestUtils.waitForEvent(window, "TabSelect", false);
-  EventUtils.synthesizeKey("KEY_Enter");
-  await tabSelectPromise;
-
-  Assert.equal(gBrowser.selectedTab, tab, "Should have switched to the right tab");
+  await new Promise((resolve, reject) => {
+    // In case of success it should switch tab.
+    gBrowser.tabContainer.addEventListener("TabSelect", function() {
+      is(gBrowser.selectedTab, tab, "Should have switched to the right tab");
+      resolve();
+    }, {once: true});
+    EventUtils.synthesizeKey("KEY_Enter");
+  });
 
   gBrowser.removeCurrentTab();
   await PlacesUtils.history.clear();
 });
rename from browser/components/urlbar/tests/browser/browser_switchTab_override.js
rename to browser/components/urlbar/tests/legacy/browser_switchtab_override.js
--- a/browser/components/urlbar/tests/browser/browser_switchTab_override.js
+++ b/browser/components/urlbar/tests/legacy/browser_switchtab_override.js
@@ -1,19 +1,12 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-/**
- * This test ensures that overriding switch-to-tab correctly loads the page
- * rather than switching to it.
- */
-
-"use strict";
-
 const TEST_PATH = getRootDirectory(gTestPath)
   .replace("chrome://mochitests/content", "http://example.org/");
 const TEST_URL = `${TEST_PATH}dummy_page.html`;
 
 
 add_task(async function test_switchtab_override() {
   info("Opening first tab");
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URL);
@@ -23,26 +16,38 @@ add_task(async function test_switchtab_o
   registerCleanupFunction(() => {
     try {
       gBrowser.removeTab(tab);
       gBrowser.removeTab(secondTab);
     } catch (ex) { /* tabs may have already been closed in case of failure */ }
   });
 
   info("Wait for autocomplete");
-  await promiseAutocompleteResultPopup("dummy_page");
+  let deferred = PromiseUtils.defer();
+  let onSearchComplete = gURLBar.onSearchComplete;
+  registerCleanupFunction(() => {
+    gURLBar.onSearchComplete = onSearchComplete;
+  });
+  gURLBar.onSearchComplete = function() {
+    ok(gURLBar.popupOpen, "The autocomplete popup is correctly open");
+    onSearchComplete.apply(gURLBar);
+    deferred.resolve();
+  };
+
+  gURLBar.focus();
+  gURLBar.value = "dummy_pag";
+  EventUtils.sendString("e");
+  await deferred.promise;
 
   info("Select second autocomplete popup entry");
   EventUtils.synthesizeKey("KEY_ArrowDown");
-  let result = await UrlbarTestUtils.getDetailsOfResultAt(window,
-    UrlbarTestUtils.getSelectedIndex(window));
-  Assert.equal(result.type, UrlbarUtils.RESULT_TYPE.TAB_SWITCH);
+  ok(/moz-action:switchtab/.test(gURLBar.value), "switch to tab entry found");
 
   info("Override switch-to-tab");
-  let deferred = PromiseUtils.defer();
+  deferred = PromiseUtils.defer();
   // In case of failure this would switch tab.
   let onTabSelect = event => {
     deferred.reject(new Error("Should have overridden switch to tab"));
   };
   gBrowser.tabContainer.addEventListener("TabSelect", onTabSelect);
   registerCleanupFunction(() => {
     gBrowser.tabContainer.removeEventListener("TabSelect", onTabSelect);
   });
rename from browser/components/urlbar/tests/browser/browser_autoFill_trimURLs.js
rename to browser/components/urlbar/tests/legacy/browser_urlbarAutoFillTrimURLs.js
--- a/browser/components/urlbar/tests/browser/browser_autoFill_trimURLs.js
+++ b/browser/components/urlbar/tests/legacy/browser_urlbarAutoFillTrimURLs.js
@@ -1,16 +1,11 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
 // This test ensures that autoFilled values are not trimmed, unless the user
 // selects from the autocomplete popup.
 
-"use strict";
-
 add_task(async function setup() {
   const PREF_TRIMURL = "browser.urlbar.trimURLs";
   const PREF_AUTOFILL = "browser.urlbar.autoFill";
 
   registerCleanupFunction(async function() {
     Services.prefs.clearUserPref(PREF_TRIMURL);
     Services.prefs.clearUserPref(PREF_AUTOFILL);
     await PlacesUtils.history.clear();
@@ -37,113 +32,98 @@ async function promiseSearch(searchtext)
   await promiseSearchComplete();
 }
 
 async function promiseTestResult(test) {
   info("Searching for '${test.search}'");
 
   await promiseSearch(test.search);
 
-  Assert.equal(gURLBar.inputField.value, test.autofilledValue,
-    `Autofilled value is as expected for search '${test.search}'`);
+  is(gURLBar.inputField.value, test.autofilledValue,
+     `Autofilled value is as expected for search '${test.search}'`);
 
-  let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0);
-
-  Assert.equal(result.displayed.title, test.resultListDisplayTitle,
-    `Autocomplete result should have displayed title as expected for search '${test.search}'`);
+  let result = gURLBar.popup.richlistbox.getItemAtIndex(0);
 
-  if (!UrlbarPrefs.get("quantumbar") && test.resultListActionText == "Visit") {
-    Assert.equal(result.displayed.action, "",
-      `Autocomplete action text should be empty for search '${test.search}'`);
-  } else {
-    Assert.equal(result.displayed.action, test.resultListActionText,
-      `Autocomplete action text should be as expected for search '${test.search}'`);
-  }
+  is(result._titleText.textContent, test.resultListDisplayTitle,
+     `Autocomplete result should have displayed title as expected for search '${test.search}'`);
+
+  is(result._actionText.textContent, test.resultListActionText,
+     `Autocomplete action text should be as expected for search '${test.search}'`);
 
-  Assert.equal(result.type, test.resultListType,
-    `Autocomplete result should have searchengine for the type for search '${test.search}'`);
+  is(result.getAttribute("type"), test.resultListType,
+     `Autocomplete result should have searchengine for the type for search '${test.search}'`);
 
-  if (UrlbarPrefs.get("quantumbar")) {
-    Assert.equal(result.url, test.expectedUrl, "Should have the correct URL");
+  let actualValue = gURLBar.mController.getFinalCompleteValueAt(0);
+  let actualAction = PlacesUtils.parseActionUrl(actualValue);
+  let expectedAction = PlacesUtils.parseActionUrl(test.finalCompleteValue);
+  Assert.equal(!!actualAction, !!expectedAction);
+  if (actualAction) {
+    Assert.deepEqual(actualAction, expectedAction);
   } else {
-    let actualValue = gURLBar.mController.getFinalCompleteValueAt(0);
-    let actualAction = PlacesUtils.parseActionUrl(actualValue);
-    let expectedAction = PlacesUtils.parseActionUrl(test.finalCompleteValue);
-    Assert.equal(!!actualAction, !!expectedAction,
-      "Should have an action if expected");
-    if (actualAction) {
-      Assert.deepEqual(actualAction, expectedAction,
-        "Should have the correct action details");
-    } else {
-      Assert.equal(actualValue, test.finalCompleteValue,
-        "Should have the correct action details");
-    }
+    Assert.equal(actualValue, test.finalCompleteValue);
   }
 }
 
 const tests = [{
     search: "http://",
     autofilledValue: "http://",
     resultListDisplayTitle: "http://",
     resultListActionText: "Search with Google",
-    resultListType: UrlbarUtils.RESULT_TYPE.SEARCH,
+    resultListType: "searchengine",
     finalCompleteValue: 'moz-action:searchengine,{"engineName":"Google","input":"http%3A%2F%2F","searchQuery":"http%3A%2F%2F"}',
   },
   {
     search: "https://",
     autofilledValue: "https://",
     resultListDisplayTitle: "https://",
     resultListActionText: "Search with Google",
-    resultListType: UrlbarUtils.RESULT_TYPE.SEARCH,
+    resultListType: "searchengine",
     finalCompleteValue: 'moz-action:searchengine,{"engineName":"Google","input":"https%3A%2F%2F","searchQuery":"https%3A%2F%2F"}',
   },
   {
     search: "au",
     autofilledValue: "autofilltrimurl.com/",
     resultListDisplayTitle: "www.autofilltrimurl.com",
     resultListActionText: "Visit",
-    resultListType: UrlbarUtils.RESULT_TYPE.URL,
+    resultListType: "",
     finalCompleteValue: "http://www.autofilltrimurl.com/",
   },
   {
     search: "http://au",
     autofilledValue: "http://autofilltrimurl.com/",
     resultListDisplayTitle: "www.autofilltrimurl.com",
     resultListActionText: "Visit",
-    resultListType: UrlbarUtils.RESULT_TYPE.URL,
+    resultListType: "",
     finalCompleteValue: "http://www.autofilltrimurl.com/",
   },
   {
     search: "sec",
     autofilledValue: "secureautofillurl.com/",
     resultListDisplayTitle: "https://www.secureautofillurl.com",
     resultListActionText: "Visit",
-    resultListType: UrlbarUtils.RESULT_TYPE.URL,
+    resultListType: "",
     finalCompleteValue: "https://www.secureautofillurl.com/",
   },
   {
     search: "https://sec",
     autofilledValue: "https://secureautofillurl.com/",
     resultListDisplayTitle: "https://www.secureautofillurl.com",
     resultListActionText: "Visit",
-    resultListType: UrlbarUtils.RESULT_TYPE.URL,
+    resultListType: "",
     finalCompleteValue: "https://www.secureautofillurl.com/",
   },
 ];
 
 add_task(async function autofill_tests() {
   for (let test of tests) {
     await promiseTestResult(test);
   }
 });
 
 add_task(async function autofill_complete_domain() {
   await promiseSearch("http://www.autofilltrimurl.com");
-  Assert.equal(gURLBar.inputField.value, "http://www.autofilltrimurl.com/",
-    "Should have the correct autofill value");
+  is(gURLBar.inputField.value, "http://www.autofilltrimurl.com/", "Autofilled value is as expected");
 
   // Now ensure selecting from the popup correctly trims.
-  Assert.equal(UrlbarTestUtils.getResultCount(window), 2,
-    "Should have the correct matches");
+  is(gURLBar.controller.matchCount, 2, "Found the expected number of matches");
   EventUtils.synthesizeKey("KEY_ArrowDown");
-  Assert.equal(gURLBar.inputField.value, "www.autofilltrimurl.com/whatever",
-    "Should have applied trim correctly");
+  is(gURLBar.inputField.value, "www.autofilltrimurl.com/whatever", "trim was applied correctly");
 });
rename from browser/components/urlbar/tests/browser/browser_autoFill_preserveCase.js
rename to browser/components/urlbar/tests/legacy/browser_urlbarAutofillPreserveCase.js
--- a/browser/components/urlbar/tests/browser/browser_autoFill_preserveCase.js
+++ b/browser/components/urlbar/tests/legacy/browser_urlbarAutofillPreserveCase.js
@@ -1,11 +1,8 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
 // This test makes sure that when the user starts typing origins and URLs, the
 // case of the user's search string is preserved inside the origin part of the
 // autofilled string.
 
 "use strict";
 
 add_task(async function init() {
   await cleanUp();
@@ -66,12 +63,12 @@ add_task(async function urlPort() {
   }]);
   await promiseAutocompleteResultPopup("ExAmple.com:8888/f");
   Assert.equal(gURLBar.value, "ExAmple.com:8888/foo");
   await cleanUp();
 });
 
 async function cleanUp() {
   EventUtils.synthesizeKey("KEY_Escape");
-  await UrlbarTestUtils.promisePopupClose(window);
+  await promisePopupHidden(gURLBar.popup);
   await PlacesUtils.bookmarks.eraseEverything();
   await PlacesUtils.history.clear();
 }
rename from browser/components/urlbar/tests/browser/browser_keepStateAcrossTabSwitches.js
rename to browser/components/urlbar/tests/legacy/browser_urlbarKeepStateAcrossTabSwitches.js
--- a/browser/components/urlbar/tests/browser/browser_keepStateAcrossTabSwitches.js
+++ b/browser/components/urlbar/tests/legacy/browser_urlbarKeepStateAcrossTabSwitches.js
@@ -1,11 +1,8 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
 "use strict";
 
 /**
  * Verify user typed text remains in the URL bar when tab switching, even when
  * loads fail.
  */
 add_task(async function() {
   let input = "i-definitely-dont-exist.example.com";
@@ -54,8 +51,9 @@ add_task(async function() {
   is(gURLBar.textValue, input, "Text is still in URL bar");
   is(tab.linkedBrowser.userTypedValue, input, "Text still stored on browser");
   await BrowserTestUtils.switchTab(gBrowser, tab.previousElementSibling);
   await BrowserTestUtils.switchTab(gBrowser, tab);
   is(gURLBar.textValue, input, "Text is still in URL bar after tab switch");
   is(tab.linkedBrowser.userTypedValue, input, "Text still stored on browser");
   BrowserTestUtils.removeTab(tab);
 });
+
rename from browser/components/urlbar/tests/browser/browser_privateBrowsingWindowChange.js
rename to browser/components/urlbar/tests/legacy/browser_urlbarPrivateBrowsingWindowChange.js
--- a/browser/components/urlbar/tests/browser/browser_privateBrowsingWindowChange.js
+++ b/browser/components/urlbar/tests/legacy/browser_urlbarPrivateBrowsingWindowChange.js
@@ -1,11 +1,8 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
 "use strict";
 
 /**
  * Test that when opening a private browsing window and typing in it before about:privatebrowsing
  * loads, we don't clear the URL bar.
  */
 add_task(async function() {
   let urlbarTestValue = "Mary had a little lamb";
@@ -13,17 +10,17 @@ add_task(async function() {
   await BrowserTestUtils.waitForEvent(win, "load");
   let urlbar = win.document.getElementById("urlbar");
   urlbar.value = urlbarTestValue;
   // Need this so the autocomplete controller attaches:
   let focusEv = new FocusEvent("focus", {});
   urlbar.dispatchEvent(focusEv);
   // And so we know input happened:
   let inputEv = new InputEvent("input", {data: "", view: win, bubbles: true});
-  urlbar.inputField.dispatchEvent(inputEv);
+  urlbar.onInput(inputEv);
   // Check it worked:
   is(urlbar.value, urlbarTestValue, "URL bar value should be there");
   is(win.gBrowser.selectedBrowser.userTypedValue, urlbarTestValue, "browser object should know the url bar value");
 
   let continueTest;
   let continuePromise = new Promise(resolve => continueTest = resolve);
   let wpl = {
     onLocationChange(aWebProgress, aRequest, aLocation) {
rename from browser/components/urlbar/tests/browser/browser_raceWithTabs.js
rename to browser/components/urlbar/tests/legacy/browser_urlbarRaceWithTabs.js
rename from browser/components/urlbar/tests/browser/browser_searchTelemetry.js
rename to browser/components/urlbar/tests/legacy/browser_urlbarSearchTelemetry.js
--- a/browser/components/urlbar/tests/browser/browser_searchTelemetry.js
+++ b/browser/components/urlbar/tests/legacy/browser_urlbarSearchTelemetry.js
@@ -16,80 +16,79 @@ add_task(async function prepare() {
     Services.prefs.setBoolPref(SUGGEST_URLBAR_PREF, suggestionsEnabled);
     await Services.search.setDefault(oldDefaultEngine);
 
     // Clicking urlbar results causes visits to their associated pages, so clear
     // that history now.
     await PlacesUtils.history.clear();
 
     // Make sure the popup is closed for the next test.
-    await UrlbarTestUtils.promisePopupClose(window);
+    gURLBar.blur();
+    Assert.ok(!gURLBar.popup.popupOpen, "popup should be closed");
   });
 
   // Move the mouse away from the urlbar one-offs so that a one-off engine is
   // not inadvertently selected.
   await new Promise(resolve => {
     EventUtils.synthesizeNativeMouseMove(window.document.documentElement, 0, 0,
                                          resolve);
   });
 });
 
 add_task(async function heuristicResultMouse() {
   await compareCounts(async function() {
     let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
     gURLBar.focus();
     await promiseAutocompleteResultPopup("heuristicResult");
-    let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0);
-    Assert.equal(result.type, UrlbarUtils.RESULT_TYPE.SEARCH,
-      "Should be of type search");
+    let action = getActionAtIndex(0);
+    Assert.ok(!!action, "there should be an action at index 0");
+    Assert.equal(action.type, "searchengine", "type should be searchengine");
     let loadPromise = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
-    let element = await UrlbarTestUtils.waitForAutocompleteResultAt(window, 0);
-    EventUtils.synthesizeMouseAtCenter(element, {});
+    gURLBar.popup.richlistbox.getItemAtIndex(0).click();
     await loadPromise;
     BrowserTestUtils.removeTab(tab);
   });
 });
 
 add_task(async function heuristicResultKeyboard() {
   await compareCounts(async function() {
     let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
     gURLBar.focus();
     await promiseAutocompleteResultPopup("heuristicResult");
-    let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0);
-    Assert.equal(result.type, UrlbarUtils.RESULT_TYPE.SEARCH,
-      "Should be of type search");
+    let action = getActionAtIndex(0);
+    Assert.ok(!!action, "there should be an action at index 0");
+    Assert.equal(action.type, "searchengine", "type should be searchengine");
     let loadPromise = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
     EventUtils.sendKey("return");
     await loadPromise;
     BrowserTestUtils.removeTab(tab);
   });
 });
 
 add_task(async function searchSuggestionMouse() {
   await compareCounts(async function() {
     let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
     gURLBar.focus();
     await promiseAutocompleteResultPopup("searchSuggestion");
-    let idx = await getFirstSuggestionIndex();
-    Assert.greaterOrEqual(idx, 0, "there should be a first suggestion");
+    let idx = getFirstSuggestionIndex();
+    Assert.ok(idx >= 0, "there should be a first suggestion");
     let loadPromise = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
-    let element = await UrlbarTestUtils.waitForAutocompleteResultAt(window, idx);
-    EventUtils.synthesizeMouseAtCenter(element, {});
+    gURLBar.popup.richlistbox.getItemAtIndex(idx).click();
     await loadPromise;
     BrowserTestUtils.removeTab(tab);
   });
 });
 
 add_task(async function searchSuggestionKeyboard() {
   await compareCounts(async function() {
     let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
     gURLBar.focus();
     await promiseAutocompleteResultPopup("searchSuggestion");
-    let idx = await getFirstSuggestionIndex();
-    Assert.greaterOrEqual(idx, 0, "there should be a first suggestion");
+    let idx = getFirstSuggestionIndex();
+    Assert.ok(idx >= 0, "there should be a first suggestion");
     let loadPromise = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
     while (idx--) {
       EventUtils.sendKey("down");
     }
     EventUtils.sendKey("return");
     await loadPromise;
     BrowserTestUtils.removeTab(tab);
   });
@@ -107,38 +106,90 @@ async function compareCounts(clickCallba
   // Search events triggered by clicks (not the Return key in the urlbar) are
   // recorded in three places:
   // * Telemetry histogram named "SEARCH_COUNTS"
   // * FHR
 
   let engine = await Services.search.getDefault();
   let engineID = "org.mozilla.testsearchsuggestions";
 
+  // First, get the current counts.
+
+  // telemetry histogram SEARCH_COUNTS
+  let histogramCount = 0;
   let histogramKey = engineID + ".urlbar";
-  let histogram = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS");
-  histogram.clear();
+  let histogram;
+  try {
+    histogram = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS");
+  } catch (ex) {
+    // No searches performed yet, not a problem.
+  }
+  if (histogram) {
+    let snapshot = histogram.snapshot();
+    if (histogramKey in snapshot) {
+      histogramCount = snapshot[histogramKey].sum;
+    }
+  }
 
   // FHR -- first make sure the engine has an identifier so that FHR is happy.
   Object.defineProperty(engine.wrappedJSObject, "identifier",
                         { value: engineID });
 
   gURLBar.focus();
   await clickCallback();
 
-  TelemetryTestUtils.assertKeyedHistogramSum(histogram, histogramKey, 1);
+  // Now get the new counts and compare them to the old.
+
+  // telemetry histogram SEARCH_COUNTS
+  histogram = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS");
+  let snapshot = histogram.snapshot();
+  Assert.ok(histogramKey in snapshot, "histogram with key should be recorded");
+  Assert.equal(snapshot[histogramKey].sum, histogramCount + 1,
+               "histogram sum should be incremented");
+}
+
+/**
+ * Returns the "action" object at the given index in the urlbar results:
+ * { type, params: {}}
+ *
+ * @param {number} index The index in the urlbar results.
+ * @returns {object|null} An action object, or null if index >= number of results.
+ */
+function getActionAtIndex(index) {
+  let controller = gURLBar.popup.input.controller;
+  if (controller.matchCount <= index) {
+    return null;
+  }
+  let url = controller.getValueAt(index);
+  let mozActionMatch = url.match(/^moz-action:([^,]+),(.*)$/);
+  if (!mozActionMatch) {
+    let msg = "result at index " + index + " is not a moz-action: " + url;
+    Assert.ok(false, msg);
+    throw new Error(msg);
+  }
+  let [, type, paramStr] = mozActionMatch;
+  return {
+    type,
+    params: JSON.parse(paramStr),
+  };
 }
 
 /**
  * Returns the index of the first search suggestion in the urlbar results.
  *
  * @returns {number} An index, or -1 if there are no search suggestions.
  */
-async function getFirstSuggestionIndex() {
-  const matchCount = UrlbarTestUtils.getResultCount(window);
+function getFirstSuggestionIndex() {
+  let controller = gURLBar.popup.input.controller;
+  let matchCount = controller.matchCount;
   for (let i = 0; i < matchCount; i++) {
-    let result = await UrlbarTestUtils.getDetailsOfResultAt(window, i);
-    if (result.type == UrlbarUtils.RESULT_TYPE.SEARCH &&
-        result.searchParams.suggestion) {
-      return i;
+    let url = controller.getValueAt(i);
+    let mozActionMatch = url.match(/^moz-action:([^,]+),(.*)$/);
+    if (mozActionMatch) {
+      let [, type, paramStr] = mozActionMatch;
+      let params = JSON.parse(paramStr);
+      if (type == "searchengine" && "searchSuggestion" in params) {
+        return i;
+      }
     }
   }
   return -1;
 }
rename from browser/components/urlbar/tests/browser/browser_autoFill_backspaced.js
rename to browser/components/urlbar/tests/legacy/browser_urlbar_autoFill_backspaced.js
--- a/browser/components/urlbar/tests/browser/browser_autoFill_backspaced.js
+++ b/browser/components/urlbar/tests/legacy/browser_urlbar_autoFill_backspaced.js
@@ -1,41 +1,35 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
 /* This test ensures that backspacing autoFilled values still allows to
  * confirm the remaining value.
  */
 
-"use strict";
-
 async function test_autocomplete(data) {
-  let {desc, typed, autofilled, modified, keys, type, onAutoFill} = data;
+  let {desc, typed, autofilled, modified, keys, action, onAutoFill} = data;
   info(desc);
 
   await promiseAutocompleteResultPopup(typed);
-  Assert.equal(gURLBar.textValue, autofilled, "autofilled value is as expected");
+  is(gURLBar.textValue, autofilled, "autofilled value is as expected");
   if (onAutoFill)
     onAutoFill();
 
   keys.forEach(key => EventUtils.synthesizeKey(key));
 
-  Assert.equal(gURLBar.textValue, modified, "backspaced value is as expected");
+  is(gURLBar.textValue, modified, "backspaced value is as expected");
 
   await promiseSearchComplete();
 
-  Assert.greater(UrlbarTestUtils.getResultCount(window), 0,
-    "Should get at least 1 result");
-
-  let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0);
+  ok(gURLBar.popup.richlistbox.itemChildren.length > 0, "Should get at least 1 result");
+  let result = gURLBar.popup.richlistbox.itemChildren[0];
+  let type = result.getAttribute("type");
+  let types = type.split(/\s+/);
+  ok(types.includes(action), `The type attribute "${type}" includes the expected action "${action}"`);
 
-  Assert.equal(result.type, type,
-    "Should have the correct result type");
-
-  await UrlbarTestUtils.promisePopupClose(window);
+  gURLBar.popup.hidePopup();
+  await promisePopupHidden(gURLBar.popup);
   gURLBar.blur();
 }
 
 add_task(async function() {
   registerCleanupFunction(async function() {
     Services.prefs.clearUserPref("browser.urlbar.autoFill");
     gURLBar.handleRevert();
     await PlacesUtils.history.clear();
@@ -48,103 +42,103 @@ add_task(async function() {
     transition: Ci.nsINavHistoryService.TRANSITION_TYPED,
   });
 
   await test_autocomplete({ desc: "DELETE the autofilled part should search",
                             typed: "exam",
                             autofilled: "example.com/",
                             modified: "exam",
                             keys: ["KEY_Delete"],
-                            type: UrlbarUtils.RESULT_TYPE.SEARCH,
+                            action: "searchengine",
                           });
   await test_autocomplete({ desc: "DELETE the final slash should visit",
                             typed: "example.com",
                             autofilled: "example.com/",
                             modified: "example.com",
                             keys: ["KEY_Delete"],
-                            type: UrlbarUtils.RESULT_TYPE.URL,
+                            action: "visiturl",
                           });
 
   await test_autocomplete({ desc: "BACK_SPACE the autofilled part should search",
                             typed: "exam",
                             autofilled: "example.com/",
                             modified: "exam",
                             keys: ["KEY_Backspace"],
-                            type: UrlbarUtils.RESULT_TYPE.SEARCH,
+                            action: "searchengine",
                           });
   await test_autocomplete({ desc: "BACK_SPACE the final slash should visit",
                             typed: "example.com",
                             autofilled: "example.com/",
                             modified: "example.com",
                             keys: ["KEY_Backspace"],
-                            type: UrlbarUtils.RESULT_TYPE.URL,
+                            action: "visiturl",
                           });
 
   await test_autocomplete({ desc: "DELETE the autofilled part, then BACK_SPACE, should search",
                             typed: "exam",
                             autofilled: "example.com/",
                             modified: "exa",
                             keys: ["KEY_Delete", "KEY_Backspace"],
-                            type: UrlbarUtils.RESULT_TYPE.SEARCH,
+                            action: "searchengine",
                           });
   await test_autocomplete({ desc: "DELETE the final slash, then BACK_SPACE, should search",
                             typed: "example.com",
                             autofilled: "example.com/",
                             modified: "example.co",
                             keys: ["KEY_Delete", "KEY_Backspace"],
-                            type: UrlbarUtils.RESULT_TYPE.URL,
+                            action: "visiturl",
                           });
 
   await test_autocomplete({ desc: "BACK_SPACE the autofilled part, then BACK_SPACE, should search",
                             typed: "exam",
                             autofilled: "example.com/",
                             modified: "exa",
                             keys: ["KEY_Backspace", "KEY_Backspace"],
-                            type: UrlbarUtils.RESULT_TYPE.SEARCH,
+                            action: "searchengine",
                           });
   await test_autocomplete({ desc: "BACK_SPACE the final slash, then BACK_SPACE, should search",
                             typed: "example.com",
                             autofilled: "example.com/",
                             modified: "example.co",
                             keys: ["KEY_Backspace", "KEY_Backspace"],
-                            type: UrlbarUtils.RESULT_TYPE.URL,
+                            action: "visiturl",
                           });
 
   await test_autocomplete({ desc: "BACK_SPACE after blur should search",
                             typed: "ex",
                             autofilled: "example.com/",
                             modified: "e",
                             keys: ["KEY_Backspace"],
-                            type: UrlbarUtils.RESULT_TYPE.SEARCH,
+                            action: "searchengine",
                             onAutoFill: () => {
                               gURLBar.blur();
                               gURLBar.focus();
                               gURLBar.selectionStart = 1;
                               gURLBar.selectionEnd = 12;
                             },
                          });
   await test_autocomplete({ desc: "DELETE after blur should search",
                             typed: "ex",
                             autofilled: "example.com/",
                             modified: "e",
                             keys: ["KEY_Delete"],
-                            type: UrlbarUtils.RESULT_TYPE.SEARCH,
+                            action: "searchengine",
                             onAutoFill: () => {
                               gURLBar.blur();
                               gURLBar.focus();
                               gURLBar.selectionStart = 1;
                               gURLBar.selectionEnd = 12;
                             },
                           });
   await test_autocomplete({ desc: "double BACK_SPACE after blur should search",
                             typed: "ex",
                             autofilled: "example.com/",
                             modified: "e",
                             keys: ["KEY_Backspace", "KEY_Backspace"],
-                            type: UrlbarUtils.RESULT_TYPE.SEARCH,
+                            action: "searchengine",
                             onAutoFill: () => {
                               gURLBar.blur();
                               gURLBar.focus();
                               gURLBar.selectionStart = 2;
                               gURLBar.selectionEnd = 12;
                             },
                          });
 
rename from browser/components/urlbar/tests/browser/browser_autoFill_canonize.js
rename to browser/components/urlbar/tests/legacy/browser_urlbar_canonize_on_autofill.js
--- a/browser/components/urlbar/tests/browser/browser_autoFill_canonize.js
+++ b/browser/components/urlbar/tests/legacy/browser_urlbar_canonize_on_autofill.js
@@ -5,24 +5,24 @@
  * value, and only considers what the user typed (but not just enter).
  */
 
 async function test_autocomplete(data) {
   let {desc, typed, autofilled, modified, waitForUrl, keys} = data;
   info(desc);
 
   await promiseAutocompleteResultPopup(typed);
-  Assert.equal(gURLBar.textValue, autofilled, "autofilled value is as expected");
+  is(gURLBar.textValue, autofilled, "autofilled value is as expected");
 
   let promiseLoad =
     BrowserTestUtils.waitForDocLoadAndStopIt(waitForUrl, gBrowser.selectedBrowser);
 
   keys.forEach(([key, mods]) => EventUtils.synthesizeKey(key, mods));
 
-  Assert.equal(gURLBar.textValue, modified, "value is as expected");
+  is(gURLBar.textValue, modified, "value is as expected");
 
   await promiseLoad;
   gURLBar.blur();
 }
 
 add_task(async function() {
   registerCleanupFunction(async function() {
     Services.prefs.clearUserPref("browser.urlbar.autoFill");
rename from browser/components/urlbar/tests/browser/browser_stop_pending.js
rename to browser/components/urlbar/tests/legacy/browser_urlbar_stop_pending.js
--- a/browser/components/urlbar/tests/browser/browser_stop_pending.js
+++ b/browser/components/urlbar/tests/legacy/browser_urlbar_stop_pending.js
@@ -1,11 +1,8 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
 /* eslint-disable mozilla/no-arbitrary-setTimeout */
 "use strict";
 
 const SLOW_PAGE = getRootDirectory(gTestPath)
   .replace("chrome://mochitests/content", "http://www.example.com") + "slow-page.sjs";
 const SLOW_PAGE2 = getRootDirectory(gTestPath)
   .replace("chrome://mochitests/content", "http://mochi.test:8888") + "slow-page.sjs?faster";
 
@@ -23,17 +20,17 @@ add_task(async function() {
   let sawChange = false;
   let handler = e => {
     sawChange = true;
     is(gURLBar.value, expectedURLBarChange, "Should not change URL bar value!");
   };
 
   let obs = new MutationObserver(handler);
 
-  obs.observe(gURLBar.textbox, {attributes: true});
+  obs.observe(gURLBar, {attributes: true});
   gURLBar.value = SLOW_PAGE;
   gURLBar.handleCommand();
 
   // If this ever starts going intermittent, we've broken this.
   await new Promise(resolve => setTimeout(resolve, 200));
   expectedURLBarChange = SLOW_PAGE2;
   let pageLoadPromise = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   gURLBar.value = expectedURLBarChange;