Bug 1335992 - Search with default search engine stops working. r=florian

MozReview-Commit-ID: 9GnA9Y3YvTS

--HG--
extra : rebase_source : f44b3fff39b18ac2d806346b64a5c454d1cd7d96
This commit is contained in:
Drew Willcoxon 2017-03-01 09:53:24 -08:00
parent 5fce6eb532
commit 09678765af
2 changed files with 29 additions and 5 deletions

View File

@ -1114,6 +1114,21 @@
this._isHiding = false;
}, 0);
]]></handler>
<!-- This handles clicks on the topmost "Foo Search" header in the
popup (hbox[anonid="searchbar-engine"]). -->
<handler event="click"><![CDATA[
if (event.button == 2) {
// Ignore right clicks.
return;
}
let button = event.originalTarget;
let engine = button.parentNode.engine;
if (!engine) {
return;
}
this.oneOffButtons.handleSearchCommand(event, engine);
]]></handler>
</handlers>
</binding>
@ -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;

View File

@ -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);