From 09678765aff1e0992dfe9bdd4a72b3955a94074b Mon Sep 17 00:00:00 2001 From: Drew Willcoxon Date: Wed, 1 Mar 2017 09:53:24 -0800 Subject: [PATCH] Bug 1335992 - Search with default search engine stops working. r=florian MozReview-Commit-ID: 9GnA9Y3YvTS --HG-- extra : rebase_source : f44b3fff39b18ac2d806346b64a5c454d1cd7d96 --- browser/components/search/content/search.xml | 17 ++++++++++++++++- .../search/test/browser_oneOffHeader.js | 17 +++++++++++++---- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/browser/components/search/content/search.xml b/browser/components/search/content/search.xml index 0c6e2e89a1d3..15e7f510f2b6 100644 --- a/browser/components/search/content/search.xml +++ b/browser/components/search/content/search.xml @@ -1114,6 +1114,21 @@ this._isHiding = false; }, 0); ]]> + + + @@ -2223,7 +2238,7 @@ return; // ignore right clicks. let button = event.originalTarget; - let engine = button.engine || button.parentNode.engine; + let engine = button.engine; if (!engine) return; diff --git a/browser/components/search/test/browser_oneOffHeader.js b/browser/components/search/test/browser_oneOffHeader.js index b018661df4da..ebc73dd2944d 100644 --- a/browser/components/search/test/browser_oneOffHeader.js +++ b/browser/components/search/test/browser_oneOffHeader.js @@ -122,10 +122,19 @@ add_task(function* test_text() { is(getHeaderText(), "Search for foo with:", "Header has the correct text when search terms have been entered and the Change Search Settings button is selected."); - promise = promiseEvent(searchPopup, "popuphidden"); - info("Closing search panel"); - EventUtils.synthesizeKey("VK_ESCAPE", {}); - yield promise; + // Click the "Foo Search" header at the top of the popup and make sure it + // loads the search results. + let searchbarEngine = + document.getAnonymousElementByAttribute(searchPopup, "anonid", + "searchbar-engine"); + + yield synthesizeNativeMouseMove(searchbarEngine); + SimpleTest.executeSoon(() => { + EventUtils.synthesizeMouseAtCenter(searchbarEngine, {}); + }); + + let url = Services.search.currentEngine.getSubmission(textbox.value).uri.spec; + yield promiseTabLoadEvent(gBrowser.selectedTab, url); // Move the cursor out of the panel area to avoid messing with other tests. yield synthesizeNativeMouseMove(searchbar);