Bug 890690 followup: simplify test
authorGavin Sharp <gavin@gavinsharp.com>
Thu, 25 Jul 2013 17:48:17 -0700
changeset 152261 156f5120a9f03747ebd91f9ade0b2e03288bb2b1
parent 152260 0cf201bba70d20db6875faf5ef3462fb3a09909a
child 152262 1d31650caa8f075b1bb67a968ea2273c302b1ee5
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs890690
milestone25.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 890690 followup: simplify test
browser/base/content/test/browser_aboutHome.js
--- a/browser/base/content/test/browser_aboutHome.js
+++ b/browser/base/content/test/browser_aboutHome.js
@@ -277,35 +277,33 @@ let gTests = [
 
       Services.search.defaultEngine = engine;
 
       registerCleanupFunction(function() {
         Services.search.removeEngine(engine);
         Services.search.defaultEngine = currEngine;
       });
 
-      let needle = "Search for something awesome.";
 
       // Ready to execute the tests!
-      promiseBrowserAttributes(gBrowser.selectedTab).then(function() {
-        let document = gBrowser.selectedTab.linkedBrowser.contentDocument;
-        let searchText = document.getElementById("searchText");
+      let needle = "Search for something awesome.";
+      let document = gBrowser.selectedTab.linkedBrowser.contentDocument;
+      let searchText = document.getElementById("searchText");
 
-        waitForLoad(function() {
-          let loadedText = gBrowser.contentDocument.body.textContent;
-          ok(loadedText, "search page loaded");
-          is(loadedText, "searchterms=" + escape(needle.replace(/\s/g, "+")),
-             "Search text should arrive correctly");
-          deferred.resolve();
-        });
+      waitForLoad(function() {
+        let loadedText = gBrowser.contentDocument.body.textContent;
+        ok(loadedText, "search page loaded");
+        is(loadedText, "searchterms=" + escape(needle.replace(/\s/g, "+")),
+           "Search text should arrive correctly");
+        deferred.resolve();
+      });
 
-        searchText.value = needle;
-        searchText.focus();
-        EventUtils.synthesizeKey("VK_RETURN", {});
-      });
+      searchText.value = needle;
+      searchText.focus();
+      EventUtils.synthesizeKey("VK_RETURN", {});
     };
     Services.obs.addObserver(searchObserver, "browser-search-engine-modified", false);
     registerCleanupFunction(function () {
       Services.obs.removeObserver(searchObserver, "browser-search-engine-modified");
     });
     Services.search.addEngine("http://test:80/browser/browser/base/content/test/POSTSearchEngine.xml",
                               Ci.nsISearchEngine.DATA_XML, null, false);
     return deferred.promise;