Bug 1343749 - Part 3: SimpleTest.js must be loaded before manifest.js which depends on SimpleTest. r=jib, a=test-only
authorJW Wang <jwwang@mozilla.com>
Fri, 03 Mar 2017 17:58:49 +0800
changeset 395083 c6633693bf8603a20d4c10c594d4a8e16998442f
parent 395082 3e0ce1278945aca2466bd6d8dc3683d5ef78b91d
child 395084 68168a79f3ffaffa7f03666c87bb198c9def57fc
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib, test-only
bugs1343749
milestone54.0a2
Bug 1343749 - Part 3: SimpleTest.js must be loaded before manifest.js which depends on SimpleTest. r=jib, a=test-only MozReview-Commit-ID: F46BOyRKCmh
dom/media/tests/mochitest/pc.js
dom/media/tests/mochitest/test_peerConnection_capturedVideo.html
--- a/dom/media/tests/mochitest/pc.js
+++ b/dom/media/tests/mochitest/pc.js
@@ -1884,16 +1884,17 @@ PeerConnectionWrapper.prototype = {
   }
 };
 
 // haxx to prevent SimpleTest from failing at window.onload
 function addLoadEvent() {}
 
 var scriptsReady = Promise.all([
   "/tests/SimpleTest/SimpleTest.js",
+  "../../test/manifest.js",
   "head.js",
   "templates.js",
   "turnConfig.js",
   "dataChannel.js",
   "network.js",
   "sdpUtils.js"
 ].map(script  => {
   var el = document.createElement("script");
--- a/dom/media/tests/mochitest/test_peerConnection_capturedVideo.html
+++ b/dom/media/tests/mochitest/test_peerConnection_capturedVideo.html
@@ -1,39 +1,39 @@
-<!DOCTYPE HTML>
+<!DOCTYPE HTML>
 <html>
 <head>
   <script type="application/javascript" src="pc.js"></script>
-  <script type="text/javascript" src="../../test/manifest.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
-var manager = new MediaTestManager;
 
 createHTML({
   bug: "1081409",
   title: "Captured video-only over peer connection",
   visible: true
 }).then(() => new Promise(resolve => {
+  // Run tests in sequence for log readability.
+  PARALLEL_TESTS = 1;
+  let manager = new MediaTestManager;
+  window.mediaTestManager = manager;
   manager.runTests(getPlayableVideos(gLongerTests), startTest);
   manager.onFinished = () => {
     // Tear down before SimpleTest.finish.
     if ("nsINetworkInterfaceListService" in SpecialPowers.Ci) {
       getNetworkUtils().tearDownNetwork();
     }
     resolve();
   };
 }))
 .catch(e => ok(false, "Unexpected " + e + ":\n" + e.stack));
 
-// Run tests in sequence for log readability.
-PARALLEL_TESTS = 1;
-
 function startTest(media, token) {
+  let manager = window.mediaTestManager;
   manager.started(token);
   var video = document.createElement('video');
   video.id = "id_" + media.name;
   video.width = 160;
   video.height = 120;
   video.muted = true;
   video.loop = true;
   video.preload = "metadata";