Index: third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-EME-content.html |
diff --git a/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-EME-content.html b/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-EME-content.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0c2b0db96c335137f146a5f770577a449bf1a97f |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-EME-content.html |
@@ -0,0 +1,28 @@ |
+<!DOCTYPE html> |
+<script src=../../resources/testharness.js></script> |
+<script src=../../resources/testharnessreport.js></script> |
+<script> |
+ |
+// Run createStream() on a <video> source with protected content. |
+ |
+test(function() { |
+ var video = document.createElement('video'); |
+ |
+ assert_equals(video.error, null); |
+ assert_equals(video.mediaKeys, null); |
+ video.onencrypted = this.step_func_done(); |
+ |
+ navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).then(function(access) { |
+ return access.createMediaKeys(); |
+ }).then(function(mediaKeys) { |
+ return video.setMediaKeys(mediaKeys); |
+ }).then(function(result) { |
+ video.src = "../../media/content/test-encrypted.webm"; |
+ assert_throws("NotSupportedError", |
+ function() { var stream = video.captureStream(); }, |
+ "Cannot create a captureStream() out of a protected <video>"); |
+ }); |
+ |
+}, 'check <video> captureStream() fails on an encrypted/protected media'); |
+ |
+</script> |