# HG changeset patch # User Tooru Fujisawa # Date 1523239081 -32400 # Node ID bfc452f47794b2d9b38a0dfe2b755858235048ff # Parent e15cceecd70379bbca751c0b0c46598491b2a327 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 diff --git 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 --- 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 @@ -81,28 +81,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 promiseWaitForCondition(() => !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();