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

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

Issue 2103783002: Convert video-seeking*, video-set* and video-single* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-seeking-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/video-seeking.html
diff --git a/third_party/WebKit/LayoutTests/media/video-seeking.html b/third_party/WebKit/LayoutTests/media/video-seeking.html
index 1cceb1484e38cc541c25f7e70798ee88578582f6..1976f7c16c1f4aec634704073ef3941ca28f5134 100644
--- a/third_party/WebKit/LayoutTests/media/video-seeking.html
+++ b/third_party/WebKit/LayoutTests/media/video-seeking.html
@@ -1,48 +1,30 @@
-<video controls></video>
-<p>Test that seeking attribute is true immediately after a seek,
- goes back to false when seeking completes, and that a 'seeked' event
- is fired for each seek
- </p>
-<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>
+<!DOCTYPE html>
+<title>Test that seeking attribute is true immediately after a seek, goes back to false when seeking completes, and that a "seeked" event is fired for each seek.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video></video>
<script>
-
+async_test(function(t) {
var seekedCount = 0;
-
- function seeked()
- {
+ var video = document.querySelector("video");
+ video.onwaiting = t.step_func(function() {});
+ video.onseeked = t.step_func(function() {
++seekedCount;
- consoleWrite("");
- testExpected("video.seeking", false);
- testExpected("video.currentTime", seekedCount * 0.5);
+ assert_false(video.seeking);
+ assert_equals(video.currentTime, seekedCount * 0.5);
if (seekedCount == 3) {
- endTest();
+ t.done();
return;
}
- run("video.currentTime = " + (seekedCount + 1) * 0.5);
- testExpected("video.seeking", true);
-
- consoleWrite("");
-
- }
-
- function canplaythrough()
- {
- if (seekedCount > 0)
- return;
-
- run("video.currentTime = 0.5");
- consoleWrite("");
- }
-
- waitForEvent('waiting' );
- waitForEvent('seeked', seeked );
- waitForEventOnce('canplaythrough', canplaythrough);
+ video.currentTime = (seekedCount + 1) * 0.5;
+ assert_true(video.seeking);
+ });
video.src = findMediaFile("video", "content/test");
-</script>
+ video.currentTime = 0.5;
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-seeking-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698