Bug 1265055 - move a bunch of tests to the urlbar directory, r?adw draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 15 Apr 2016 21:11:15 +0100
changeset 354422 6545ff1b45850acb6a71c8999f449760fce829d4
parent 353700 d4b74afcc60b937f25d54f365be46a8133980209
child 518996 108d54c749f24d9db9a6eaaad90b233b90ec7430
push id16070
push usergijskruitbosch@gmail.com
push dateWed, 20 Apr 2016 20:11:34 +0000
reviewersadw
bugs1265055
milestone48.0a1
Bug 1265055 - move a bunch of tests to the urlbar directory, r?adw MozReview-Commit-ID: 67eb9v4blas
browser/base/content/test/general/authenticate.sjs
browser/base/content/test/general/browser.ini
browser/base/content/test/general/browser_URLBarSetURI.js
browser/base/content/test/general/browser_action_keyword.js
browser/base/content/test/general/browser_action_keyword_override.js
browser/base/content/test/general/browser_action_searchengine.js
browser/base/content/test/general/browser_action_searchengine_alias.js
browser/base/content/test/general/browser_autocomplete_a11y_label.js
browser/base/content/test/general/browser_autocomplete_autoselect.js
browser/base/content/test/general/browser_autocomplete_cursor.js
browser/base/content/test/general/browser_autocomplete_edit_completed.js
browser/base/content/test/general/browser_autocomplete_enter_race.js
browser/base/content/test/general/browser_autocomplete_no_title.js
browser/base/content/test/general/browser_autocomplete_oldschool_wrap.js
browser/base/content/test/general/browser_autocomplete_tag_star_visibility.js
browser/base/content/test/general/browser_bug1003461-switchtab-override.js
browser/base/content/test/general/browser_bug1024133-switchtab-override-keynav.js
browser/base/content/test/general/browser_bug1025195_switchToTabHavingURI_aOpenParams.js
browser/base/content/test/general/browser_bug1070778.js
browser/base/content/test/general/browser_bug1104165-switchtab-decodeuri.js
browser/base/content/test/general/browser_bug1225194-remotetab.js
browser/base/content/test/general/browser_bug304198.js
browser/base/content/test/general/browser_bug556061.js
browser/base/content/test/general/browser_bug562649.js
browser/base/content/test/general/browser_bug623155.js
browser/base/content/test/general/browser_bug783614.js
browser/base/content/test/general/browser_canonizeURL.js
browser/base/content/test/general/browser_locationBarCommand.js
browser/base/content/test/general/browser_locationBarExternalLoad.js
browser/base/content/test/general/browser_removeUnsafeProtocolsFromURLBarPaste.js
browser/base/content/test/general/browser_search_favicon.js
browser/base/content/test/general/browser_tabMatchesInAwesomebar.js
browser/base/content/test/general/browser_tabMatchesInAwesomebar_perwindowpb.js
browser/base/content/test/general/browser_urlHighlight.js
browser/base/content/test/general/browser_urlbarAutoFillTrimURLs.js
browser/base/content/test/general/browser_urlbarCopying.js
browser/base/content/test/general/browser_urlbarDecode.js
browser/base/content/test/general/browser_urlbarDelete.js
browser/base/content/test/general/browser_urlbarEnter.js
browser/base/content/test/general/browser_urlbarEnterAfterMouseOver.js
browser/base/content/test/general/browser_urlbarRevert.js
browser/base/content/test/general/browser_urlbarSearchSingleWordNotification.js
browser/base/content/test/general/browser_urlbarSearchSuggestions.js
browser/base/content/test/general/browser_urlbarSearchSuggestionsNotification.js
browser/base/content/test/general/browser_urlbarSearchTelemetry.js
browser/base/content/test/general/browser_urlbarStop.js
browser/base/content/test/general/browser_urlbarTrimURLs.js
browser/base/content/test/general/browser_urlbar_autoFill_backspaced.js
browser/base/content/test/general/browser_urlbar_searchsettings.js
browser/base/content/test/general/browser_wyciwyg_urlbarCopying.js
browser/base/content/test/general/head.js
browser/base/content/test/general/redirect_bug623155.sjs
browser/base/content/test/general/test_wyciwyg_copying.html
browser/base/content/test/urlbar/authenticate.sjs
browser/base/content/test/urlbar/browser.ini
browser/base/content/test/urlbar/browser_URLBarSetURI.js
browser/base/content/test/urlbar/browser_action_keyword.js
browser/base/content/test/urlbar/browser_action_keyword_override.js
browser/base/content/test/urlbar/browser_action_searchengine.js
browser/base/content/test/urlbar/browser_action_searchengine_alias.js
browser/base/content/test/urlbar/browser_autocomplete_a11y_label.js
browser/base/content/test/urlbar/browser_autocomplete_autoselect.js
browser/base/content/test/urlbar/browser_autocomplete_cursor.js
browser/base/content/test/urlbar/browser_autocomplete_edit_completed.js
browser/base/content/test/urlbar/browser_autocomplete_enter_race.js
browser/base/content/test/urlbar/browser_autocomplete_no_title.js
browser/base/content/test/urlbar/browser_autocomplete_oldschool_wrap.js
browser/base/content/test/urlbar/browser_autocomplete_tag_star_visibility.js
browser/base/content/test/urlbar/browser_bug1003461-switchtab-override.js
browser/base/content/test/urlbar/browser_bug1024133-switchtab-override-keynav.js
browser/base/content/test/urlbar/browser_bug1025195_switchToTabHavingURI_aOpenParams.js
browser/base/content/test/urlbar/browser_bug1070778.js
browser/base/content/test/urlbar/browser_bug1104165-switchtab-decodeuri.js
browser/base/content/test/urlbar/browser_bug1225194-remotetab.js
browser/base/content/test/urlbar/browser_bug304198.js
browser/base/content/test/urlbar/browser_bug556061.js
browser/base/content/test/urlbar/browser_bug562649.js
browser/base/content/test/urlbar/browser_bug623155.js
browser/base/content/test/urlbar/browser_bug783614.js
browser/base/content/test/urlbar/browser_canonizeURL.js
browser/base/content/test/urlbar/browser_locationBarCommand.js
browser/base/content/test/urlbar/browser_locationBarExternalLoad.js
browser/base/content/test/urlbar/browser_removeUnsafeProtocolsFromURLBarPaste.js
browser/base/content/test/urlbar/browser_search_favicon.js
browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar.js
browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar_perwindowpb.js
browser/base/content/test/urlbar/browser_urlHighlight.js
browser/base/content/test/urlbar/browser_urlbarAutoFillTrimURLs.js
browser/base/content/test/urlbar/browser_urlbarCopying.js
browser/base/content/test/urlbar/browser_urlbarDecode.js
browser/base/content/test/urlbar/browser_urlbarDelete.js
browser/base/content/test/urlbar/browser_urlbarEnter.js
browser/base/content/test/urlbar/browser_urlbarEnterAfterMouseOver.js
browser/base/content/test/urlbar/browser_urlbarRevert.js
browser/base/content/test/urlbar/browser_urlbarSearchSingleWordNotification.js
browser/base/content/test/urlbar/browser_urlbarSearchSuggestions.js
browser/base/content/test/urlbar/browser_urlbarSearchSuggestionsNotification.js
browser/base/content/test/urlbar/browser_urlbarSearchTelemetry.js
browser/base/content/test/urlbar/browser_urlbarStop.js
browser/base/content/test/urlbar/browser_urlbarTrimURLs.js
browser/base/content/test/urlbar/browser_urlbar_autoFill_backspaced.js
browser/base/content/test/urlbar/browser_urlbar_searchsettings.js
browser/base/content/test/urlbar/browser_wyciwyg_urlbarCopying.js
browser/base/content/test/urlbar/dummy_page.html
browser/base/content/test/urlbar/head.js
browser/base/content/test/urlbar/moz.png
browser/base/content/test/urlbar/redirect_bug623155.sjs
browser/base/content/test/urlbar/searchSuggestionEngine.sjs
browser/base/content/test/urlbar/searchSuggestionEngine.xml
browser/base/content/test/urlbar/test_wyciwyg_copying.html
toolkit/components/thumbnails/test/authenticate.sjs
toolkit/components/thumbnails/test/browser.ini
toolkit/components/thumbnails/test/browser_thumbnails_bg_no_auth_prompt.js
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -1,17 +1,16 @@
 [DEFAULT]
 skip-if = (os == "win" && debug && e10s) # Bug 1253956
 support-files =
   POSTSearchEngine.xml
   accounts_testRemoteCommands.html
   alltabslistener.html
   app_bug575561.html
   app_subframe_bug575561.html
-  authenticate.sjs
   aboutHome_content_script.js
   audio.ogg
   browser_bug479408_sample.html
   browser_bug678392-1.html
   browser_bug678392-2.html
   browser_bug970746.xhtml
   browser_fxa_oauth.html
   browser_fxa_oauth_with_keys.html
@@ -80,30 +79,28 @@ support-files =
   offlineQuotaNotification.cacheManifest
   offlineQuotaNotification.html
   page_style_sample.html
   parsingTestHelpers.jsm
   pinning_headers.sjs
   ssl_error_reports.sjs
   popup_blocker.html
   print_postdata.sjs
-  redirect_bug623155.sjs
   searchSuggestionEngine.sjs
   searchSuggestionEngine.xml
   searchSuggestionEngine2.xml
   subtst_contextmenu.html
   subtst_contextmenu_input.html
   test-mixedcontent-securityerrors.html
   test_bug435035.html
   test_bug462673.html
   test_bug628179.html
   test_bug839103.html
   test_bug959531.html
   test_process_flags_chrome.html
-  test_wyciwyg_copying.html
   title_test.svg
   unknownContentType_file.pif
   unknownContentType_file.pif^headers^
   video.ogg
   web_video.html
   web_video1.ogv
   web_video1.ogv^headers^
   zoom_test.html
@@ -131,53 +128,37 @@ support-files =
   !/toolkit/mozapps/extensions/test/xpinstall/corrupt.xpi
   !/toolkit/mozapps/extensions/test/xpinstall/incompatible.xpi
   !/toolkit/mozapps/extensions/test/xpinstall/installtrigger.html
   !/toolkit/mozapps/extensions/test/xpinstall/redirect.sjs
   !/toolkit/mozapps/extensions/test/xpinstall/restartless-unsigned.xpi
   !/toolkit/mozapps/extensions/test/xpinstall/restartless.xpi
   !/toolkit/mozapps/extensions/test/xpinstall/theme.xpi
 
-[browser_URLBarSetURI.js]
-skip-if = (os == "linux" || os == "mac") && debug # bug 970052, bug 970053
 [browser_aboutAccounts.js]
 skip-if = os == "linux" # Bug 958026
 support-files =
   content_aboutAccounts.js
 [browser_aboutCertError.js]
 [browser_aboutSupport_newtab_security_state.js]
 [browser_aboutHealthReport.js]
 skip-if = os == "linux" # Bug 924307
 [browser_aboutHome.js]
 [browser_aboutHome_wrapsCorrectly.js]
-[browser_action_keyword.js]
-[browser_action_keyword_override.js]
-[browser_action_searchengine.js]
-[browser_action_searchengine_alias.js]
 [browser_addKeywordSearch.js]
-[browser_search_favicon.js]
 [browser_alltabslistener.js]
 [browser_audioTabIcon.js]
-[browser_autocomplete_a11y_label.js]
-[browser_autocomplete_cursor.js]
-[browser_autocomplete_edit_completed.js]
-[browser_autocomplete_enter_race.js]
-[browser_autocomplete_no_title.js]
-[browser_autocomplete_autoselect.js]
-[browser_autocomplete_oldschool_wrap.js]
-[browser_autocomplete_tag_star_visibility.js]
 [browser_backButtonFitts.js]
 skip-if = os == "mac" # The Fitt's Law back button is not supported on OS X
 [browser_beforeunload_duplicate_dialogs.js]
 [browser_blob-channelname.js]
 [browser_bookmark_popup.js]
 skip-if = (os == "linux" && debug) # mouseover not reliable on linux debug builds
 [browser_bookmark_titles.js]
 skip-if = buildapp == 'mulet' || toolkit == "windows" # Disabled on Windows due to frequent failures (bugs 825739, 841341)
-[browser_bug304198.js]
 [browser_bug321000.js]
 skip-if = true # browser_bug321000.js is disabled because newline handling is shaky (bug 592528)
 [browser_bug356571.js]
 [browser_bug380960.js]
 [browser_bug386835.js]
 [browser_bug406216.js]
 [browser_bug408415.js]
 [browser_bug409481.js]
@@ -220,20 +201,18 @@ skip-if = (os == 'linux' && e10s) # bug 
 [browser_bug537013.js]
 skip-if = buildapp == 'mulet' || e10s # Bug 1134458 - Find bar doesn't work correctly in a detached tab
 [browser_bug537474.js]
 [browser_bug550565.js]
 [browser_bug553455.js]
 skip-if = buildapp == 'mulet' # Bug 1066070 - I don't think either popup notifications nor addon install stuff works on mulet?
 [browser_bug555224.js]
 [browser_bug555767.js]
-[browser_bug556061.js]
 [browser_bug559991.js]
 [browser_bug561636.js]
-[browser_bug562649.js]
 [browser_bug563588.js]
 [browser_bug565575.js]
 [browser_bug565667.js]
 skip-if = toolkit != "cocoa"
 [browser_bug567306.js]
 [browser_bug575561.js]
 [browser_bug575830.js]
 [browser_bug577121.js]
@@ -248,17 +227,16 @@ skip-if = toolkit != "cocoa"
 [browser_bug585830.js]
 [browser_bug590206.js]
 [browser_bug592338.js]
 [browser_bug594131.js]
 [browser_bug595507.js]
 [browser_bug596687.js]
 [browser_bug597218.js]
 [browser_bug609700.js]
-[browser_bug623155.js]
 [browser_bug623893.js]
 [browser_bug624734.js]
 [browser_bug633691.js]
 [browser_bug647886.js]
 skip-if = buildapp == 'mulet'
 [browser_bug655584.js]
 [browser_bug664672.js]
 [browser_bug676619.js]
@@ -268,17 +246,16 @@ skip-if = os == "mac" # Bug 1102331 - do
 [browser_bug710878.js]
 [browser_bug719271.js]
 [browser_bug724239.js]
 [browser_bug734076.js]
 [browser_bug735471.js]
 [browser_bug749738.js]
 [browser_bug763468_perwindowpb.js]
 [browser_bug767836_perwindowpb.js]
-[browser_bug783614.js]
 [browser_bug817947.js]
 [browser_bug822367.js]
 tags = mcb
 [browser_bug832435.js]
 [browser_bug839103.js]
 [browser_bug880101.js]
 [browser_bug882977.js]
 [browser_bug902156.js]
@@ -289,19 +266,17 @@ skip-if = buildapp == "mulet" || e10s # 
 [browser_mixedContentFromOnunload.js]
 tags = mcb
 [browser_mixedContentFramesOnHttp.js]
 tags = mcb
 [browser_bug970746.js]
 [browser_bug1015721.js]
 skip-if = os == 'win'
 [browser_bug1064280_changeUrlInPinnedTab.js]
-[browser_bug1070778.js]
 [browser_accesskeys.js]
-[browser_canonizeURL.js]
 [browser_clipboard.js]
 [browser_contentAreaClick.js]
 [browser_contextmenu.js]
 tags = fullscreen
 skip-if = toolkit == "gtk2" || toolkit == "gtk3" # disabled on Linux due to bug 513558
 [browser_contextmenu_input.js]
 skip-if = toolkit == "gtk2" || toolkit == "gtk3" # disabled on Linux due to bug 513558
 [browser_ctrlTab.js]
@@ -340,19 +315,16 @@ skip-if = buildapp == 'mulet'
 [browser_identity_UI.js]
 [browser_insecureLoginForms.js]
 [browser_invalid_uri_back_forward_manipulation.js]
 [browser_keywordBookmarklets.js]
 [browser_keywordSearch.js]
 [browser_keywordSearch_postData.js]
 [browser_lastAccessedTab.js]
 skip-if = toolkit == "windows" # Disabled on Windows due to frequent failures (bug 969405)
-[browser_locationBarCommand.js]
-skip-if = os == "linux" # Linux: Intermittent failures, bug 917535
-[browser_locationBarExternalLoad.js]
 [browser_menuButtonFitts.js]
 skip-if = os != "win" # The Fitts Law menu button is only supported on Windows (bug 969376)
 [browser_middleMouse_noJSPaste.js]
 [browser_minimize.js]
 [browser_misused_characters_in_strings.js]
 [browser_mixedcontent_securityflags.js]
 tags = mcb
 [browser_offlineQuotaNotification.js]
@@ -394,17 +366,16 @@ support-files =
   refresh_header.sjs
   refresh_meta.sjs
 [browser_relatedTabs.js]
 [browser_remoteTroubleshoot.js]
 support-files =
   test_remoteTroubleshoot.html
 [browser_remoteWebNavigation_postdata.js]
 [browser_removeTabsToTheEnd.js]
-[browser_removeUnsafeProtocolsFromURLBarPaste.js]
 [browser_restore_isAppTab.js]
 [browser_sanitize-passwordDisabledHosts.js]
 [browser_sanitize-sitepermissions.js]
 [browser_sanitize-timespans.js]
 skip-if = buildapp == 'mulet'
 [browser_sanitizeDialog.js]
 skip-if = buildapp == 'mulet'
 [browser_save_link-perwindowpb.js]
@@ -428,19 +399,16 @@ run-if = e10s
 [browser_star_hsts.js]
 [browser_subframe_favicons_not_used.js]
 [browser_syncui.js]
 [browser_tab_close_dependent_window.js]
 [browser_tabDrop.js]
 skip-if = buildapp == 'mulet'
 [browser_tabReorder.js]
 skip-if = buildapp == 'mulet'
-[browser_tabMatchesInAwesomebar.js]
-[browser_tabMatchesInAwesomebar_perwindowpb.js]
-skip-if = os == 'linux' # Bug 1104755
 [browser_tab_detach_restore.js]
 [browser_tab_drag_drop_perwindow.js]
 skip-if = buildapp == 'mulet'
 [browser_tab_dragdrop.js]
 skip-if = buildapp == 'mulet' || (e10s && debug) # Bug 1150036: In e10s, content process crashes, main process leaks!
 [browser_tab_dragdrop2.js]
 skip-if = buildapp == 'mulet'
 [browser_tabbar_big_widgets.js]
@@ -488,60 +456,37 @@ support-files =
 [browser_trackingUI_telemetry.js]
 tags = trackingprotection
 support-files =
   trackingPage.html
 [browser_typeAheadFind.js]
 skip-if = buildapp == 'mulet'
 [browser_unknownContentType_title.js]
 [browser_unloaddialogs.js]
-[browser_urlHighlight.js]
-[browser_urlbarAutoFillTrimURLs.js]
-[browser_urlbarCopying.js]
-[browser_urlbarDecode.js]
-[browser_urlbarDelete.js]
-[browser_urlbarEnter.js]
-[browser_urlbarEnterAfterMouseOver.js]
-skip-if = os == "linux" # Bug 1073339 - Investigate autocomplete test unreliability on Linux/e10s
-[browser_urlbarRevert.js]
-[browser_urlbarSearchSingleWordNotification.js]
-[browser_urlbarSearchSuggestions.js]
-[browser_urlbarSearchSuggestionsNotification.js]
-[browser_urlbarSearchTelemetry.js]
-[browser_urlbarStop.js]
-[browser_urlbarTrimURLs.js]
-[browser_urlbar_autoFill_backspaced.js]
-[browser_urlbar_searchsettings.js]
 [browser_utilityOverlay.js]
 [browser_viewSourceInTabOnViewSource.js]
 [browser_visibleFindSelection.js]
 [browser_visibleTabs.js]
 [browser_visibleTabs_bookmarkAllPages.js]
 skip-if = true # Bug 1005420 - fails intermittently. also with e10s enabled: bizarre problem with hidden tab having _mouseenter called, via _setPositionalAttributes, and tab not being found resulting in 'candidate is undefined'
 [browser_visibleTabs_bookmarkAllTabs.js]
 [browser_visibleTabs_contextMenu.js]
 [browser_visibleTabs_tabPreview.js]
 skip-if = (os == "win" && !debug)
 [browser_web_channel.js]
 [browser_windowopen_reflows.js]
 skip-if = buildapp == 'mulet'
-[browser_wyciwyg_urlbarCopying.js]
 [browser_zbug569342.js]
 skip-if = e10s # Bug 1094240 - has findbar-related failures
 [browser_registerProtocolHandler_notification.js]
 [browser_no_mcb_on_http_site.js]
 tags = mcb
-[browser_bug1104165-switchtab-decodeuri.js]
-[browser_bug1003461-switchtab-override.js]
-[browser_bug1024133-switchtab-override-keynav.js]
-[browser_bug1025195_switchToTabHavingURI_aOpenParams.js]
 [browser_addCertException.js]
 [browser_bug1045809.js]
 tags = mcb
-[browser_bug1225194-remotetab.js]
 [browser_e10s_switchbrowser.js]
 [browser_e10s_about_process.js]
 [browser_e10s_chrome_process.js]
 [browser_e10s_javascript.js]
 [browser_blockHPKP.js]
 tags = psm
 [browser_mcb_redirect.js]
 tags = mcb
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -923,25 +923,16 @@ function assertMixedContentBlockingState
 
   // Wait for the panel to be closed before continuing. The promisePopupHidden
   // function cannot be used because it's unreliable unless promisePopupShown is
   // also called before closing the panel. This cannot be done until all callers
   // are made asynchronous (bug 1221114).
   return new Promise(resolve => executeSoon(resolve));
 }
 
-function makeActionURI(action, params) {
-  let encodedParams = {};
-  for (let key in params) {
-    encodedParams[key] = encodeURIComponent(params[key]);
-  }
-  let url = "moz-action:" + action + "," + JSON.stringify(encodedParams);
-  return NetUtil.newURI(url);
-}
-
 function is_hidden(element) {
   var style = element.ownerDocument.defaultView.getComputedStyle(element, "");
   if (style.display == "none")
     return true;
   if (style.visibility != "visible")
     return true;
   if (style.display == "-moz-popup")
     return ["hiding","closed"].indexOf(element.state) != -1;
@@ -1008,38 +999,16 @@ function promiseNotificationShown(notifi
   if (win.PopupNotifications.panel.state == "open") {
     return Promise.resolved();
   }
   let panelPromise = promisePopupShown(win.PopupNotifications.panel);
   notification.reshow();
   return panelPromise;
 }
 
-function promiseSearchComplete(win = window) {
-  return promisePopupShown(win.gURLBar.popup).then(() => {
-    function searchIsComplete() {
-      return win.gURLBar.controller.searchStatus >=
-        Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH;
-    }
-
-    // Wait until there are at least two matches.
-    return new Promise(resolve => waitForCondition(searchIsComplete, resolve));
-  });
-}
-
-function promiseAutocompleteResultPopup(inputText, win = window) {
-  waitForFocus(() => {
-    win.gURLBar.focus();
-    win.gURLBar.value = inputText;
-    win.gURLBar.controller.startSearch(inputText);
-  }, win);
-
-  return promiseSearchComplete(win);
-}
-
 /**
  * Allows waiting for an observer notification once.
  *
  * @param aTopic
  *        Notification topic to observe.
  *
  * @return {Promise}
  * @resolves An object with subject and data properties from the observed
rename from browser/base/content/test/general/authenticate.sjs
rename to browser/base/content/test/urlbar/authenticate.sjs
--- a/browser/base/content/test/urlbar/browser.ini
+++ b/browser/base/content/test/urlbar/browser.ini
@@ -1,7 +1,81 @@
+[DEFAULT]
+support-files =
+  dummy_page.html
+  head.js
+
+[browser_URLBarSetURI.js]
+skip-if = (os == "linux" || os == "mac") && debug # bug 970052, bug 970053
+[browser_action_keyword.js]
+[browser_action_keyword_override.js]
+[browser_action_searchengine.js]
+[browser_action_searchengine_alias.js]
+[browser_autocomplete_a11y_label.js]
+[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_oldschool_wrap.js]
+[browser_autocomplete_tag_star_visibility.js]
+[browser_bug1104165-switchtab-decodeuri.js]
+[browser_bug1003461-switchtab-override.js]
+[browser_bug1024133-switchtab-override-keynav.js]
+[browser_bug1025195_switchToTabHavingURI_aOpenParams.js]
+[browser_bug1070778.js]
+[browser_bug1225194-remotetab.js]
+[browser_bug304198.js]
+[browser_bug556061.js]
+[browser_bug562649.js]
+[browser_bug623155.js]
+support-files =
+  redirect_bug623155.sjs
+[browser_bug783614.js]
+[browser_canonizeURL.js]
+[browser_locationBarCommand.js]
+skip-if = os == "linux" # Linux: Intermittent failures, bug 917535
+[browser_locationBarExternalLoad.js]
 [browser_moz_action_link.js]
+[browser_removeUnsafeProtocolsFromURLBarPaste.js]
+[browser_search_favicon.js]
+[browser_tabMatchesInAwesomebar.js]
+support-files =
+  moz.png
+[browser_tabMatchesInAwesomebar_perwindowpb.js]
+skip-if = os == 'linux' # Bug 1104755
+[browser_urlbarAutoFillTrimURLs.js]
+[browser_urlbarCopying.js]
+support-files =
+  authenticate.sjs
+[browser_urlbarDecode.js]
+[browser_urlbarDelete.js]
+[browser_urlbarEnter.js]
+[browser_urlbarEnterAfterMouseOver.js]
+skip-if = os == "linux" # Bug 1073339 - Investigate autocomplete test unreliability on Linux/e10s
+[browser_urlbarRevert.js]
+[browser_urlbarSearchSingleWordNotification.js]
+[browser_urlbarSearchSuggestions.js]
+support-files =
+  searchSuggestionEngine.xml
+  searchSuggestionEngine.sjs
+[browser_urlbarSearchSuggestionsNotification.js]
+support-files =
+  searchSuggestionEngine.xml
+  searchSuggestionEngine.sjs
+[browser_urlbarSearchTelemetry.js]
+support-files =
+  searchSuggestionEngine.xml
+  searchSuggestionEngine.sjs
+[browser_urlbarStop.js]
+[browser_urlbarTrimURLs.js]
+[browser_urlbar_autoFill_backspaced.js]
 [browser_urlbar_blanking.js]
 support-files =
   file_blank_but_not_blank.html
+[browser_urlbar_searchsettings.js]
 [browser_urlbar_stop_pending.js]
 support-files =
   slow-page.sjs
+[browser_urlHighlight.js]
+[browser_wyciwyg_urlbarCopying.js]
+support-files =
+  test_wyciwyg_copying.html
rename from browser/base/content/test/general/browser_URLBarSetURI.js
rename to browser/base/content/test/urlbar/browser_URLBarSetURI.js
--- a/browser/base/content/test/general/browser_URLBarSetURI.js
+++ b/browser/base/content/test/urlbar/browser_URLBarSetURI.js
@@ -32,29 +32,27 @@ var tests = [
     loadTabInWindow(window, function (tab) {
       gURLBar.handleRevert();
       is(gURLBar.textValue, "example.com", "URL bar had user/pass stripped after reverting");
       gBrowser.removeTab(tab);
       next();
     });
   },
   function customize(next) {
-    whenNewWindowLoaded(undefined, function (win) {
-      // Need to wait for delayedStartup for the customization part of the test,
-      // since that's where BrowserToolboxCustomizeDone is set.
-      whenDelayedStartupFinished(win, function () {
-        loadTabInWindow(win, function () {
-          openToolbarCustomizationUI(function () {
-            closeToolbarCustomizationUI(function () {
-              is(win.gURLBar.textValue, "example.com", "URL bar had user/pass stripped after customize");
-              win.close();
-              next();
-            }, win);
+    // Need to wait for delayedStartup for the customization part of the test,
+    // since that's where BrowserToolboxCustomizeDone is set.
+    BrowserTestUtils.openNewBrowserWindow().then(function(win) {
+      loadTabInWindow(win, function () {
+        openToolbarCustomizationUI(function () {
+          closeToolbarCustomizationUI(function () {
+            is(win.gURLBar.textValue, "example.com", "URL bar had user/pass stripped after customize");
+            win.close();
+            next();
           }, win);
-        });
+        }, win);
       });
     });
   },
   function pageloaderror(next) {
     loadTabInWindow(window, function (tab) {
       // Load a new URL and then immediately stop it, to simulate a page load
       // error.
       tab.linkedBrowser.loadURI("http://test1.example.com");
@@ -71,8 +69,32 @@ function loadTabInWindow(win, callback) 
   let url = "http://user:pass@example.com/";
   let tab = win.gBrowser.selectedTab = win.gBrowser.addTab(url);
   BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, url).then(() => {
     info("Tab loaded");
     is(win.gURLBar.textValue, "example.com", "URL bar had user/pass stripped initially");
     callback(tab);
   }, true);
 }
+
+function openToolbarCustomizationUI(aCallback, aBrowserWin) {
+  if (!aBrowserWin)
+    aBrowserWin = window;
+
+  aBrowserWin.gCustomizeMode.enter();
+
+  aBrowserWin.gNavToolbox.addEventListener("customizationready", function UI_loaded() {
+    aBrowserWin.gNavToolbox.removeEventListener("customizationready", UI_loaded);
+    executeSoon(function() {
+      aCallback(aBrowserWin)
+    });
+  });
+}
+
+function closeToolbarCustomizationUI(aCallback, aBrowserWin) {
+  aBrowserWin.gNavToolbox.addEventListener("aftercustomization", function unloaded() {
+    aBrowserWin.gNavToolbox.removeEventListener("aftercustomization", unloaded);
+    executeSoon(aCallback);
+  });
+
+  aBrowserWin.gCustomizeMode.exit();
+}
+
rename from browser/base/content/test/general/browser_action_keyword.js
rename to browser/base/content/test/urlbar/browser_action_keyword.js
--- a/browser/base/content/test/general/browser_action_keyword.js
+++ b/browser/base/content/test/urlbar/browser_action_keyword.js
@@ -74,16 +74,16 @@ add_task(function*() {
   info("Middle-click on result");
   result = yield promise_first_result("keyword somethingmore");
   isnot(result, null, "Expect a keyword result");
   // We need to make a real URI out of this to ensure it's normalised for
   // comparison.
   uri = NetUtil.newURI(result.getAttribute("url"));
   is(uri.spec, makeActionURI("keyword", {url: "http://example.com/?q=somethingmore", input: "keyword somethingmore"}).spec, "Expect correct url");
 
-  tabPromise = promiseWaitForEvent(gBrowser.tabContainer, "TabOpen");
+  tabPromise = BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "TabOpen");
   EventUtils.synthesizeMouseAtCenter(result, {button: 1});
   let tabOpenEvent = yield tabPromise;
   let newTab = tabOpenEvent.target;
   tabs.push(newTab);
   yield promiseTabLoadEvent(newTab);
   is(newTab.linkedBrowser.currentURI.spec, "http://example.com/?q=somethingmore", "Tab should have loaded from middle-clicking on result");
 });
rename from browser/base/content/test/general/browser_action_keyword_override.js
rename to browser/base/content/test/urlbar/browser_action_keyword_override.js
rename from browser/base/content/test/general/browser_action_searchengine.js
rename to browser/base/content/test/urlbar/browser_action_searchengine.js
rename from browser/base/content/test/general/browser_action_searchengine_alias.js
rename to browser/base/content/test/urlbar/browser_action_searchengine_alias.js
rename from browser/base/content/test/general/browser_autocomplete_a11y_label.js
rename to browser/base/content/test/urlbar/browser_autocomplete_a11y_label.js
rename from browser/base/content/test/general/browser_autocomplete_autoselect.js
rename to browser/base/content/test/urlbar/browser_autocomplete_autoselect.js
rename from browser/base/content/test/general/browser_autocomplete_cursor.js
rename to browser/base/content/test/urlbar/browser_autocomplete_cursor.js
rename from browser/base/content/test/general/browser_autocomplete_edit_completed.js
rename to browser/base/content/test/urlbar/browser_autocomplete_edit_completed.js
rename from browser/base/content/test/general/browser_autocomplete_enter_race.js
rename to browser/base/content/test/urlbar/browser_autocomplete_enter_race.js
rename from browser/base/content/test/general/browser_autocomplete_no_title.js
rename to browser/base/content/test/urlbar/browser_autocomplete_no_title.js
rename from browser/base/content/test/general/browser_autocomplete_oldschool_wrap.js
rename to browser/base/content/test/urlbar/browser_autocomplete_oldschool_wrap.js
rename from browser/base/content/test/general/browser_autocomplete_tag_star_visibility.js
rename to browser/base/content/test/urlbar/browser_autocomplete_tag_star_visibility.js
rename from browser/base/content/test/general/browser_bug1003461-switchtab-override.js
rename to browser/base/content/test/urlbar/browser_bug1003461-switchtab-override.js
--- a/browser/base/content/test/general/browser_bug1003461-switchtab-override.js
+++ b/browser/base/content/test/urlbar/browser_bug1003461-switchtab-override.js
@@ -5,17 +5,17 @@
 add_task(function* test_switchtab_override() {
   // This test is only relevant if UnifiedComplete is enabled.
   let ucpref = Services.prefs.getBoolPref("browser.urlbar.unifiedcomplete");
   Services.prefs.setBoolPref("browser.urlbar.unifiedcomplete", true);
   registerCleanupFunction(() => {
     Services.prefs.setBoolPref("browser.urlbar.unifiedcomplete", ucpref);
   });
 
-  let testURL = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
+  let testURL = "http://example.org/browser/browser/base/content/test/urlbar/dummy_page.html";
 
   info("Opening first tab");
   let tab = gBrowser.addTab(testURL);
   let deferred = Promise.defer();
   whenTabLoaded(tab, deferred.resolve);
   yield deferred.promise;
 
   info("Opening and selecting second tab");
rename from browser/base/content/test/general/browser_bug1024133-switchtab-override-keynav.js
rename to browser/base/content/test/urlbar/browser_bug1024133-switchtab-override-keynav.js
--- a/browser/base/content/test/general/browser_bug1024133-switchtab-override-keynav.js
+++ b/browser/base/content/test/urlbar/browser_bug1024133-switchtab-override-keynav.js
@@ -1,14 +1,14 @@
 /* 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/. */
 
 add_task(function* test_switchtab_override_keynav() {
-  let testURL = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
+  let testURL = "http://example.org/browser/browser/base/content/test/urlbar/dummy_page.html";
 
   info("Opening first tab");
   let tab = gBrowser.addTab(testURL);
   let tabLoadDeferred = Promise.defer();
   whenTabLoaded(tab, tabLoadDeferred.resolve);
   yield tabLoadDeferred.promise;
 
   info("Opening and selecting second tab");
rename from browser/base/content/test/general/browser_bug1025195_switchToTabHavingURI_aOpenParams.js
rename to browser/base/content/test/urlbar/browser_bug1025195_switchToTabHavingURI_aOpenParams.js
rename from browser/base/content/test/general/browser_bug1070778.js
rename to browser/base/content/test/urlbar/browser_bug1070778.js
rename from browser/base/content/test/general/browser_bug1104165-switchtab-decodeuri.js
rename to browser/base/content/test/urlbar/browser_bug1104165-switchtab-decodeuri.js
--- a/browser/base/content/test/general/browser_bug1104165-switchtab-decodeuri.js
+++ b/browser/base/content/test/urlbar/browser_bug1104165-switchtab-decodeuri.js
@@ -1,11 +1,11 @@
 add_task(function* test_switchtab_decodeuri() {
   info("Opening first tab");
-  let tab = gBrowser.addTab("http://example.org/browser/browser/base/content/test/general/dummy_page.html#test%7C1");
+  let tab = gBrowser.addTab("http://example.org/browser/browser/base/content/test/urlbar/dummy_page.html#test%7C1");
   yield promiseTabLoadEvent(tab);
 
   info("Opening and selecting second tab");
   let newTab = gBrowser.selectedTab = gBrowser.addTab();
 
   info("Wait for autocomplete")
   yield promiseAutocompleteResultPopup("dummy_page");
 
rename from browser/base/content/test/general/browser_bug1225194-remotetab.js
rename to browser/base/content/test/urlbar/browser_bug1225194-remotetab.js
--- a/browser/base/content/test/general/browser_bug1225194-remotetab.js
+++ b/browser/base/content/test/urlbar/browser_bug1225194-remotetab.js
@@ -1,10 +1,10 @@
 add_task(function* test_remotetab_opens() {
-  const url = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
+  const url = "http://example.org/browser/browser/base/content/test/urlbar/dummy_page.html";
   yield BrowserTestUtils.withNewTab({url: "about:robots", gBrowser}, function* () {
     // Set the urlbar to include the moz-action
     gURLBar.value = "moz-action:remotetab," + JSON.stringify({ url });
     // Focus the urlbar so we can press enter
     gURLBar.focus();
 
     // The URL is going to open in the current tab as it is currently about:blank
     let promiseTabLoaded = promiseTabLoadEvent(gBrowser.selectedTab);
rename from browser/base/content/test/general/browser_bug304198.js
rename to browser/base/content/test/urlbar/browser_bug304198.js
--- a/browser/base/content/test/general/browser_bug304198.js
+++ b/browser/base/content/test/urlbar/browser_bug304198.js
@@ -4,17 +4,17 @@
 
 add_task(function* () {
   let charsToDelete, deletedURLTab, fullURLTab, partialURLTab, testPartialURL, testURL;
 
   charsToDelete = 5;
   deletedURLTab = gBrowser.addTab();
   fullURLTab = gBrowser.addTab();
   partialURLTab = gBrowser.addTab();
-  testURL = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
+  testURL = "http://example.org/browser/browser/base/content/test/urlbar/dummy_page.html";
 
   let loaded1 = BrowserTestUtils.browserLoaded(deletedURLTab.linkedBrowser, testURL);
   let loaded2 = BrowserTestUtils.browserLoaded(fullURLTab.linkedBrowser, testURL);
   let loaded3 = BrowserTestUtils.browserLoaded(partialURLTab.linkedBrowser, testURL);
   deletedURLTab.linkedBrowser.loadURI(testURL);
   fullURLTab.linkedBrowser.loadURI(testURL);
   partialURLTab.linkedBrowser.loadURI(testURL);
   yield Promise.all([loaded1, loaded2, loaded3]);
rename from browser/base/content/test/general/browser_bug556061.js
rename to browser/base/content/test/urlbar/browser_bug556061.js
--- a/browser/base/content/test/general/browser_bug556061.js
+++ b/browser/base/content/test/urlbar/browser_bug556061.js
@@ -1,13 +1,13 @@
 /* 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/. */
 
-var testURL = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
+var testURL = "http://example.org/browser/browser/base/content/test/urlbar/dummy_page.html";
 var testActionURL = "moz-action:switchtab," + JSON.stringify({url: testURL});
 testURL = gURLBar.trimValue(testURL);
 var testTab;
 
 function runNextTest() {
   if (tests.length) {
     let t = tests.shift();
     waitForClipboard(t.expected, t.setup, function() {
rename from browser/base/content/test/general/browser_bug562649.js
rename to browser/base/content/test/urlbar/browser_bug562649.js
rename from browser/base/content/test/general/browser_bug623155.js
rename to browser/base/content/test/urlbar/browser_bug623155.js
--- a/browser/base/content/test/general/browser_bug623155.js
+++ b/browser/base/content/test/urlbar/browser_bug623155.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-const REDIRECT_FROM = "https://example.com/browser/browser/base/content/test/general/" +
+const REDIRECT_FROM = "https://example.com/browser/browser/base/content/test/urlbar/" +
                       "redirect_bug623155.sjs";
 
 const REDIRECT_TO = "https://www.bank1.com/"; // Bad-cert host.
 
 function isRedirectedURISpec(aURISpec) {
   return isRedirectedURI(Services.io.newURI(aURISpec, null, null));
 }
 
@@ -15,28 +15,28 @@ function isRedirectedURI(aURI) {
   return Services.io.newURI(REDIRECT_TO, null, null)
                  .equalsExceptRef(aURI);
 }
 
 /*
    Test.
 
 1. Load
-https://example.com/browser/browser/base/content/test/general/redirect_bug623155.sjs#BG
+https://example.com/browser/browser/base/content/test/urlbar/redirect_bug623155.sjs#BG
    in a background tab.
 
 2. The redirected URI is <https://www.bank1.com/#BG>, which displayes a cert
    error page.
 
 3. Switch the tab to foreground.
 
 4. Check the URLbar's value, expecting <https://www.bank1.com/#BG>
 
 5. Load
-https://example.com/browser/browser/base/content/test/general/redirect_bug623155.sjs#FG
+https://example.com/browser/browser/base/content/test/urlbar/redirect_bug623155.sjs#FG
    in the foreground tab.
 
 6. The redirected URI is <https://www.bank1.com/#FG>. And this is also
    a cert-error page.
 
 7. Check the URLbar's value, expecting <https://www.bank1.com/#FG>
 
 8. End.
rename from browser/base/content/test/general/browser_bug783614.js
rename to browser/base/content/test/urlbar/browser_bug783614.js
rename from browser/base/content/test/general/browser_canonizeURL.js
rename to browser/base/content/test/urlbar/browser_canonizeURL.js
rename from browser/base/content/test/general/browser_locationBarCommand.js
rename to browser/base/content/test/urlbar/browser_locationBarCommand.js
--- a/browser/base/content/test/general/browser_locationBarCommand.js
+++ b/browser/base/content/test/urlbar/browser_locationBarCommand.js
@@ -30,17 +30,17 @@ add_task(function* alt_left_click_test()
   yield saveURLPromise;
   ok(true, "SaveURL was called");
   is(gURLBar.value, "", "Urlbar reverted to original value");
 });
 
 add_task(function* shift_left_click_test() {
   info("Running test: Shift left click");
 
-  let newWindowPromise = promiseWaitForNewWindow();
+  let newWindowPromise = BrowserTestUtils.waitForNewWindow();
   triggerCommand(true, {shiftKey: true});
   let win = yield newWindowPromise;
 
   // Wait for the initial browser to load.
   let browser = win.gBrowser.selectedBrowser;
   yield BrowserTestUtils.browserLoaded(browser);
 
   info("URL should be loaded in a new window");
@@ -194,35 +194,16 @@ function promiseNewTabSwitched() {
   return new Promise(resolve => {
     gBrowser.addEventListener("TabSwitchDone", function onSwitch() {
       gBrowser.removeEventListener("TabSwitchDone", onSwitch);
       executeSoon(resolve);
     });
   });
 }
 
-function promiseWaitForNewWindow() {
-  return new Promise(resolve => {
-    let listener = {
-      onOpenWindow(xulWindow) {
-        let win = xulWindow.QueryInterface(Ci.nsIInterfaceRequestor)
-                           .getInterface(Ci.nsIDOMWindow);
-
-        Services.wm.removeListener(listener);
-        whenDelayedStartupFinished(win, () => resolve(win));
-      },
-
-      onCloseWindow() {},
-      onWindowTitleChange() {}
-    };
-
-    Services.wm.addListener(listener);
-  });
-}
-
 function promiseCheckChildNoFocusedElement(browser)
 {
   if (!gMultiProcessBrowser) {
     Assert.equal(Services.focus.focusedElement, null, "There should be no focused element");
     return;
   }
 
   return ContentTask.spawn(browser, { }, function* () {
rename from browser/base/content/test/general/browser_locationBarExternalLoad.js
rename to browser/base/content/test/urlbar/browser_locationBarExternalLoad.js
rename from browser/base/content/test/general/browser_removeUnsafeProtocolsFromURLBarPaste.js
rename to browser/base/content/test/urlbar/browser_removeUnsafeProtocolsFromURLBarPaste.js
rename from browser/base/content/test/general/browser_search_favicon.js
rename to browser/base/content/test/urlbar/browser_search_favicon.js
rename from browser/base/content/test/general/browser_tabMatchesInAwesomebar.js
rename to browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar.js
--- a/browser/base/content/test/general/browser_tabMatchesInAwesomebar.js
+++ b/browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar.js
@@ -2,18 +2,18 @@
  * vim:set ts=2 sw=2 sts=2 et:
  * 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/. */
 
 requestLongerTimeout(2);
 
 const TEST_URL_BASES = [
-  "http://example.org/browser/browser/base/content/test/general/dummy_page.html#tabmatch",
-  "http://example.org/browser/browser/base/content/test/general/moz.png#tabmatch"
+  "http://example.org/browser/browser/base/content/test/urlbar/dummy_page.html#tabmatch",
+  "http://example.org/browser/browser/base/content/test/urlbar/moz.png#tabmatch"
 ];
 
 var gController = Cc["@mozilla.org/autocomplete/controller;1"].
                   getService(Ci.nsIAutoCompleteController);
 
 var gTabWaitCount = 0;
 var gTabCounter = 0;
 
rename from browser/base/content/test/general/browser_tabMatchesInAwesomebar_perwindowpb.js
rename to browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar_perwindowpb.js
--- a/browser/base/content/test/general/browser_tabMatchesInAwesomebar_perwindowpb.js
+++ b/browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar_perwindowpb.js
@@ -1,9 +1,9 @@
-let testURL = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
+let testURL = "http://example.org/browser/browser/base/content/test/urlbar/dummy_page.html";
 
 add_task(function*() {
   let normalWindow = yield BrowserTestUtils.openNewBrowserWindow();
   let privateWindow = yield BrowserTestUtils.openNewBrowserWindow({private: true});
   yield runTest(normalWindow, privateWindow, false);
   yield BrowserTestUtils.closeWindow(normalWindow);
   yield BrowserTestUtils.closeWindow(privateWindow);
 
@@ -22,17 +22,17 @@ add_task(function*() {
   yield BrowserTestUtils.closeWindow(normalWindow);
 });
 
 function* runTest(aSourceWindow, aDestWindow, aExpectSwitch, aCallback) {
   let baseTab = yield BrowserTestUtils.openNewForegroundTab(aSourceWindow.gBrowser, testURL);
   let testTab = yield BrowserTestUtils.openNewForegroundTab(aDestWindow.gBrowser);
 
   info("waiting for focus on the window");
-  yield promiseWaitForFocus(aDestWindow);
+  yield SimpleTest.promiseFocus(aDestWindow);
   info("got focus on the window");
 
   // Select the testTab
   aDestWindow.gBrowser.selectedTab = testTab;
 
   // Ensure that this tab has no history entries
   let sessionHistoryCount = yield new Promise(resolve => {
     SessionStore.getSessionHistory(gBrowser.selectedTab, function(sessionHistory) {
rename from browser/base/content/test/general/browser_urlHighlight.js
rename to browser/base/content/test/urlbar/browser_urlHighlight.js
rename from browser/base/content/test/general/browser_urlbarAutoFillTrimURLs.js
rename to browser/base/content/test/urlbar/browser_urlbarAutoFillTrimURLs.js
rename from browser/base/content/test/general/browser_urlbarCopying.js
rename to browser/base/content/test/urlbar/browser_urlbarCopying.js
--- a/browser/base/content/test/general/browser_urlbarCopying.js
+++ b/browser/base/content/test/urlbar/browser_urlbarCopying.js
@@ -65,19 +65,19 @@ var tests = [
   },
   {
     copyVal: "<example>.com/foo",
     copyExpected: "example"
   },
 
   // Test that userPass is stripped out
   {
-    loadURL: "http://user:pass@mochi.test:8888/browser/browser/base/content/test/general/authenticate.sjs?user=user&pass=pass",
-    expectedURL: "mochi.test:8888/browser/browser/base/content/test/general/authenticate.sjs?user=user&pass=pass",
-    copyExpected: "http://mochi.test:8888/browser/browser/base/content/test/general/authenticate.sjs?user=user&pass=pass"
+    loadURL: "http://user:pass@mochi.test:8888/browser/browser/base/content/test/urlbar/authenticate.sjs?user=user&pass=pass",
+    expectedURL: "mochi.test:8888/browser/browser/base/content/test/urlbar/authenticate.sjs?user=user&pass=pass",
+    copyExpected: "http://mochi.test:8888/browser/browser/base/content/test/urlbar/authenticate.sjs?user=user&pass=pass"
   },
 
   // Test escaping
   {
     loadURL: "http://example.com/()%28%29%C3%A9",
     expectedURL: "example.com/()()\xe9",
     copyExpected: "http://example.com/()%28%29%C3%A9"
   },
rename from browser/base/content/test/general/browser_urlbarDecode.js
rename to browser/base/content/test/urlbar/browser_urlbarDecode.js
rename from browser/base/content/test/general/browser_urlbarDelete.js
rename to browser/base/content/test/urlbar/browser_urlbarDelete.js
rename from browser/base/content/test/general/browser_urlbarEnter.js
rename to browser/base/content/test/urlbar/browser_urlbarEnter.js
rename from browser/base/content/test/general/browser_urlbarEnterAfterMouseOver.js
rename to browser/base/content/test/urlbar/browser_urlbarEnterAfterMouseOver.js
rename from browser/base/content/test/general/browser_urlbarRevert.js
rename to browser/base/content/test/urlbar/browser_urlbarRevert.js
rename from browser/base/content/test/general/browser_urlbarSearchSingleWordNotification.js
rename to browser/base/content/test/urlbar/browser_urlbarSearchSingleWordNotification.js
rename from browser/base/content/test/general/browser_urlbarSearchSuggestions.js
rename to browser/base/content/test/urlbar/browser_urlbarSearchSuggestions.js
rename from browser/base/content/test/general/browser_urlbarSearchSuggestionsNotification.js
rename to browser/base/content/test/urlbar/browser_urlbarSearchSuggestionsNotification.js
rename from browser/base/content/test/general/browser_urlbarSearchTelemetry.js
rename to browser/base/content/test/urlbar/browser_urlbarSearchTelemetry.js
rename from browser/base/content/test/general/browser_urlbarStop.js
rename to browser/base/content/test/urlbar/browser_urlbarStop.js
rename from browser/base/content/test/general/browser_urlbarTrimURLs.js
rename to browser/base/content/test/urlbar/browser_urlbarTrimURLs.js
rename from browser/base/content/test/general/browser_urlbar_autoFill_backspaced.js
rename to browser/base/content/test/urlbar/browser_urlbar_autoFill_backspaced.js
rename from browser/base/content/test/general/browser_urlbar_searchsettings.js
rename to browser/base/content/test/urlbar/browser_urlbar_searchsettings.js
rename from browser/base/content/test/general/browser_wyciwyg_urlbarCopying.js
rename to browser/base/content/test/urlbar/browser_wyciwyg_urlbarCopying.js
--- a/browser/base/content/test/general/browser_wyciwyg_urlbarCopying.js
+++ b/browser/base/content/test/urlbar/browser_wyciwyg_urlbarCopying.js
@@ -12,17 +12,17 @@ function testURLBarCopy(targetValue) {
     }, resolve, () => {
       ok(false, "Clipboard copy failed");
       reject();
     });
   });
 }
 
 add_task(function* () {
-  const url = "http://mochi.test:8888/browser/browser/base/content/test/general/test_wyciwyg_copying.html";
+  const url = "http://mochi.test:8888/browser/browser/base/content/test/urlbar/test_wyciwyg_copying.html";
   let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, url);
 
   yield BrowserTestUtils.synthesizeMouseAtCenter("#btn", {}, tab.linkedBrowser);
   let currentURL = gBrowser.currentURI.spec;
   ok(/^wyciwyg:\/\//i.test(currentURL), currentURL + " is a wyciwyg URI");
 
   yield testURLBarCopy(url);
 
copy from browser/base/content/test/general/dummy_page.html
copy to browser/base/content/test/urlbar/dummy_page.html
copy from browser/base/content/test/general/head.js
copy to browser/base/content/test/urlbar/head.js
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/urlbar/head.js
@@ -6,100 +6,16 @@ XPCOMUtils.defineLazyModuleGetter(this, 
   "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
   "resource://testing-common/PlacesTestUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "TabCrashHandler",
   "resource:///modules/ContentCrashHandlers.jsm");
 
-/**
- * Wait for a <notification> to be closed then call the specified callback.
- */
-function waitForNotificationClose(notification, cb) {
-  let parent = notification.parentNode;
-
-  let observer = new MutationObserver(function onMutatations(mutations) {
-    for (let mutation of mutations) {
-      for (let i = 0; i < mutation.removedNodes.length; i++) {
-        let node = mutation.removedNodes.item(i);
-        if (node != notification) {
-          continue;
-        }
-        observer.disconnect();
-        cb();
-      }
-    }
-  });
-  observer.observe(parent, {childList: true});
-}
-
-function closeAllNotifications () {
-  let notificationBox = document.getElementById("global-notificationbox");
-
-  if (!notificationBox || !notificationBox.currentNotification) {
-    return Promise.resolve();
-  }
-
-  let deferred = Promise.defer();
-  for (let notification of notificationBox.allNotifications) {
-    waitForNotificationClose(notification, function () {
-      if (notificationBox.allNotifications.length === 0) {
-        deferred.resolve();
-      }
-    });
-    notification.close();
-  }
-
-  return deferred.promise;
-}
-
-function whenDelayedStartupFinished(aWindow, aCallback) {
-  Services.obs.addObserver(function observer(aSubject, aTopic) {
-    if (aWindow == aSubject) {
-      Services.obs.removeObserver(observer, aTopic);
-      executeSoon(aCallback);
-    }
-  }, "browser-delayed-startup-finished", false);
-}
-
-function updateTabContextMenu(tab) {
-  let menu = document.getElementById("tabContextMenu");
-  if (!tab)
-    tab = gBrowser.selectedTab;
-  var evt = new Event("");
-  tab.dispatchEvent(evt);
-  menu.openPopup(tab, "end_after", 0, 0, true, false, evt);
-  is(TabContextMenu.contextTab, tab, "TabContextMenu context is the expected tab");
-  menu.hidePopup();
-}
-
-function openToolbarCustomizationUI(aCallback, aBrowserWin) {
-  if (!aBrowserWin)
-    aBrowserWin = window;
-
-  aBrowserWin.gCustomizeMode.enter();
-
-  aBrowserWin.gNavToolbox.addEventListener("customizationready", function UI_loaded() {
-    aBrowserWin.gNavToolbox.removeEventListener("customizationready", UI_loaded);
-    executeSoon(function() {
-      aCallback(aBrowserWin)
-    });
-  });
-}
-
-function closeToolbarCustomizationUI(aCallback, aBrowserWin) {
-  aBrowserWin.gNavToolbox.addEventListener("aftercustomization", function unloaded() {
-    aBrowserWin.gNavToolbox.removeEventListener("aftercustomization", unloaded);
-    executeSoon(aCallback);
-  });
-
-  aBrowserWin.gCustomizeMode.exit();
-}
-
 function waitForCondition(condition, nextTest, errorMsg, retryTimes) {
   retryTimes = typeof retryTimes !== 'undefined' ?  retryTimes : 30;
   var tries = 0;
   var interval = setInterval(function() {
     if (tries >= retryTimes) {
       ok(false, errorMsg);
       moveOn();
     }
@@ -132,112 +48,16 @@ function promiseWaitForEvent(object, eve
       resolve(event);
     }
 
     info("Waiting for " + eventName);
     object.addEventListener(eventName, listener, capturing, chrome);
   });
 }
 
-/**
- * Allows setting focus on a window, and waiting for that window to achieve
- * focus.
- *
- * @param aWindow
- *        The window to focus and wait for.
- *
- * @return {Promise}
- * @resolves When the window is focused.
- * @rejects Never.
- */
-function promiseWaitForFocus(aWindow) {
-  return new Promise((resolve) => {
-    waitForFocus(resolve, aWindow);
-  });
-}
-
-function getTestPlugin(aName) {
-  var pluginName = aName || "Test Plug-in";
-  var ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
-  var tags = ph.getPluginTags();
-
-  // Find the test plugin
-  for (var i = 0; i < tags.length; i++) {
-    if (tags[i].name == pluginName)
-      return tags[i];
-  }
-  ok(false, "Unable to find plugin");
-  return null;
-}
-
-// call this to set the test plugin(s) initially expected enabled state.
-// it will automatically be reset to it's previous value after the test
-// ends
-function setTestPluginEnabledState(newEnabledState, pluginName) {
-  var plugin = getTestPlugin(pluginName);
-  var oldEnabledState = plugin.enabledState;
-  plugin.enabledState = newEnabledState;
-  SimpleTest.registerCleanupFunction(function() {
-    getTestPlugin(pluginName).enabledState = oldEnabledState;
-  });
-}
-
-// after a test is done using the plugin doorhanger, we should just clear
-// any permissions that may have crept in
-function clearAllPluginPermissions() {
-  clearAllPermissionsByPrefix("plugin");
-}
-
-function clearAllPermissionsByPrefix(aPrefix) {
-  let perms = Services.perms.enumerator;
-  while (perms.hasMoreElements()) {
-    let perm = perms.getNext();
-    if (perm.type.startsWith(aPrefix)) {
-      Services.perms.removePermission(perm);
-    }
-  }
-}
-
-function pushPrefs(...aPrefs) {
-  let deferred = Promise.defer();
-  SpecialPowers.pushPrefEnv({"set": aPrefs}, deferred.resolve);
-  return deferred.promise;
-}
-
-function updateBlocklist(aCallback) {
-  var blocklistNotifier = Cc["@mozilla.org/extensions/blocklist;1"]
-                          .getService(Ci.nsITimerCallback);
-  var observer = function() {
-    Services.obs.removeObserver(observer, "blocklist-updated");
-    SimpleTest.executeSoon(aCallback);
-  };
-  Services.obs.addObserver(observer, "blocklist-updated", false);
-  blocklistNotifier.notify(null);
-}
-
-var _originalTestBlocklistURL = null;
-function setAndUpdateBlocklist(aURL, aCallback) {
-  if (!_originalTestBlocklistURL)
-    _originalTestBlocklistURL = Services.prefs.getCharPref("extensions.blocklist.url");
-  Services.prefs.setCharPref("extensions.blocklist.url", aURL);
-  updateBlocklist(aCallback);
-}
-
-function resetBlocklist() {
-  Services.prefs.setCharPref("extensions.blocklist.url", _originalTestBlocklistURL);
-}
-
-function whenNewWindowLoaded(aOptions, aCallback) {
-  let win = OpenBrowserWindow(aOptions);
-  win.addEventListener("load", function onLoad() {
-    win.removeEventListener("load", onLoad, false);
-    aCallback(win);
-  }, false);
-}
-
 function promiseWindowWillBeClosed(win) {
   return new Promise((resolve, reject) => {
     Services.obs.addObserver(function observe(subject, topic) {
       if (subject == win) {
         Services.obs.removeObserver(observe, topic);
         resolve();
       }
     }, "domwindowclosed", false);
@@ -266,71 +86,16 @@ function promiseOpenAndLoadWindow(aOptio
     win.addEventListener("load", function onLoad() {
       win.removeEventListener("load", onLoad);
       deferred.resolve(win);
     });
   }
   return deferred.promise;
 }
 
-/**
- * Waits for all pending async statements on the default connection, before
- * proceeding with aCallback.
- *
- * @param aCallback
- *        Function to be called when done.
- * @param aScope
- *        Scope for the callback.
- * @param aArguments
- *        Arguments array for the callback.
- *
- * @note The result is achieved by asynchronously executing a query requiring
- *       a write lock.  Since all statements on the same connection are
- *       serialized, the end of this write operation means that all writes are
- *       complete.  Note that WAL makes so that writers don't block readers, but
- *       this is a problem only across different connections.
- */
-function waitForAsyncUpdates(aCallback, aScope, aArguments) {
-  let scope = aScope || this;
-  let args = aArguments || [];
-  let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
-                              .DBConnection;
-  let begin = db.createAsyncStatement("BEGIN EXCLUSIVE");
-  begin.executeAsync();
-  begin.finalize();
-
-  let commit = db.createAsyncStatement("COMMIT");
-  commit.executeAsync({
-    handleResult: function() {},
-    handleError: function() {},
-    handleCompletion: function(aReason) {
-      aCallback.apply(scope, args);
-    }
-  });
-  commit.finalize();
-}
-
-/**
- * Asynchronously check a url is visited.
-
- * @param aURI The URI.
- * @param aExpectedValue The expected value.
- * @return {Promise}
- * @resolves When the check has been added successfully.
- * @rejects JavaScript exception.
- */
-function promiseIsURIVisited(aURI, aExpectedValue) {
-  let deferred = Promise.defer();
-  PlacesUtils.asyncHistory.isURIVisited(aURI, function(aURI, aIsVisited) {
-    deferred.resolve(aIsVisited);
-  });
-
-  return deferred.promise;
-}
-
 function whenNewTabLoaded(aWindow, aCallback) {
   aWindow.BrowserOpenTab();
 
   let browser = aWindow.gBrowser.selectedBrowser;
   if (browser.contentDocument.readyState === "complete") {
     aCallback();
     return;
   }
@@ -344,43 +109,16 @@ function whenTabLoaded(aTab, aCallback) 
 
 function promiseTabLoaded(aTab) {
   let deferred = Promise.defer();
   whenTabLoaded(aTab, deferred.resolve);
   return deferred.promise;
 }
 
 /**
- * Ensures that the specified URIs are either cleared or not.
- *
- * @param aURIs
- *        Array of page URIs
- * @param aShouldBeCleared
- *        True if each visit to the URI should be cleared, false otherwise
- */
-function promiseHistoryClearedState(aURIs, aShouldBeCleared) {
-  let deferred = Promise.defer();
-  let callbackCount = 0;
-  let niceStr = aShouldBeCleared ? "no longer" : "still";
-  function callbackDone() {
-    if (++callbackCount == aURIs.length)
-      deferred.resolve();
-  }
-  aURIs.forEach(function (aURI) {
-    PlacesUtils.asyncHistory.isURIVisited(aURI, function(aURI, aIsVisited) {
-      is(aIsVisited, !aShouldBeCleared,
-         "history visit " + aURI.spec + " should " + niceStr + " exist");
-      callbackDone();
-    });
-  });
-
-  return deferred.promise;
-}
-
-/**
  * Waits for the next top-level document load in the current browser.  The URI
  * of the document is compared against aExpectedURL.  The load is then stopped
  * before it actually starts.
  *
  * @param aExpectedURL
  *        The URL of the document that is expected to load.
  * @param aStopFromProgressListener
  *        Whether to cancel the load directly from the progress listener. Defaults to true.
@@ -449,157 +187,16 @@ function waitForDocLoadAndStopIt(aExpect
     let mm = aBrowser.messageManager;
     mm.loadFrameScript("data:,(" + content_script.toString() + ")(" + aStopFromProgressListener + ");", true);
     mm.addMessageListener("Test:WaitForDocLoadAndStopIt", complete);
     info("waitForDocLoadAndStopIt: Waiting for URL: " + aExpectedURL);
   });
 }
 
 /**
- * Waits for the next load to complete in any browser or the given browser.
- * If a <tabbrowser> is given it waits for a load in any of its browsers.
- *
- * @return promise
- */
-function waitForDocLoadComplete(aBrowser=gBrowser) {
-  return new Promise(resolve => {
-    let listener = {
-      onStateChange: function (webProgress, req, flags, status) {
-        let docStop = Ci.nsIWebProgressListener.STATE_IS_NETWORK |
-                      Ci.nsIWebProgressListener.STATE_STOP;
-        info("Saw state " + flags.toString(16) + " and status " + status.toString(16));
-
-        // When a load needs to be retargetted to a new process it is cancelled
-        // with NS_BINDING_ABORTED so ignore that case
-        if ((flags & docStop) == docStop && status != Cr.NS_BINDING_ABORTED) {
-          aBrowser.removeProgressListener(this);
-          waitForDocLoadComplete.listeners.delete(this);
-
-          let chan = req.QueryInterface(Ci.nsIChannel);
-          info("Browser loaded " + chan.originalURI.spec);
-          resolve();
-        }
-      },
-      QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
-                                             Ci.nsISupportsWeakReference])
-    };
-    aBrowser.addProgressListener(listener);
-    waitForDocLoadComplete.listeners.add(listener);
-    info("Waiting for browser load");
-  });
-}
-
-// Keep a set of progress listeners for waitForDocLoadComplete() to make sure
-// they're not GC'ed before we saw the page load.
-waitForDocLoadComplete.listeners = new Set();
-registerCleanupFunction(() => waitForDocLoadComplete.listeners.clear());
-
-var FullZoomHelper = {
-
-  selectTabAndWaitForLocationChange: function selectTabAndWaitForLocationChange(tab) {
-    if (!tab)
-      throw new Error("tab must be given.");
-    if (gBrowser.selectedTab == tab)
-      return Promise.resolve();
-
-    return Promise.all([BrowserTestUtils.switchTab(gBrowser, tab),
-                        this.waitForLocationChange()]);
-  },
-
-  removeTabAndWaitForLocationChange: function removeTabAndWaitForLocationChange(tab) {
-    tab = tab || gBrowser.selectedTab;
-    let selected = gBrowser.selectedTab == tab;
-    gBrowser.removeTab(tab);
-    if (selected)
-      return this.waitForLocationChange();
-    return Promise.resolve();
-  },
-
-  waitForLocationChange: function waitForLocationChange() {
-    return new Promise(resolve => {
-      Services.obs.addObserver(function obs(subj, topic, data) {
-        Services.obs.removeObserver(obs, topic);
-        resolve();
-      }, "browser-fullZoom:location-change", false);
-    });
-  },
-
-  load: function load(tab, url) {
-    return new Promise(resolve => {
-      let didLoad = false;
-      let didZoom = false;
-
-      promiseTabLoadEvent(tab).then(event => {
-        didLoad = true;
-        if (didZoom)
-          resolve();
-      }, true);
-
-      this.waitForLocationChange().then(function () {
-        didZoom = true;
-        if (didLoad)
-          resolve();
-      });
-
-      tab.linkedBrowser.loadURI(url);
-    });
-  },
-
-  zoomTest: function zoomTest(tab, val, msg) {
-    is(ZoomManager.getZoomForBrowser(tab.linkedBrowser), val, msg);
-  },
-
-  enlarge: function enlarge() {
-    return new Promise(resolve => FullZoom.enlarge(resolve));
-  },
-
-  reduce: function reduce() {
-    return new Promise(resolve => FullZoom.reduce(resolve));
-  },
-
-  reset: function reset() {
-    return new Promise(resolve => FullZoom.reset(resolve));
-  },
-
-  BACK: 0,
-  FORWARD: 1,
-  navigate: function navigate(direction) {
-    return new Promise(resolve => {
-      let didPs = false;
-      let didZoom = false;
-
-      gBrowser.addEventListener("pageshow", function listener(event) {
-        gBrowser.removeEventListener("pageshow", listener, true);
-        didPs = true;
-        if (didZoom)
-          resolve();
-      }, true);
-
-      if (direction == this.BACK)
-        gBrowser.goBack();
-      else if (direction == this.FORWARD)
-        gBrowser.goForward();
-
-      this.waitForLocationChange().then(function () {
-        didZoom = true;
-        if (didPs)
-          resolve();
-      });
-    });
-  },
-
-  failAndContinue: function failAndContinue(func) {
-    return function (err) {
-      ok(false, err);
-      func();
-    };
-  },
-};
-
-/**
  * Waits for a load (or custom) event to finish in a given tab. If provided
  * load an uri into the tab.
  *
  * @param tab
  *        The tab to load into.
  * @param [optional] url
  *        The url to load, or the current url.
  * @param [optional] event
@@ -630,309 +227,16 @@ function promiseTabLoadEvent(tab, url)
     BrowserTestUtils.loadURI(tab.linkedBrowser, url);
 
   // Promise.all rejects if either promise rejects (i.e. if we time out) and
   // if our loaded promise resolves before the timeout, then we resolve the
   // timeout promise as well, causing the all promise to resolve.
   return Promise.all([deferred.promise, loaded]);
 }
 
-/**
- * Returns a Promise that resolves once a new tab has been opened in
- * a xul:tabbrowser.
- *
- * @param aTabBrowser
- *        The xul:tabbrowser to monitor for a new tab.
- * @return {Promise}
- *        Resolved when the new tab has been opened.
- * @resolves to the TabOpen event that was fired.
- * @rejects Never.
- */
-function waitForNewTabEvent(aTabBrowser) {
-  return promiseWaitForEvent(aTabBrowser.tabContainer, "TabOpen");
-}
-
-/**
- * Waits for a window with the given URL to exist.
- *
- * @param url
- *        The url of the window.
- * @return {Promise} resolved when the window exists.
- * @resolves to the window
- */
-function promiseWindow(url) {
-  info("expecting a " + url + " window");
-  return new Promise(resolve => {
-    Services.obs.addObserver(function obs(win) {
-      win.QueryInterface(Ci.nsIDOMWindow);
-      win.addEventListener("load", function loadHandler() {
-        win.removeEventListener("load", loadHandler);
-
-        if (win.location.href !== url) {
-          info("ignoring a window with this url: " + win.location.href);
-          return;
-        }
-
-        Services.obs.removeObserver(obs, "domwindowopened");
-        resolve(win);
-      });
-    }, "domwindowopened", false);
-  });
-}
-
-function promiseIndicatorWindow() {
-  // We don't show the indicator window on Mac.
-  if ("nsISystemStatusBar" in Ci)
-    return Promise.resolve();
-
-  return promiseWindow("chrome://browser/content/webrtcIndicator.xul");
-}
-
-function assertWebRTCIndicatorStatus(expected) {
-  let ui = Cu.import("resource:///modules/webrtcUI.jsm", {}).webrtcUI;
-  let expectedState = expected ? "visible" : "hidden";
-  let msg = "WebRTC indicator " + expectedState;
-  if (!expected && ui.showGlobalIndicator) {
-    // It seems the global indicator is not always removed synchronously
-    // in some cases.
-    info("waiting for the global indicator to be hidden");
-    yield promiseWaitForCondition(() => !ui.showGlobalIndicator);
-  }
-  is(ui.showGlobalIndicator, !!expected, msg);
-
-  let expectVideo = false, expectAudio = false, expectScreen = false;
-  if (expected) {
-    if (expected.video)
-      expectVideo = true;
-    if (expected.audio)
-      expectAudio = true;
-    if (expected.screen)
-      expectScreen = true;
-  }
-  is(ui.showCameraIndicator, expectVideo, "camera global indicator as expected");
-  is(ui.showMicrophoneIndicator, expectAudio, "microphone global indicator as expected");
-  is(ui.showScreenSharingIndicator, expectScreen, "screen global indicator as expected");
-
-  let windows = Services.wm.getEnumerator("navigator:browser");
-  while (windows.hasMoreElements()) {
-    let win = windows.getNext();
-    let menu = win.document.getElementById("tabSharingMenu");
-    is(menu && !menu.hidden, !!expected, "WebRTC menu should be " + expectedState);
-  }
-
-  if (!("nsISystemStatusBar" in Ci)) {
-    if (!expected) {
-      let win = Services.wm.getMostRecentWindow("Browser:WebRTCGlobalIndicator");
-      if (win) {
-        yield new Promise((resolve, reject) => {
-          win.addEventListener("unload", function listener(e) {
-            if (e.target == win.document) {
-              win.removeEventListener("unload", listener);
-              resolve();
-            }
-          }, false);
-        });
-      }
-    }
-    let indicator = Services.wm.getEnumerator("Browser:WebRTCGlobalIndicator");
-    let hasWindow = indicator.hasMoreElements();
-    is(hasWindow, !!expected, "popup " + msg);
-    if (hasWindow) {
-      let document = indicator.getNext().document;
-      let docElt = document.documentElement;
-
-      if (document.readyState != "complete") {
-        info("Waiting for the sharing indicator's document to load");
-        let deferred = Promise.defer();
-        document.addEventListener("readystatechange",
-                                  function onReadyStateChange() {
-          if (document.readyState != "complete")
-            return;
-          document.removeEventListener("readystatechange", onReadyStateChange);
-          deferred.resolve();
-        });
-        yield deferred.promise;
-      }
-
-      for (let item of ["video", "audio", "screen"]) {
-        let expectedValue = (expected && expected[item]) ? "true" : "";
-        is(docElt.getAttribute("sharing" + item), expectedValue,
-           item + " global indicator attribute as expected");
-      }
-
-      ok(!indicator.hasMoreElements(), "only one global indicator window");
-    }
-  }
-}
-
-/**
- * Test the state of the identity box and control center to make
- * sure they are correctly showing the expected mixed content states.
- *
- * @note The checks are done synchronously, but new code should wait on the
- *       returned Promise object to ensure the identity panel has closed.
- *       Bug 1221114 is filed to fix the existing code.
- *
- * @param tabbrowser
- * @param Object states
- *        MUST include the following properties:
- *        {
- *           activeLoaded: true|false,
- *           activeBlocked: true|false,
- *           passiveLoaded: true|false,
- *        }
- *
- * @return {Promise}
- * @resolves When the operation has finished and the identity panel has closed.
- */
-function assertMixedContentBlockingState(tabbrowser, states = {}) {
-  if (!tabbrowser || !("activeLoaded" in states) ||
-      !("activeBlocked" in states) || !("passiveLoaded" in states))  {
-    throw new Error("assertMixedContentBlockingState requires a browser and a states object");
-  }
-
-  let {passiveLoaded,activeLoaded,activeBlocked} = states;
-  let {gIdentityHandler} = tabbrowser.ownerGlobal;
-  let doc = tabbrowser.ownerDocument;
-  let identityBox = gIdentityHandler._identityBox;
-  let classList = identityBox.classList;
-  let connectionIcon = doc.getElementById("connection-icon");
-  let connectionIconImage = tabbrowser.ownerGlobal.getComputedStyle(connectionIcon, "").
-                         getPropertyValue("list-style-image");
-
-  let stateSecure = gIdentityHandler._state & Ci.nsIWebProgressListener.STATE_IS_SECURE;
-  let stateBroken = gIdentityHandler._state & Ci.nsIWebProgressListener.STATE_IS_BROKEN;
-  let stateInsecure = gIdentityHandler._state & Ci.nsIWebProgressListener.STATE_IS_INSECURE;
-  let stateActiveBlocked = gIdentityHandler._state & Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT;
-  let stateActiveLoaded = gIdentityHandler._state & Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT;
-  let statePassiveLoaded = gIdentityHandler._state & Ci.nsIWebProgressListener.STATE_LOADED_MIXED_DISPLAY_CONTENT;
-
-  is(activeBlocked, !!stateActiveBlocked, "Expected state for activeBlocked matches UI state");
-  is(activeLoaded, !!stateActiveLoaded, "Expected state for activeLoaded matches UI state");
-  is(passiveLoaded, !!statePassiveLoaded, "Expected state for passiveLoaded matches UI state");
-
-  if (stateInsecure) {
-    // HTTP request, there should be no MCB classes for the identity box and the non secure icon
-    // should always be visible regardless of MCB state.
-    ok(classList.contains("unknownIdentity"), "unknownIdentity on HTTP page");
-    is_element_hidden(connectionIcon);
-
-    ok(!classList.contains("mixedActiveContent"), "No MCB icon on HTTP page");
-    ok(!classList.contains("mixedActiveBlocked"), "No MCB icon on HTTP page");
-    ok(!classList.contains("mixedDisplayContent"), "No MCB icon on HTTP page");
-    ok(!classList.contains("mixedDisplayContentLoadedActiveBlocked"), "No MCB icon on HTTP page");
-  } else {
-    // Make sure the identity box UI has the correct mixedcontent states and icons
-    is(classList.contains("mixedActiveContent"), activeLoaded,
-        "identityBox has expected class for activeLoaded");
-    is(classList.contains("mixedActiveBlocked"), activeBlocked && !passiveLoaded,
-        "identityBox has expected class for activeBlocked && !passiveLoaded");
-    is(classList.contains("mixedDisplayContent"), passiveLoaded && !(activeLoaded || activeBlocked),
-       "identityBox has expected class for passiveLoaded && !(activeLoaded || activeBlocked)");
-    is(classList.contains("mixedDisplayContentLoadedActiveBlocked"), passiveLoaded && activeBlocked,
-       "identityBox has expected class for passiveLoaded && activeBlocked");
-
-    is_element_visible(connectionIcon);
-    if (activeLoaded) {
-      is(connectionIconImage, "url(\"chrome://browser/skin/identity-mixed-active-loaded.svg\")",
-        "Using active loaded icon");
-    }
-    if (activeBlocked && !passiveLoaded) {
-      is(connectionIconImage, "url(\"chrome://browser/skin/identity-mixed-active-blocked.svg\")",
-        "Using active blocked icon");
-    }
-    if (passiveLoaded && !(activeLoaded || activeBlocked)) {
-      is(connectionIconImage, "url(\"chrome://browser/skin/identity-mixed-passive-loaded.svg\")",
-        "Using passive loaded icon");
-    }
-    if (passiveLoaded && activeBlocked) {
-      is(connectionIconImage, "url(\"chrome://browser/skin/identity-mixed-passive-loaded.svg\")",
-        "Using active blocked and passive loaded icon");
-    }
-  }
-
-  // Make sure the identity popup has the correct mixedcontent states
-  gIdentityHandler._identityBox.click();
-  let popupAttr = doc.getElementById("identity-popup").getAttribute("mixedcontent");
-  let bodyAttr = doc.getElementById("identity-popup-securityView-body").getAttribute("mixedcontent");
-
-  is(popupAttr.includes("active-loaded"), activeLoaded,
-      "identity-popup has expected attr for activeLoaded");
-  is(bodyAttr.includes("active-loaded"), activeLoaded,
-      "securityView-body has expected attr for activeLoaded");
-
-  is(popupAttr.includes("active-blocked"), activeBlocked,
-      "identity-popup has expected attr for activeBlocked");
-  is(bodyAttr.includes("active-blocked"), activeBlocked,
-      "securityView-body has expected attr for activeBlocked");
-
-  is(popupAttr.includes("passive-loaded"), passiveLoaded,
-      "identity-popup has expected attr for passiveLoaded");
-  is(bodyAttr.includes("passive-loaded"), passiveLoaded,
-      "securityView-body has expected attr for passiveLoaded");
-
-  // Make sure the correct icon is visible in the Control Center.
-  // This logic is controlled with CSS, so this helps prevent regressions there.
-  let securityView = doc.getElementById("identity-popup-securityView");
-  let securityContent = doc.getElementById("identity-popup-security-content");
-  let securityViewBG = tabbrowser.ownerGlobal.getComputedStyle(securityView, "").
-                       getPropertyValue("background-image");
-  let securityContentBG = tabbrowser.ownerGlobal.getComputedStyle(securityView, "").
-                          getPropertyValue("background-image");
-
-  if (stateInsecure) {
-    is(securityViewBG, "url(\"chrome://browser/skin/controlcenter/conn-not-secure.svg\")",
-      "CC using 'not secure' icon");
-    is(securityContentBG, "url(\"chrome://browser/skin/controlcenter/conn-not-secure.svg\")",
-      "CC using 'not secure' icon");
-  }
-
-  if (stateSecure) {
-    is(securityViewBG, "url(\"chrome://browser/skin/controlcenter/conn-secure.svg\")",
-      "CC using secure icon");
-    is(securityContentBG, "url(\"chrome://browser/skin/controlcenter/conn-secure.svg\")",
-      "CC using secure icon");
-  }
-
-  if (stateBroken) {
-    if (activeLoaded) {
-      is(securityViewBG, "url(\"chrome://browser/skin/controlcenter/mcb-disabled.svg\")",
-        "CC using active loaded icon");
-      is(securityContentBG, "url(\"chrome://browser/skin/controlcenter/mcb-disabled.svg\")",
-        "CC using active loaded icon");
-    } else if (activeBlocked || passiveLoaded) {
-      is(securityViewBG, "url(\"chrome://browser/skin/controlcenter/conn-degraded.svg\")",
-        "CC using degraded icon");
-      is(securityContentBG, "url(\"chrome://browser/skin/controlcenter/conn-degraded.svg\")",
-        "CC using degraded icon");
-    } else {
-      // There is a case here with weak ciphers, but no bc tests are handling this yet.
-      is(securityViewBG, "url(\"chrome://browser/skin/controlcenter/conn-degraded.svg\")",
-        "CC using degraded icon");
-      is(securityContentBG, "url(\"chrome://browser/skin/controlcenter/conn-degraded.svg\")",
-        "CC using degraded icon");
-    }
-  }
-
-  if (activeLoaded || activeBlocked || passiveLoaded) {
-    doc.getElementById("identity-popup-security-expander").click();
-    is(Array.filter(doc.querySelectorAll("[observes=identity-popup-mcb-learn-more]"),
-                    element => !is_hidden(element)).length, 1,
-       "The 'Learn more' link should be visible once.");
-  }
-
-  gIdentityHandler._identityPopup.hidden = true;
-
-  // Wait for the panel to be closed before continuing. The promisePopupHidden
-  // function cannot be used because it's unreliable unless promisePopupShown is
-  // also called before closing the panel. This cannot be done until all callers
-  // are made asynchronous (bug 1221114).
-  return new Promise(resolve => executeSoon(resolve));
-}
-
 function makeActionURI(action, params) {
   let encodedParams = {};
   for (let key in params) {
     encodedParams[key] = encodeURIComponent(params[key]);
   }
   let url = "moz-action:" + action + "," + JSON.stringify(encodedParams);
   return NetUtil.newURI(url);
 }
@@ -998,26 +302,16 @@ function promisePopupEvent(popup, eventS
 function promisePopupShown(popup) {
   return promisePopupEvent(popup, "shown");
 }
 
 function promisePopupHidden(popup) {
   return promisePopupEvent(popup, "hidden");
 }
 
-function promiseNotificationShown(notification) {
-  let win = notification.browser.ownerDocument.defaultView;
-  if (win.PopupNotifications.panel.state == "open") {
-    return Promise.resolved();
-  }
-  let panelPromise = promisePopupShown(win.PopupNotifications.panel);
-  notification.reshow();
-  return panelPromise;
-}
-
 function promiseSearchComplete(win = window) {
   return promisePopupShown(win.gURLBar.popup).then(() => {
     function searchIsComplete() {
       return win.gURLBar.controller.searchStatus >=
         Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH;
     }
 
     // Wait until there are at least two matches.
@@ -1030,38 +324,16 @@ function promiseAutocompleteResultPopup(
     win.gURLBar.focus();
     win.gURLBar.value = inputText;
     win.gURLBar.controller.startSearch(inputText);
   }, win);
 
   return promiseSearchComplete(win);
 }
 
-/**
- * Allows waiting for an observer notification once.
- *
- * @param aTopic
- *        Notification topic to observe.
- *
- * @return {Promise}
- * @resolves An object with subject and data properties from the observed
- *           notification.
- * @rejects Never.
- */
-function promiseTopicObserved(aTopic)
-{
-  return new Promise((resolve) => {
-    Services.obs.addObserver(
-      function PTO_observe(aSubject, aTopic, aData) {
-        Services.obs.removeObserver(PTO_observe, aTopic);
-        resolve({subject: aSubject, data: aData});
-      }, aTopic, false);
-  });
-}
-
 function promiseNewSearchEngine(basename) {
   return new Promise((resolve, reject) => {
     info("Waiting for engine to be added: " + basename);
     let url = getRootDirectory(gTestPath) + basename;
     Services.search.addEngine(url, null, "", false, {
       onSuccess: function (engine) {
         info("Search engine added: " + basename);
         registerCleanupFunction(() => Services.search.removeEngine(engine));
@@ -1070,170 +342,8 @@ function promiseNewSearchEngine(basename
       onError: function (errCode) {
         Assert.ok(false, "addEngine failed with error code " + errCode);
         reject();
       },
     });
   });
 }
 
-// Compares the security state of the page with what is expected
-function isSecurityState(expectedState) {
-  let ui = gTestBrowser.securityUI;
-  if (!ui) {
-    ok(false, "No security UI to get the security state");
-    return;
-  }
-
-  const wpl = Components.interfaces.nsIWebProgressListener;
-
-  // determine the security state
-  let isSecure = ui.state & wpl.STATE_IS_SECURE;
-  let isBroken = ui.state & wpl.STATE_IS_BROKEN;
-  let isInsecure = ui.state & wpl.STATE_IS_INSECURE;
-
-  let actualState;
-  if (isSecure && !(isBroken || isInsecure)) {
-    actualState = "secure";
-  } else if (isBroken && !(isSecure || isInsecure)) {
-    actualState = "broken";
-  } else if (isInsecure && !(isSecure || isBroken)) {
-    actualState = "insecure";
-  } else {
-    actualState = "unknown";
-  }
-
-  is(expectedState, actualState, "Expected state " + expectedState + " and the actual state is " + actualState + ".");
-}
-
-/**
- * Resolves when a bookmark with the given uri is added.
- */
-function promiseOnBookmarkItemAdded(aExpectedURI) {
-  return new Promise((resolve, reject) => {
-    let bookmarksObserver = {
-      onItemAdded: function (aItemId, aFolderId, aIndex, aItemType, aURI) {
-        info("Added a bookmark to " + aURI.spec);
-        PlacesUtils.bookmarks.removeObserver(bookmarksObserver);
-        if (aURI.equals(aExpectedURI)) {
-          resolve();
-        }
-        else {
-          reject(new Error("Added an unexpected bookmark"));
-        }
-      },
-      onBeginUpdateBatch: function () {},
-      onEndUpdateBatch: function () {},
-      onItemRemoved: function () {},
-      onItemChanged: function () {},
-      onItemVisited: function () {},
-      onItemMoved: function () {},
-      QueryInterface: XPCOMUtils.generateQI([
-        Ci.nsINavBookmarkObserver,
-      ])
-    };
-    info("Waiting for a bookmark to be added");
-    PlacesUtils.bookmarks.addObserver(bookmarksObserver, false);
-  });
-}
-
-/**
- * For an nsIPropertyBag, returns the value for a given
- * key.
- *
- * @param bag
- *        The nsIPropertyBag to retrieve the value from
- * @param key
- *        The key that we want to get the value for from the
- *        bag
- * @returns The value corresponding to the key from the bag,
- *          or null if the value could not be retrieved (for
- *          example, if no value is set at that key).
-*/
-function getPropertyBagValue(bag, key) {
-  try {
-    let val = bag.getProperty(key);
-    return val;
-  } catch(e if e.result == Cr.NS_ERROR_FAILURE) {}
-
-  return null;
-}
-
-/**
- * Returns a Promise that resolves once a crash report has
- * been submitted. This function will also test the crash
- * reports extra data to see if it matches expectedExtra.
- *
- * @param expectedExtra (object)
- *        An Object whose key-value pairs will be compared
- *        against the key-value pairs in the extra data of the
- *        crash report. A test failure will occur if there is
- *        a mismatch.
- *
- *        If the value of the key-value pair is "null", this will
- *        be interpreted as "this key should not be included in the
- *        extra data", and will cause a test failure if it is detected
- *        in the crash report.
- *
- *        Note that this will ignore any keys that are not included
- *        in expectedExtra. It's possible that the crash report
- *        will contain other extra information that is not
- *        compared against.
- * @returns Promise
- */
-function promiseCrashReport(expectedExtra={}) {
-  return Task.spawn(function*() {
-    info("Starting wait on crash-report-status");
-    let [subject, data] =
-      yield TestUtils.topicObserved("crash-report-status", (subject, data) => {
-        return data == "success";
-      });
-    info("Topic observed!");
-
-    if (!(subject instanceof Ci.nsIPropertyBag2)) {
-      throw new Error("Subject was not a Ci.nsIPropertyBag2");
-    }
-
-    let remoteID = getPropertyBagValue(subject, "serverCrashID");
-    if (!remoteID) {
-      throw new Error("Report should have a server ID");
-    }
-
-    let file = Cc["@mozilla.org/file/local;1"]
-                 .createInstance(Ci.nsILocalFile);
-    file.initWithPath(Services.crashmanager._submittedDumpsDir);
-    file.append(remoteID + ".txt");
-    if (!file.exists()) {
-      throw new Error("Report should have been received by the server");
-    }
-
-    file.remove(false);
-
-    let extra = getPropertyBagValue(subject, "extra");
-    if (!(extra instanceof Ci.nsIPropertyBag2)) {
-      throw new Error("extra was not a Ci.nsIPropertyBag2");
-    }
-
-    info("Iterating crash report extra keys");
-    let enumerator = extra.enumerator;
-    while (enumerator.hasMoreElements()) {
-      let key = enumerator.getNext().QueryInterface(Ci.nsIProperty).name;
-      let value = extra.getPropertyAsAString(key);
-      if (key in expectedExtra) {
-        if (expectedExtra[key] == null) {
-          ok(false, `Got unexpected key ${key} with value ${value}`);
-        } else {
-          is(value, expectedExtra[key],
-             `Crash report had the right extra value for ${key}`);
-        }
-      }
-    }
-  });
-}
-
-function promiseErrorPageLoaded(browser) {
-  return new Promise(resolve => {
-    browser.addEventListener("DOMContentLoaded", function onLoad() {
-      browser.removeEventListener("DOMContentLoaded", onLoad, false, true);
-      resolve();
-    }, false, true);
-  });
-}
copy from browser/base/content/test/general/moz.png
copy to browser/base/content/test/urlbar/moz.png
rename from browser/base/content/test/general/redirect_bug623155.sjs
rename to browser/base/content/test/urlbar/redirect_bug623155.sjs
copy from browser/base/content/test/general/searchSuggestionEngine.sjs
copy to browser/base/content/test/urlbar/searchSuggestionEngine.sjs
copy from browser/base/content/test/general/searchSuggestionEngine.xml
copy to browser/base/content/test/urlbar/searchSuggestionEngine.xml
--- a/browser/base/content/test/general/searchSuggestionEngine.xml
+++ b/browser/base/content/test/urlbar/searchSuggestionEngine.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Any copyright is dedicated to the Public Domain.
    - http://creativecommons.org/publicdomain/zero/1.0/ -->
 
 <SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
 <ShortName>browser_searchSuggestionEngine searchSuggestionEngine.xml</ShortName>
-<Url type="application/x-suggestions+json" method="GET" template="http://mochi.test:8888/browser/browser/base/content/test/general/searchSuggestionEngine.sjs?{searchTerms}"/>
+<Url type="application/x-suggestions+json" method="GET" template="http://mochi.test:8888/browser/browser/base/content/test/urlbar/searchSuggestionEngine.sjs?{searchTerms}"/>
 <Url type="text/html" method="GET" template="http://mochi.test:8888/" rel="searchform"/>
 </SearchPlugin>
rename from browser/base/content/test/general/test_wyciwyg_copying.html
rename to browser/base/content/test/urlbar/test_wyciwyg_copying.html
copy from browser/base/content/test/general/authenticate.sjs
copy to toolkit/components/thumbnails/test/authenticate.sjs
--- a/toolkit/components/thumbnails/test/browser.ini
+++ b/toolkit/components/thumbnails/test/browser.ini
@@ -1,19 +1,19 @@
 [DEFAULT]
 support-files =
+  authenticate.sjs
   background_red.html
   background_red_redirect.sjs
   background_red_scroll.html
   head.js
   privacy_cache_control.sjs
   thumbnails_background.sjs
   thumbnails_crash_content_helper.js
   thumbnails_update.sjs
-  !/browser/base/content/test/general/authenticate.sjs
 
 [browser_thumbnails_bg_bad_url.js]
 [browser_thumbnails_bg_crash_during_capture.js]
 skip-if = buildapp == 'mulet' || !crashreporter || e10s # crashing the remote thumbnailer crashes the remote test tab
 [browser_thumbnails_bg_crash_while_idle.js]
 skip-if = buildapp == 'mulet' || !crashreporter
 [browser_thumbnails_bg_basic.js]
 [browser_thumbnails_bg_queueing.js]
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_auth_prompt.js
+++ b/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_auth_prompt.js
@@ -5,17 +5,17 @@
 // relies on the fact that if the dialog was displayed the test will hang
 // and timeout.  IOW - the tests would pass if the dialogs appear and are
 // manually closed by the user - so don't do that :)  (obviously there is
 // noone available to do that when run via tbpl etc, so this should be safe,
 // and it's tricky to use the window-watcher to check a window *does not*
 // appear - how long should the watcher be active before assuming it's not
 // going to appear?)
 function* runTests() {
-  let url = "http://mochi.test:8888/browser/browser/base/content/test/general/authenticate.sjs?user=anyone";
+  let url = "http://mochi.test:8888/browser/toolkit/components/thumbnails/test/authenticate.sjs?user=anyone";
   ok(!thumbnailExists(url), "Thumbnail file should not already exist.");
 
   let capturedURL = yield bgCapture(url);
   is(capturedURL, url, "Captured URL should be URL passed to capture.");
   ok(thumbnailExists(url),
      "Thumbnail file should exist even though it requires auth.");
   removeThumbnail(url);
 }