Bug 1353910 - Fix browser_devices_get_user_media_multi_process.js. r=florian
MozReview-Commit-ID: UV4B1qiCk0
--- 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
@@ -1,16 +1,12 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-registerCleanupFunction(function() {
- gBrowser.removeCurrentTab();
-});
-
var gTests = [
{
desc: "getUserMedia audio in a first process + video in a second process",
run: function* checkMultiProcess() {
// The main purpose of this test is to ensure webrtc sharing indicators
// work with multiple content processes, but it makes sense to run this
// test without e10s too to ensure using webrtc devices in two different
@@ -113,41 +109,14 @@ var gTests = [
ok(!webrtcUI.showGlobalIndicator, "webrtcUI wants the global indicator hidden");
is(webrtcUI.getActiveStreams(true, true, true).length, 0, "0 active streams");
}
},
];
-function test() {
- waitForExplicitFinish();
-
- let tab = gBrowser.addTab();
- gBrowser.selectedTab = tab;
- let browser = tab.linkedBrowser;
-
- browser.messageManager.loadFrameScript(CONTENT_SCRIPT_HELPER, true);
-
- browser.addEventListener("load", function() {
- is(PopupNotifications._currentNotifications.length, 0,
- "should start the test without any prior popup notification");
- ok(gIdentityHandler._identityPopup.hidden,
- "should start the test with the control center hidden");
-
- Task.spawn(function* () {
- yield SpecialPowers.pushPrefEnv({"set": [[PREF_PERMISSION_FAKE, true]]});
-
- for (let testCase of gTests) {
- info(testCase.desc);
- yield testCase.run();
- }
- }).then(finish, ex => {
- Cu.reportError(ex);
- ok(false, "Unexpected Exception: " + ex);
- finish();
- });
- }, {capture: true, once: true});
+add_task(async function test() {
let rootDir = getRootDirectory(gTestPath);
rootDir = rootDir.replace("chrome://mochitests/content/",
"https://example.com/");
- content.location = rootDir + "get_user_media.html";
-}
+ await runTests(gTests, rootDir + "get_user_media.html");
+});