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..f0c35f6354c058c3133a18dddc3a92bf9b0e7bba 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(); |
+ }, 500); |
Srirama
2016/06/20 13:56:39
Intentionally changed it to give enough time to fi
fs
2016/06/20 14:32:25
Hmm, this means the test will take twice as long t
Srirama
2016/06/21 05:07:40
ok, tuned it to 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> |