Bug 1397728 - Use waitForCondition to avoid intermittent failures in browser_searchbar_openpopup.js. r=florian
authorMark Banner <standard8@mozilla.com>
Mon, 25 Sep 2017 16:52:52 +0100
changeset 383265 08f5f3a124d34babdf642fbedb93900fd5ef3acd
parent 383264 85684a22314e7709243d0db92450721cd2ce889b
child 383266 cffc9b5b177ee35f34d25202067a4e83d6c1c9df
push id95539
push userkwierso@gmail.com
push dateThu, 28 Sep 2017 00:01:12 +0000
treeherdermozilla-inbound@72de90e66155 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1397728
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1397728 - Use waitForCondition to avoid intermittent failures in browser_searchbar_openpopup.js. r=florian MozReview-Commit-ID: K62zPje3Hnj
browser/components/search/test/browser_searchbar_openpopup.js
--- a/browser/components/search/test/browser_searchbar_openpopup.js
+++ b/browser/components/search/test/browser_searchbar_openpopup.js
@@ -474,17 +474,20 @@ add_task(async function dont_consume_cli
   is(Services.focus.focusedElement, gURLBar.inputField, "Should have focused the URL bar");
 
   textbox.value = "";
 });
 
 // Dropping text to the searchbar should open the popup
 add_task(async function drop_opens_popup() {
   let promise = promiseEvent(searchPopup, "popupshown");
-  EventUtils.synthesizeDrop(searchIcon, textbox.inputField, [[ {type: "text/plain", data: "foo" } ]], "move", window);
+  // Use a source for the drop that is outside of the search bar area, to avoid
+  // it receiving a mousedown and causing the popup to sometimes open.
+  let homeButton = document.getElementById("home-button");
+  EventUtils.synthesizeDrop(homeButton, textbox.inputField, [[ {type: "text/plain", data: "foo" } ]], "move", window);
   await promise;
 
   isnot(searchPopup.getAttribute("showonlysettings"), "true", "Should show the full popup");
   is(Services.focus.focusedElement, textbox.inputField, "Should have focused the search bar");
   promise = promiseEvent(searchPopup, "popuphidden");
   searchPopup.hidePopup();
   await promise;