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..3c78db13c60f4a424a4562c7fb75549b794aeaa8 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-EME-content.html |
@@ -0,0 +1,30 @@ |
+<!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'); |
+ |
+ const onEncrypted = this.step_func_done(); |
miu
2016/05/13 23:40:35
I didn't know JavaScript had const! Cool! :)
Howe
mcasas
2016/05/14 02:23:47
const-ness rules!
|
+ |
+ assert_equals(video.error, null); |
+ assert_equals(video.mediaKeys, null); |
+ video.onencrypted = onEncrypted; |
+ |
+ 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> |