Bug 1071482 - Rename test_encryptedMediaExtensions to test_eme_playback to make it easier to run all eme tests with a wildcard. r=edwin
authorChris Pearce <cpearce@mozilla.com>
Tue, 28 Oct 2014 13:21:12 +1300
changeset 213052 396575d789e430d815fd2ab1126c165db19d2629
parent 213051 34d86b491ac16a7322a66d3f6362761349bd510b
child 213053 971beced9390898a5cad30a5b963d4565435f1f6
push id27738
push usercbook@mozilla.com
push dateThu, 30 Oct 2014 13:46:07 +0000
treeherdermozilla-central@1aa1b23d799e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1071482
milestone36.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 1071482 - Rename test_encryptedMediaExtensions to test_eme_playback to make it easier to run all eme tests with a wildcard. r=edwin
dom/media/test/mochitest.ini
dom/media/test/test_eme_playback.html
dom/media/test/test_encryptedMediaExtensions.html
--- a/dom/media/test/mochitest.ini
+++ b/dom/media/test/mochitest.ini
@@ -356,17 +356,17 @@ skip-if = (toolkit == 'android' && proce
 [test_contentDuration7.html]
 [test_controls.html]
 [test_currentTime.html]
 [test_decode_error.html]
 [test_decoder_disable.html]
 [test_defaultMuted.html]
 [test_delay_load.html]
 skip-if = buildapp == 'b2g' && toolkit != 'gonk' # bug 1082984
-[test_encryptedMediaExtensions.html]
+[test_eme_playback.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # bug 1043403, bug 1057908
 [test_error_in_video_document.html]
 skip-if = toolkit == 'android' || (os == 'win' && !debug) || (os == 'mac' && !debug) # bug 608634
 [test_error_on_404.html]
 [test_fastSeek.html]
 skip-if = (toolkit == 'android' && processor == 'x86') #x86 only bug 914439
 [test_fastSeek-forwards.html]
 [test_imagecapture.html]
rename from dom/media/test/test_encryptedMediaExtensions.html
rename to dom/media/test/test_eme_playback.html
--- a/dom/media/test/test_encryptedMediaExtensions.html
+++ b/dom/media/test/test_eme_playback.html
@@ -8,81 +8,81 @@
   <script type="text/javascript" src="eme.js"></script>
 </head>
 <body>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 var manager = new MediaTestManager;
 
 
-function KeysChangeFunc(session, keys) {
+function KeysChangeFunc(session, keys, token) {
   session.keyIdsReceived = [];
   for (var keyid in keys) {
     info("Set " + keyid + " to false in session.keyIdsReceived");
     session.keyIdsReceived[keyid] = false;
   }
   return function(ev) {
     var session = ev.target;
     session.gotKeysChanged = true;
     session.getUsableKeyIds().then(function(keyIds) {
       for (var k = 0; k < keyIds.length; k++) {
         var kid = Base64ToHex(window.btoa(ArrayBufferToString(keyIds[k])));
-        ok(kid in session.keyIdsReceived, "session.keyIdsReceived contained " + kid + " as expected.");
+        ok(kid in session.keyIdsReceived, token + " session.keyIdsReceived contained " + kid + " as expected.");
         session.keyIdsReceived[kid] = true;
       }
     }, bail("Failed to get keyIds"));
   }
 }
 
 function startTest(test, token)
 {
-  manager.started(test._token);
+  manager.started(token);
 
   var sessions = [];
 
   var v = SetupEME(test, token,
     {
       onsessioncreated: function(session) {
         sessions.push(session);
-        session.addEventListener("keyschange", KeysChangeFunc(session, test.keys), false);
+        session.addEventListener("keyschange", KeysChangeFunc(session, test.keys, token), false);
       }
     }
   );
-  
+
   var gotEncrypted = false;
   var gotPlaying = false;
 
   v.addEventListener("encrypted", function(ev) {
     ok(MediaKeys.isTypeSupported(KEYSYSTEM_TYPE, ev.initDataType, test.type),
        token + " MediaKeys should support this keysystem");
     gotEncrypted = true;
   });
 
   v.addEventListener("playing", function () { gotPlaying = true; });
 
   v.addEventListener("ended", function(ev) {
     ok(true, token + " got ended event");
-    manager.finished(test._token);
+    manager.finished(token);
 
     ok(gotEncrypted, token + " encrypted event should have fired");
     ok(gotPlaying, token + " playing event should have fired");
 
     ok(Math.abs(test.duration - v.duration) < 0.1,
        token + " Duration of video should be corrrect");
     ok(Math.abs(test.duration - v.currentTime) < 0.1,
        token + " Current time should be same as duration");
 
     // Verify all sessions had all keys went sent the to the CDM usable, and thus
     // that we received keyschange event(s).
     is(sessions.length, 1, "should have 1 session");
     for (var i = 0; i < sessions.length; i++) {
       var session = sessions[i];
-      ok(session.gotKeysChanged, "Should have received at least one keychange event");
+      ok(session.gotKeysChanged, token + " should have received at least one keychange event");
       for (var kid in session.keyIdsReceived) {
-        ok(session.keyIdsReceived[kid], "key with id " + kid + " was usable as expected");
+        ok(session.keyIdsReceived[kid], token + " key with id " + kid + " was usable as expected");
       }
     }
 
    });
 
   v.addEventListener("error", bail(token + " got error event"));
 
   LoadTest(test, v).then(function(){v.play();}, bail(token + " failed to load"));