Bug 1138294 - Split eme_stream_blocked test in 3 parts; will deal with overload issue separately. r=edwin
authorGerald Squelart <gsquelart@mozilla.com>
Fri, 12 Jun 2015 10:23:29 -0400
changeset 266706 d8de74f7206770f696e0dc2dc532c441dc3b9ddc
parent 266705 2a43ebb506692a7b4a94e54c00faecf75240694b
child 266707 141c6315de6a7e4f6cf300dbb853711b596ffe5b
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1138294
milestone41.0a1
Bug 1138294 - Split eme_stream_blocked test in 3 parts; will deal with overload issue separately. r=edwin
dom/media/test/mochitest.ini
dom/media/test/test_eme_stream_capture_blocked.html
dom/media/test/test_eme_stream_capture_blocked_case1.html
dom/media/test/test_eme_stream_capture_blocked_case2.html
dom/media/test/test_eme_stream_capture_blocked_case3.html
--- a/dom/media/test/mochitest.ini
+++ b/dom/media/test/mochitest.ini
@@ -624,17 +624,23 @@ skip-if = toolkit == 'android' # bug 104
 # functionality being tested by this test. We should still test other observers
 # in future however, so I'm not removing the test, just disabling it.
 [test_eme_persistent_sessions.html]
 skip-if = toolkit == 'android' # bug 1043403
 [test_eme_playback.html]
 skip-if = toolkit == 'android' # bug 1043403
 [test_eme_requestKeySystemAccess.html]
 skip-if = toolkit == 'android' # bug 1043403
-[test_eme_stream_capture_blocked.html]
+[test_eme_stream_capture_blocked_case1.html]
+tags=msg capturestream
+skip-if = toolkit == 'android' || (os == 'win' && !debug) # bug 1043403, bug 1140675
+[test_eme_stream_capture_blocked_case2.html]
+tags=msg capturestream
+skip-if = toolkit == 'android' || (os == 'win' && !debug) # bug 1043403, bug 1140675
+[test_eme_stream_capture_blocked_case3.html]
 tags=msg capturestream
 skip-if = toolkit == 'android' || (os == 'win' && !debug) # bug 1043403, bug 1140675
 [test_empty_resource.html]
 [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
rename from dom/media/test/test_eme_stream_capture_blocked.html
rename to dom/media/test/test_eme_stream_capture_blocked_case1.html
--- a/dom/media/test/test_eme_stream_capture_blocked.html
+++ b/dom/media/test/test_eme_stream_capture_blocked_case1.html
@@ -29,55 +29,16 @@ function startTest(test, token)
   var context = new AudioContext();
   var node = context.createMediaElementSource(v1);
   v1.addEventListener("loadeddata", function(ev) {
     ok(false, TimeStamp(case1token) + " should never reach loadeddata, as setMediaKeys should fail");
   });
   manager.started(case1token);
   LoadTestWithManagedLoadToken(test, v1, manager, case1token,
                                { onlyLoadFirstFragments:2, noEndOfStream:true });
-
-
-  // Case 2. creating a MediaElementSource on a media element with a MediaKeys should fail.
-  var case2token = token + "_case2";
-  var v2 = SetupEME(test, case2token);
-  v2.addEventListener("loadeddata", function(ev) {
-    ok(true, case2token + " should reach loadeddata");
-    var threw = false;
-    try {
-      var context = new AudioContext();
-      var node = context.createMediaElementSource(v2);
-    } catch (e) {
-      threw = true;
-    }
-    ok(threw, "Should throw an error creating a MediaElementSource on an EME video.");
-    manager.finished(case2token);
-  });
-  manager.started(case2token);
-  LoadTestWithManagedLoadToken(test, v2, manager, case2token,
-                               { onlyLoadFirstFragments:2, noEndOfStream:true });
-
-
-  // Case 3. capturing a media element with mozCaptureStream that has a MediaKeys should fail.
-  var case3token = token + "_case3";
-  var v3 = SetupEME(test, case3token);
-  v3.addEventListener("loadeddata", function(ev) {
-    ok(true, TimeStamp(case3token) + " should reach loadeddata");
-    var threw = false;
-    try {
-      var stream = v3.mozCaptureStreamUntilEnded();
-    } catch (e) {
-      threw = true;
-    }
-    ok(threw, TimeStamp(case3token) + " Should throw an error calling mozCaptureStreamUntilEnded an EME video.");
-    manager.finished(case3token);
-  });
-  manager.started(case3token);
-  LoadTestWithManagedLoadToken(test, v3, manager, case3token,
-                               { onlyLoadFirstFragments:2, noEndOfStream:true });
 }
 
 function beginTest() {
   manager.runTests(gEMETests, startTest);
 }
 
 SimpleTest.waitForExplicitFinish();
 SetupEMEPref(beginTest);
copy from dom/media/test/test_eme_stream_capture_blocked.html
copy to dom/media/test/test_eme_stream_capture_blocked_case2.html
--- a/dom/media/test/test_eme_stream_capture_blocked.html
+++ b/dom/media/test/test_eme_stream_capture_blocked_case2.html
@@ -14,33 +14,16 @@ var manager = new MediaTestManager;
 
 function startTest(test, token)
 {
   // Three cases:
   // 1. setting MediaKeys on an element captured by MediaElementSource should fail, and
   // 2. creating a MediaElementSource on a media element with a MediaKeys should fail, and
   // 3. capturing a media element with mozCaptureStream that has a MediaKeys should fail.
 
-  // Case 1. setting MediaKeys on an element captured by MediaElementSource should fail.
-  var case1token = token + "_case1";
-  var setKeysFailed = function() {
-    ok(true, TimeStamp(case1token) + " setMediaKeys failed as expected.");
-    manager.finished(case1token);
-  };
-  var v1 = SetupEME(test, case1token,  { onSetKeysFail: setKeysFailed });
-  var context = new AudioContext();
-  var node = context.createMediaElementSource(v1);
-  v1.addEventListener("loadeddata", function(ev) {
-    ok(false, TimeStamp(case1token) + " should never reach loadeddata, as setMediaKeys should fail");
-  });
-  manager.started(case1token);
-  LoadTestWithManagedLoadToken(test, v1, manager, case1token,
-                               { onlyLoadFirstFragments:2, noEndOfStream:true });
-
-
   // Case 2. creating a MediaElementSource on a media element with a MediaKeys should fail.
   var case2token = token + "_case2";
   var v2 = SetupEME(test, case2token);
   v2.addEventListener("loadeddata", function(ev) {
     ok(true, case2token + " should reach loadeddata");
     var threw = false;
     try {
       var context = new AudioContext();
@@ -49,35 +32,16 @@ function startTest(test, token)
       threw = true;
     }
     ok(threw, "Should throw an error creating a MediaElementSource on an EME video.");
     manager.finished(case2token);
   });
   manager.started(case2token);
   LoadTestWithManagedLoadToken(test, v2, manager, case2token,
                                { onlyLoadFirstFragments:2, noEndOfStream:true });
-
-
-  // Case 3. capturing a media element with mozCaptureStream that has a MediaKeys should fail.
-  var case3token = token + "_case3";
-  var v3 = SetupEME(test, case3token);
-  v3.addEventListener("loadeddata", function(ev) {
-    ok(true, TimeStamp(case3token) + " should reach loadeddata");
-    var threw = false;
-    try {
-      var stream = v3.mozCaptureStreamUntilEnded();
-    } catch (e) {
-      threw = true;
-    }
-    ok(threw, TimeStamp(case3token) + " Should throw an error calling mozCaptureStreamUntilEnded an EME video.");
-    manager.finished(case3token);
-  });
-  manager.started(case3token);
-  LoadTestWithManagedLoadToken(test, v3, manager, case3token,
-                               { onlyLoadFirstFragments:2, noEndOfStream:true });
 }
 
 function beginTest() {
   manager.runTests(gEMETests, startTest);
 }
 
 SimpleTest.waitForExplicitFinish();
 SetupEMEPref(beginTest);
copy from dom/media/test/test_eme_stream_capture_blocked.html
copy to dom/media/test/test_eme_stream_capture_blocked_case3.html
--- a/dom/media/test/test_eme_stream_capture_blocked.html
+++ b/dom/media/test/test_eme_stream_capture_blocked_case3.html
@@ -14,53 +14,16 @@ var manager = new MediaTestManager;
 
 function startTest(test, token)
 {
   // Three cases:
   // 1. setting MediaKeys on an element captured by MediaElementSource should fail, and
   // 2. creating a MediaElementSource on a media element with a MediaKeys should fail, and
   // 3. capturing a media element with mozCaptureStream that has a MediaKeys should fail.
 
-  // Case 1. setting MediaKeys on an element captured by MediaElementSource should fail.
-  var case1token = token + "_case1";
-  var setKeysFailed = function() {
-    ok(true, TimeStamp(case1token) + " setMediaKeys failed as expected.");
-    manager.finished(case1token);
-  };
-  var v1 = SetupEME(test, case1token,  { onSetKeysFail: setKeysFailed });
-  var context = new AudioContext();
-  var node = context.createMediaElementSource(v1);
-  v1.addEventListener("loadeddata", function(ev) {
-    ok(false, TimeStamp(case1token) + " should never reach loadeddata, as setMediaKeys should fail");
-  });
-  manager.started(case1token);
-  LoadTestWithManagedLoadToken(test, v1, manager, case1token,
-                               { onlyLoadFirstFragments:2, noEndOfStream:true });
-
-
-  // Case 2. creating a MediaElementSource on a media element with a MediaKeys should fail.
-  var case2token = token + "_case2";
-  var v2 = SetupEME(test, case2token);
-  v2.addEventListener("loadeddata", function(ev) {
-    ok(true, case2token + " should reach loadeddata");
-    var threw = false;
-    try {
-      var context = new AudioContext();
-      var node = context.createMediaElementSource(v2);
-    } catch (e) {
-      threw = true;
-    }
-    ok(threw, "Should throw an error creating a MediaElementSource on an EME video.");
-    manager.finished(case2token);
-  });
-  manager.started(case2token);
-  LoadTestWithManagedLoadToken(test, v2, manager, case2token,
-                               { onlyLoadFirstFragments:2, noEndOfStream:true });
-
-
   // Case 3. capturing a media element with mozCaptureStream that has a MediaKeys should fail.
   var case3token = token + "_case3";
   var v3 = SetupEME(test, case3token);
   v3.addEventListener("loadeddata", function(ev) {
     ok(true, TimeStamp(case3token) + " should reach loadeddata");
     var threw = false;
     try {
       var stream = v3.mozCaptureStreamUntilEnded();