Bug 1450163 - Wait for the end of the second tab streams before checking the number of streams and indicator in browser/base/content/test/webrtc/browser_devices_get_user_media_multi_process.js. r=dao
authorTooru Fujisawa <arai_a@mac.com>
Mon, 09 Apr 2018 10:58:01 +0900
changeset 412319 bfc452f47794b2d9b38a0dfe2b755858235048ff
parent 412318 a3555e4774717ea62b9bf66f41d24d0d58e4c863
child 412320 d00dacc41af0e609eb2d506cbb0fb4852a7b5461
push id101885
push userarai_a@mac.com
push dateMon, 09 Apr 2018 01:58:40 +0000
treeherdermozilla-inbound@bfc452f47794 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1450163
milestone61.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 1450163 - Wait for the end of the second tab streams before checking the number of streams and indicator in browser/base/content/test/webrtc/browser_devices_get_user_media_multi_process.js. r=dao
browser/base/content/test/webrtc/browser_devices_get_user_media_multi_process.js
--- a/browser/base/content/test/webrtc/browser_devices_get_user_media_multi_process.js
+++ b/browser/base/content/test/webrtc/browser_devices_get_user_media_multi_process.js
@@ -78,28 +78,29 @@ var gTests = [
     ok(webrtcUI.showGlobalIndicator, "webrtcUI wants the global indicator shown");
     ok(webrtcUI.showCameraIndicator, "webrtcUI wants the camera indicator shown");
     ok(webrtcUI.showMicrophoneIndicator, "webrtcUI wants the mic indicator shown");
     is(webrtcUI.getActiveStreams(false, true).length, 1, "1 active audio stream");
     is(webrtcUI.getActiveStreams(true).length, 1, "1 active video stream");
     is(webrtcUI.getActiveStreams(true, true, true).length, 2, "2 active streams");
 
     info("removing the second tab");
-    // FIXME: This should wait for indicator update instead (bug 1444007).
-    let sessionStorePromise = BrowserTestUtils.waitForSessionStoreUpdate(tab);
+
     BrowserTestUtils.removeTab(tab);
-    await sessionStorePromise;
 
     // Check that we still show the sharing indicators for the first tab's stream.
-    await TestUtils.waitForCondition(() => !webrtcUI.showCameraIndicator);
+    await Promise.all([
+      TestUtils.waitForCondition(() => !webrtcUI.showCameraIndicator),
+      TestUtils.waitForCondition(() => webrtcUI.getActiveStreams(true, true, true).length == 1),
+    ]);
+
     ok(webrtcUI.showGlobalIndicator, "webrtcUI wants the global indicator shown");
     ok(!webrtcUI.showCameraIndicator, "webrtcUI wants the camera indicator hidden");
     ok(webrtcUI.showMicrophoneIndicator, "webrtcUI wants the mic indicator shown");
     is(webrtcUI.getActiveStreams(false, true).length, 1, "1 active audio stream");
-    is(webrtcUI.getActiveStreams(true, true, true).length, 1, "1 active stream");
 
     await checkSharingUI({audio: true});
 
     // When both tabs use the same content process, the frame script for the
     // first tab receives observer notifications for things happening in the
     // second tab, so let's clear the observer call counts before we cleanup
     // in the first tab.
     await ignoreObserversCalled();