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

Unified Diff: third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html

Issue 2104823002: Convert video-prefixed* and video-preload* 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-preload-none-no-stalled-event.html
diff --git a/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html b/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html
index 49d8f4ffe8cd6b4faaa3af5fb16ec4da3804a4ca..5b7bde9e19f07544a6b45e99be7a4d764334156e 100644
--- a/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html
+++ b/third_party/WebKit/LayoutTests/media/video-preload-none-no-stalled-event.html
@@ -1,21 +1,14 @@
<!DOCTYPE html>
-<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>
+<title>Test that a media element with "preload=none" doesn't fire a "stalled" event.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video preload="none"></video>
<script>
-function runTest()
-{
- findMediaElement();
-
- waitForEventAndEnd("suspend");
- waitForEventAndFail("stalled");
- consoleWrite("");
-
- video.src = findMediaFile("video", "content/test");
-}
-</script>
-<body onload="runTest()">
- <p>Test to see if a media element with preload=none dispatches a 'stalled' event.</p>
- <video preload=none></video>
-</body>
+async_test(function(t) {
+ var video = document.querySelector("video");
+ video.onsuspend = t.step_func_done();
+ video.onstalled = t.unreached_func();
+ video.src = findMediaFile("video", "content/test");
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698