Bug 1497929 - Await the underlying promise r=chutten
authorJan-Erik Rediger <jrediger@mozilla.com>
Wed, 10 Oct 2018 16:38:08 +0000
changeset 440570 8de1df1879492c846ae8af65f1b26c773068a031
parent 440569 8db96096643ba13f2c5e5db526de96f1cf55dddc
child 440571 119109905dc086197d08fdf0c8f6008917fe0d0a
push id70704
push userjrediger@mozilla.com
push dateWed, 10 Oct 2018 17:06:45 +0000
treeherderautoland@8de1df187949 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten
bugs1497929
milestone64.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 1497929 - Await the underlying promise r=chutten Previously, the test never waited for the notification to actually fire. Differential Revision: https://phabricator.services.mozilla.com/D8249
toolkit/components/telemetry/tests/unit/test_TelemetryController_idle.js
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryController_idle.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryController_idle.js
@@ -44,17 +44,17 @@ add_task(async function testSendPendingO
   let pendingPromise = new Promise(resolve =>
     gHttpServer.registerPrefixHandler("/submit/telemetry/", request => resolve(request)));
 
   let gatherPromise = PromiseUtils.defer();
   Services.obs.addObserver(gatherPromise.resolve, "gather-telemetry");
 
   // Check that we are correctly receiving the gather-telemetry notification.
   TelemetrySession.observe(null, "idle-daily", null);
-  await gatherPromise;
+  await gatherPromise.promise;
   Assert.ok(true, "Received gather-telemetry notification.");
 
   Services.obs.removeObserver(gatherPromise.resolve, "gather-telemetry");
 
   // Check that the pending ping is correctly received.
   let ns = {};
   let module = ChromeUtils.import("resource://gre/modules/TelemetrySend.jsm", ns);
   module.TelemetrySendImpl.observe(null, "idle-daily", null);