Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: third_party/WebKit/LayoutTests/media/csp-blocks-video.html

Issue 2024533002: Convert csp-*, event-* and invalid-* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/csp-blocks-video-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/csp-blocks-video.html
diff --git a/third_party/WebKit/LayoutTests/media/csp-blocks-video.html b/third_party/WebKit/LayoutTests/media/csp-blocks-video.html
index aa6eea8060f42740bb7aa4f395ead01ad27b183a..edf8396299a4cf7ff4f178acd404e2757ac3a199 100644
--- a/third_party/WebKit/LayoutTests/media/csp-blocks-video.html
+++ b/third_party/WebKit/LayoutTests/media/csp-blocks-video.html
@@ -1,18 +1,16 @@
+<!DOCTYPE html>
+<title>Test that "Content-Security-Policy" on a media element is obeyed.</title>
<meta http-equiv="Content-Security-Policy" content="media-src 'none'">
-<video controls></video>
-<script src=media-file.js></script>
-<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
-<script src=video-test.js></script>
-<p>This test passes if it doesn't alert failure.</p>
+<video></video>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
<script>
-var mediaFile = findMediaFile("video", "content/test");
-video.src = mediaFile;
+async_test(function(t) {
+ var video = document.querySelector("video");
+ video.src = findMediaFile("video", "content/test");
-waitForEvent('loadedmetadata', function () {
- alert('FAIL');
- endTest();
-} );
-video.load();
-addEventListener('load', endTest, false);
+ video.onloadedmetadata = t.unreached_func();
+ video.onerror = t.step_func_done();
+});
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/csp-blocks-video-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698