Bug 1444007 - Remove race condition in browser_devices_get_user_media_multi_process.js. r?arai
MozReview-Commit-ID: 8cvuI8a984p
--- 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
@@ -181,27 +181,26 @@ 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 hidden");
is(webrtcUI.getActiveStreams(true).length, 2, "2 active camera streams");
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).length == 1),
+ ]);
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 hidden");
- is(webrtcUI.getActiveStreams(true).length, 1, "1 active camera stream");
is(webrtcUI.getActiveStreams(true, true, true).length, 1, "1 active stream");
await checkSharingUI({video: 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.