Bug 1547432 - Change browser_TelemetryUpdatePing.js to be consistent with other app update telemetry tests. r=bytesized
authorRobert Strong <robert.bugzilla@gmail.com>
Mon, 29 Apr 2019 16:31:04 +0000
changeset 471812 a03cccee49fa6223711a1459636094949ce391e8
parent 471811 ea8bdd612f43f22fa90fe1f87245e73fd1c5319d
child 471813 315a91d0266efa186d7a6ba9ce5da9a82f47d096
push id112953
push usershindli@mozilla.com
push dateTue, 30 Apr 2019 04:15:04 +0000
treeherdermozilla-inbound@b3612d6d6448 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbytesized
bugs1547432
milestone68.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 1547432 - Change browser_TelemetryUpdatePing.js to be consistent with other app update telemetry tests. r=bytesized Renames browser_TelemetryUpdatePing.js to browser_telemetry_updatePing_ready.js so it is consistent with the update test naming scheme. Changes the test to use runTelemetryUpdateTest instead of runUpdateTest. Add the test to the BITS manifest so it tests downloading the update using BITS. Differential Revision: https://phabricator.services.mozilla.com/D29096
toolkit/mozapps/update/tests/browser/browser.bits.ini
toolkit/mozapps/update/tests/browser/browser.ini
toolkit/mozapps/update/tests/browser/browser_TelemetryUpdatePing.js
toolkit/mozapps/update/tests/browser/browser_telemetry_updatePing_ready.js
toolkit/mozapps/update/tests/moz.build
--- a/toolkit/mozapps/update/tests/browser/browser.bits.ini
+++ b/toolkit/mozapps/update/tests/browser/browser.bits.ini
@@ -59,8 +59,11 @@ prefs =
 [browser_telemetry_partial_applyFailure_complete_stageFailure.js]
 [browser_telemetry_partial_applyFailure_complete_applied.js]
 [browser_telemetry_partial_applyFailure_complete_staged_applied.js]
 [browser_telemetry_partialBadSize_complete_staged_applied.js]
 [browser_telemetry_complete_applied.js]
 [browser_telemetry_partial_applied.js]
 [browser_telemetry_partial_staged_applied.js]
 [browser_telemetry_complete_staged_applied.js]
+
+# Telemetry Update Ping Tests
+[browser_telemetry_updatePing_ready.js]
--- a/toolkit/mozapps/update/tests/browser/browser.ini
+++ b/toolkit/mozapps/update/tests/browser/browser.ini
@@ -88,9 +88,11 @@ reason = test must be able to prevent fi
 [browser_telemetry_partial_applyFailure_complete_stageFailure.js]
 [browser_telemetry_partial_applyFailure_complete_applied.js]
 [browser_telemetry_partial_applyFailure_complete_staged_applied.js]
 [browser_telemetry_partialBadSize_complete_staged_applied.js]
 [browser_telemetry_complete_applied.js]
 [browser_telemetry_partial_applied.js]
 [browser_telemetry_partial_staged_applied.js]
 [browser_telemetry_complete_staged_applied.js]
-[browser_TelemetryUpdatePing.js]
+
+# Telemetry Update Ping Tests
+[browser_telemetry_updatePing_ready.js]
rename from toolkit/mozapps/update/tests/browser/browser_TelemetryUpdatePing.js
rename to toolkit/mozapps/update/tests/browser/browser_telemetry_updatePing_ready.js
--- a/toolkit/mozapps/update/tests/browser/browser_TelemetryUpdatePing.js
+++ b/toolkit/mozapps/update/tests/browser/browser_telemetry_updatePing_ready.js
@@ -7,49 +7,27 @@ ChromeUtils.import("resource://testing-c
 /**
  * Please note that this is really a Telemetry test, not an
  * "update UI" test like the rest of the tests in this directory.
  * This test does not live in toolkit/components/telemetry/tests to prevent
  * duplicating the code for all the test dependencies. Unfortunately, due
  * to a limitation in the build system, we were not able to simply reference
  * the dependencies as "support-files" in the test manifest.
  */
-add_task(async function testUpdatePingReady() {
-  SpecialPowers.pushPrefEnv({set: [
-    [PREF_APP_UPDATE_STAGING_ENABLED, false],
-  ]});
-  await UpdateUtils.setAppUpdateAutoEnabled(false);
-
-  let updateParams = "promptWaitTime=0";
-
+add_task(async function telemetry_updatePing_ready() {
   let archiveChecker = new TelemetryArchiveTesting.Checker();
   await archiveChecker.promiseInit();
 
-  // Trigger an "update" ping by downloading and applying an update.
-  await runUpdateTest(updateParams, 1, [
-    {
-      notificationId: "update-available",
-      button: "button",
-      beforeClick() {
-        checkWhatsNewLink(window, "update-available-whats-new");
-      },
-    },
-    {
-      notificationId: "update-restart",
-      button: "secondaryButton",
-      cleanup() {
-        AppMenuNotifications.removeNotification(/.*/);
-      },
-    },
-  ]);
+  let updateParams = "";
+  await runTelemetryUpdateTest(updateParams, "update-downloaded");
 
   // We cannot control when the ping will be generated/archived after we trigger
   // an update, so let's make sure to have one before moving on with validation.
   let updatePing;
-  await BrowserTestUtils.waitForCondition(async function() {
+  await TestUtils.waitForCondition(async function() {
     // Check that the ping made it into the Telemetry archive.
     // The test data is defined in ../data/sharedUpdateXML.js
     updatePing = await archiveChecker.promiseFindPing("update", [
         [["payload", "reason"], "ready"],
         [["payload", "targetBuildId"], "20080811053724"],
       ]);
     return !!updatePing;
   }, "Make sure the ping is generated before trying to validate it.", 500, 100);
--- a/toolkit/mozapps/update/tests/moz.build
+++ b/toolkit/mozapps/update/tests/moz.build
@@ -105,10 +105,10 @@ FINAL_TARGET_FILES += [
     'TestAUSReadStrings2.ini',
     'TestAUSReadStrings3.ini',
 ]
 
 FINAL_TARGET_PP_FILES += [
     'data/xpcshellConstantsPP.js',
 ]
 
-with Files("browser/browser_TelemetryUpdatePing.js"):
+with Files("browser/browser_telemetry_updatePing_ready.js"):
     BUG_COMPONENT = ("Toolkit", "Telemetry")