Bug 1491333 - make findbarClose test less clownshoes, r=florian
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 24 Oct 2018 13:18:00 +0000
changeset 442770 56189c70cc8bccd927c71b09fcde036f61f3a726
parent 442769 b48368889eb5756251512ac0595078d49983be42
child 442771 45632b51fa05f02e8910e26e8a00468ac6c9f377
child 442787 43ce349e156691358e51bc2dd5d3c048c4a07d74
push id34922
push usershindli@mozilla.com
push dateWed, 24 Oct 2018 16:46:21 +0000
treeherdermozilla-central@45632b51fa05 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1491333
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 1491333 - make findbarClose test less clownshoes, r=florian Differential Revision: https://phabricator.services.mozilla.com/D9633
browser/base/content/test/general/browser_findbarClose.js
--- a/browser/base/content/test/general/browser_findbarClose.js
+++ b/browser/base/content/test/general/browser_findbarClose.js
@@ -1,36 +1,33 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Tests find bar auto-close behavior
 
-var newTab;
+const TEST_PATH = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://example.com");
 
 add_task(async function findbar_test() {
-  waitForExplicitFinish();
-  newTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
+  let newTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
+  gBrowser.selectedTab = newTab;
 
-  let promise = ContentTask.spawn(newTab.linkedBrowser, null, async function() {
-    await ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", false);
-  });
-  BrowserTestUtils.loadURI(newTab.linkedBrowser, "http://example.com/browser/" +
-    "browser/base/content/test/general/test_bug628179.html");
+  let url = TEST_PATH + "test_bug628179.html";
+  let promise = BrowserTestUtils.browserLoaded(newTab.linkedBrowser, false, url);
+  BrowserTestUtils.loadURI(newTab.linkedBrowser, url);
   await promise;
 
   await gFindBarPromise;
   gFindBar.open();
 
   await new ContentTask.spawn(newTab.linkedBrowser, null, async function() {
     let iframe = content.document.getElementById("iframe");
     let awaitLoad = ContentTaskUtils.waitForEvent(iframe, "load", false);
-    iframe.src = "http://example.org/";
+    iframe.src = "https://example.org/";
     await awaitLoad;
   });
 
   ok(!gFindBar.hidden, "the Find bar isn't hidden after the location of a " +
      "subdocument changes");
 
   gFindBar.close();
   gBrowser.removeTab(newTab);
-  finish();
 });