Bug 1503561 - Make browser_UrlbarInput_tooltip.js more robust. r=Standard8
authorDão Gottwald <dao@mozilla.com>
Mon, 05 Nov 2018 15:56:32 +0000
changeset 444465 16689402ad9502b0945f998b2d68c4a3bfdd6aeb
parent 444464 6e528251fad42087432100835b1e3fe8c59f5fec
child 444466 45766f075eee4f0f75ae309a9f4cff7418c6637c
push id34996
push userrgurzau@mozilla.com
push dateTue, 06 Nov 2018 09:53:23 +0000
treeherdermozilla-central@e160f0a60e4f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1503561
milestone65.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 1503561 - Make browser_UrlbarInput_tooltip.js more robust. r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D10711
browser/components/urlbar/tests/browser/browser_UrlbarInput_tooltip.js
--- a/browser/components/urlbar/tests/browser/browser_UrlbarInput_tooltip.js
+++ b/browser/components/urlbar/tests/browser/browser_UrlbarInput_tooltip.js
@@ -44,18 +44,22 @@ async function expectNoTooltip() {
   synthesizeMouseOver(element);
 
   is(element.getAttribute("title"), null, "title attribute shouldn't be set");
 
   synthesizeMouseOut(element);
 }
 
 add_task(async function() {
+  // Ensure the URL bar isn't focused.
+  gBrowser.selectedBrowser.focus();
+
   gURLBar.value = "short string";
   await expectNoTooltip();
 
   let longURL = "http://longurl.com/" + "foobar/".repeat(30);
   let overflowPromise = BrowserTestUtils.waitForEvent(gURLBar.inputField, "overflow");
+  await window.promiseDocumentFlushed(() => {});
   gURLBar.value = longURL;
   await overflowPromise;
   is(gURLBar.inputField.value, longURL.replace(/^http:\/\//, ""), "Urlbar value has http:// stripped");
   await expectTooltip(longURL);
 });