From 7815fe540b997b2317e3ec078e6fa9f8c6e7a2b6 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Tue, 27 Jun 2017 09:04:20 +0200 Subject: [PATCH] Backed out changeset 6cc6282c67c7 (bug 1374852) for test failures in browser_urlbarSearchSuggestions_opt-out.js --- .../preferences/in-content-new/findInPage.js | 4 --- .../browser_search_within_preferences_1.js | 30 ++++--------------- .../browser_search_within_preferences_2.js | 5 +--- 3 files changed, 7 insertions(+), 32 deletions(-) diff --git a/browser/components/preferences/in-content-new/findInPage.js b/browser/components/preferences/in-content-new/findInPage.js index f58e40f26377..5a662b91d13b 100644 --- a/browser/components/preferences/in-content-new/findInPage.js +++ b/browser/components/preferences/in-content-new/findInPage.js @@ -31,10 +31,6 @@ var gSearchResultsPane = { }); } }); - - window.addEventListener("load", () => { - this.searchInput.focus(); - }); } }, diff --git a/browser/components/preferences/in-content-new/tests/browser_search_within_preferences_1.js b/browser/components/preferences/in-content-new/tests/browser_search_within_preferences_1.js index 9684844e1bd9..17d089106f64 100644 --- a/browser/components/preferences/in-content-new/tests/browser_search_within_preferences_1.js +++ b/browser/components/preferences/in-content-new/tests/browser_search_within_preferences_1.js @@ -45,10 +45,7 @@ add_task(async function() { // Performs search let searchInput = gBrowser.contentDocument.getElementById("searchInput"); - - is(searchInput, gBrowser.contentDocument.activeElement.closest("#searchInput"), - "Search input should be focused when visiting preferences"); - + searchInput.focus(); searchInput.value = "password"; searchInput.doCommand(); @@ -87,10 +84,7 @@ add_task(async function() { // Performs search let searchInput = gBrowser.contentDocument.getElementById("searchInput"); - - is(searchInput, gBrowser.contentDocument.activeElement.closest("#searchInput"), - "Search input should be focused when visiting preferences"); - + searchInput.focus(); searchInput.value = "password"; searchInput.doCommand(); @@ -147,10 +141,7 @@ add_task(async function() { // Performs search let searchInput = gBrowser.contentDocument.getElementById("searchInput"); - - is(searchInput, gBrowser.contentDocument.activeElement.closest("#searchInput"), - "Search input should be focused when visiting preferences"); - + searchInput.focus(); searchInput.value = "coach"; searchInput.doCommand(); @@ -176,10 +167,7 @@ add_task(async function() { // Performs search let searchInput = gBrowser.contentDocument.getElementById("searchInput"); - - is(searchInput, gBrowser.contentDocument.activeElement.closest("#searchInput"), - "Search input should be focused when visiting preferences"); - + searchInput.focus(); searchInput.value = "password"; searchInput.doCommand(); @@ -206,10 +194,7 @@ add_task(async function() { // Performs search let searchInput = gBrowser.contentDocument.getElementById("searchInput"); - - is(searchInput, gBrowser.contentDocument.activeElement.closest("#searchInput"), - "Search input should be focused when visiting preferences"); - + searchInput.focus(); searchInput.value = "site data"; searchInput.doCommand(); @@ -235,10 +220,7 @@ add_task(async function() { await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true}); let searchInput = gBrowser.contentDocument.getElementById("searchInput"); let searchResultsCategory = gBrowser.contentDocument.getElementById("category-search-results"); - - is(searchInput, gBrowser.contentDocument.activeElement.closest("#searchInput"), - "Search input should be focused when visiting preferences"); - + searchInput.focus(); searchInput.value = "password"; searchInput.doCommand(); is(searchResultsCategory.hidden, false, "search results category should be shown"); diff --git a/browser/components/preferences/in-content-new/tests/browser_search_within_preferences_2.js b/browser/components/preferences/in-content-new/tests/browser_search_within_preferences_2.js index fc7d6119a065..642d16ba9d18 100644 --- a/browser/components/preferences/in-content-new/tests/browser_search_within_preferences_2.js +++ b/browser/components/preferences/in-content-new/tests/browser_search_within_preferences_2.js @@ -27,10 +27,7 @@ add_task(async function() { // Performs search. let searchInput = gBrowser.contentDocument.getElementById("searchInput"); - - is(searchInput, gBrowser.contentDocument.activeElement.closest("#searchInput"), - "Search input should be focused when visiting preferences"); - + searchInput.focus(); searchInput.value = "Create Account"; searchInput.doCommand();