Bug 1491333 - Make findbarClose test less clownshoes. r=florian, a=test-only DEVEDITION_64_0b5_BUILD1 DEVEDITION_64_0b5_RELEASE FENNEC_64_0b5_BUILD1 FENNEC_64_0b5_RELEASE FIREFOX_64_0b5_BUILD1 FIREFOX_64_0b5_RELEASE
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 24 Oct 2018 13:18:00 +0000
changeset 498193 60872ce3bd7d8ffc70e566f77bdc4ccdc7e2585b
parent 498192 cbd3baf67f7fe586c281032fe4b2e0ae83b3daa3
child 498194 5ed332f28da84b19c97f894ea47208c3f021e7de
push id10060
push userryanvm@gmail.com
push dateMon, 29 Oct 2018 16:45:36 +0000
treeherdermozilla-beta@60872ce3bd7d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, test-only
bugs1491333
milestone64.0
Bug 1491333 - Make findbarClose test less clownshoes. r=florian, a=test-only 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();
 });