Bug 1313825 - Fix and enable browser_UsageTelemetry_content_aboutHome.js. r=mak, a=gchang
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Tue, 01 Nov 2016 06:46:00 +0100
changeset 340953 5eb8dba92c23bcb330f481ba4faff54e1bf1bf57
parent 340952 078b673dcfc753e9a6ca3abbab97ed80f7456388
child 340954 3da399e85ae56c913ca67fb0e7bff5732640d5f1
push id10261
push useralessio.placitelli@gmail.com
push dateWed, 09 Nov 2016 14:59:11 +0000
treeherdermozilla-aurora@3da399e85ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak, gchang
bugs1313825
milestone51.0a2
Bug 1313825 - Fix and enable browser_UsageTelemetry_content_aboutHome.js. r=mak, a=gchang MozReview-Commit-ID: GBhidbc8NVK
browser/modules/test/browser.ini
browser/modules/test/browser_UsageTelemetry_content_aboutHome.js
--- a/browser/modules/test/browser.ini
+++ b/browser/modules/test/browser.ini
@@ -32,12 +32,9 @@ support-files =
   usageTelemetrySearchSuggestions.sjs
   usageTelemetrySearchSuggestions.xml
 [browser_UsageTelemetry_searchbar.js]
 support-files =
   usageTelemetrySearchSuggestions.sjs
   usageTelemetrySearchSuggestions.xml
 [browser_UsageTelemetry_content.js]
 [browser_UsageTelemetry_content_aboutHome.js]
-# Disabled for intermittent failures.
-# Re-enabling this test is tracked in bug 1313825.
-skip-if = true
 [browser_urlBar_zoom.js]
--- a/browser/modules/test/browser_UsageTelemetry_content_aboutHome.js
+++ b/browser/modules/test/browser_UsageTelemetry_content_aboutHome.js
@@ -34,24 +34,31 @@ add_task(function* setup() {
     Services.search.removeEngine(engineOneOff);
   });
 });
 
 add_task(function* test_abouthome_simpleQuery() {
   // Let's reset the counts.
   Services.telemetry.clearScalars();
 
-  let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:home");
-  yield new Promise(resolve => {
+  let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser);
+
+  info("Setup waiting for AboutHomeLoadSnippetsCompleted.");
+  let promiseAboutHomeLoaded = new Promise(resolve => {
     tab.linkedBrowser.addEventListener("AboutHomeLoadSnippetsCompleted", function loadListener(event) {
       tab.linkedBrowser.removeEventListener("AboutHomeLoadSnippetsCompleted", loadListener, true);
       resolve();
     }, true, true);
   });
 
+  info("Load about:home.");
+  tab.linkedBrowser.loadURI("about:home");
+  info("Wait for AboutHomeLoadSnippetsCompleted.");
+  yield promiseAboutHomeLoaded;
+
   info("Trigger a simple serch, just test + enter.");
   let p = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   yield typeInSearchField(tab.linkedBrowser, "test query", "searchText");
   yield BrowserTestUtils.synthesizeKey("VK_RETURN", {}, tab.linkedBrowser);
   yield p;
 
   // Check if the scalars contain the expected values.
   const scalars =