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

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

Issue 2062673002: Convert unsupported* and video-append* 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
Index: third_party/WebKit/LayoutTests/media/video-append-source.html
diff --git a/third_party/WebKit/LayoutTests/media/video-append-source.html b/third_party/WebKit/LayoutTests/media/video-append-source.html
index 5dbcb0cb911ba72f125544102216871be8c81efb..4a97b681db06c392a111b1e3ff6657bfea219364 100644
--- a/third_party/WebKit/LayoutTests/media/video-append-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-append-source.html
@@ -1,21 +1,23 @@
-<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>Verify that a media element's currentSrc is correctly set to source element's src</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");
var source = document.createElement("source");
- source.setAttribute("src", mediaFile);
+ source.src = mediaFile;
video.appendChild(source);
- testExpected("video.currentSrc", "");
+ assert_equals(video.currentSrc, "");
- waitForEvent("canplaythrough", function () {
- testExpected("stripExtension(relativeURL(video.currentSrc))", stripExtension(mediaFile));
- endTest();
+ video.oncanplaythrough = t.step_func_done(function () {
+ var currentSrc = video.currentSrc;
+ assert_equals(currentSrc.substr(currentSrc.lastIndexOf('/media/')+7), mediaFile);
});
-
-</script>
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698