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

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

Issue 2098213002: Convert video-src-[plus-source, remove, set, source].html 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-src-source.html
diff --git a/third_party/WebKit/LayoutTests/media/video-src-source.html b/third_party/WebKit/LayoutTests/media/video-src-source.html
index 3df59b5338dccf99b6f2054e20f6e555fafb2558..be84df7c1551ab3fc5bcb3bf9cf7855a9b81c8df 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-source.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-source.html
@@ -1,15 +1,22 @@
-<body>
-<video><source></source></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 that a "source" element is not used when "src" attribute is set.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video>
+ <source></source>
+</video>
<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
var mediaFile = findMediaFile("video", "content/test");
- waitForEvent('loadstart', function () {
- testExpected("stripExtension(relativeURL(video.currentSrc))", stripExtension(mediaFile));
- endTest();
- } );
- document.getElementsByTagName('source')[0].src = "content/error.mpeg";
- mediaElement.src = mediaFile;
-</script>
+
+ video.onloadstart = t.step_func_done(function() {
+ var url = video.currentSrc;
+ assert_equals(url.substr(url.lastIndexOf("/media/")+7), mediaFile);
+ });
+
+ document.querySelector("source").src = "content/error.mpeg";
+ video.src = mediaFile;
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698