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

Unified Diff: third_party/WebKit/LayoutTests/media/video-load-preload-none.html

Issue 2077413002: Convert video-duration*, video-error* and video-load* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 6 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/video-load-preload-none.html
diff --git a/third_party/WebKit/LayoutTests/media/video-load-preload-none.html b/third_party/WebKit/LayoutTests/media/video-load-preload-none.html
index dc6184f9aef299fa57bcbc1a292fa79c979bcfe0..bc789b3a7a70a4c7389f7e8fbb4d71fdb3a7ed2b 100644
--- a/third_party/WebKit/LayoutTests/media/video-load-preload-none.html
+++ b/third_party/WebKit/LayoutTests/media/video-load-preload-none.html
@@ -1,34 +1,25 @@
-<html>
- <head>
- <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>
- <script>
- function start()
- {
- findMediaElement();
- video.src = findMediaFile("video", "content/test");
+<!DOCTYPE html>
+<title>Test that an explicit load() to a media element whose preload is set to "none" still loads the video.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video preload="none"></video>
+<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
- testExpected("video.preload", "none");
- testExpected("video.readyState", HTMLMediaElement.HAVE_NOTHING);
- waitForEventAndEnd('loadedmetadata');
+ assert_equals(video.preload, "none");
+ assert_equals(video.readyState, HTMLMediaElement.HAVE_NOTHING);
+ video.onloadedmetadata = t.unreached_func();
- // Wait 250ms before load()ing to make sure setting src does not kick off the load
- // (i.e. preload=none should still be respected).
- setTimeout(load, 250);
- }
- function load()
- {
- testExpected("video.readyState", HTMLMediaElement.HAVE_NOTHING);
- run("video.load()");
- }
- </script>
- </head>
+ // Wait 500ms before load()ing to make sure setting src does not
+ // kick off the load (i.e. preload=none should still be respected).
+ setTimeout(function() {
+ assert_equals(video.readyState, HTMLMediaElement.HAVE_NOTHING);
+ video.onloadedmetadata = t.step_func_done();
+ video.load();
+ }, 300);
- <body>
- <video preload="none"></video>
- <p>Test that an explicit load() to a media element whose preload is set to "none" still loads the video.</p>
- <script>start();</script>
- </body>
-</html>
+ video.src = findMediaFile("video", "content/test");
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698