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

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

Issue 2079203002: Convert video-dom* tests to testharness.js. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nits 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-dom-src.html
diff --git a/third_party/WebKit/LayoutTests/media/video-dom-src.html b/third_party/WebKit/LayoutTests/media/video-dom-src.html
index cd5d3647b9dee1dd11ff03448989dd29b7583d3e..e214ce69edffafac834f2121d5d795308de64c33 100644
--- a/third_party/WebKit/LayoutTests/media/video-dom-src.html
+++ b/third_party/WebKit/LayoutTests/media/video-dom-src.html
@@ -1,18 +1,20 @@
-<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>
+<!DOCTYPE html>
+<title>Test media "src" attribute set via DOM.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video></video>
<script>
- testExpected("video.currentSrc", "");
+async_test(function(t) {
+ var video = document.querySelector("video");
+ assert_equals(video.currentSrc, "");
var mediaFile = findMediaFile("video", "content/test");
video.src = mediaFile;
- testExpected("video.currentSrc", "");
+ assert_equals(video.currentSrc, "");
- waitForEvent('canplaythrough', function () {
- testExpected("stripExtension(relativeURL(video.currentSrc))", stripExtension(mediaFile));
- endTest();
- } );
-
- video.load();
-</script>
+ video.oncanplaythrough = t.step_func_done(function() {
+ var currentSrc = video.currentSrc;
+ assert_equals(currentSrc.substr(currentSrc.lastIndexOf("/media/")+7), mediaFile);
+ });
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698