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

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
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..885df748cdf29a7ee1e12903099b92c90b62cb58 100644
--- a/third_party/WebKit/LayoutTests/media/csp-blocks-video.html
+++ b/third_party/WebKit/LayoutTests/media/csp-blocks-video.html
@@ -1,18 +1,17 @@
+<!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>
+<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.load();
foolip 2016/05/31 10:50:18 This shouldn't be needed, just setting the src att
Srirama 2016/05/31 13:23:28 Done.
+ window.onload = t.step_func_done();
foolip 2016/05/31 10:50:18 This looks either racy or assuming a bit much know
Srirama 2016/05/31 13:23:28 Done.
+});
</script>

Powered by Google App Engine
This is Rietveld 408576698