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

Unified Diff: third_party/WebKit/LayoutTests/media/video-src-set.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-set.html
diff --git a/third_party/WebKit/LayoutTests/media/video-src-set.html b/third_party/WebKit/LayoutTests/media/video-src-set.html
index 3b095f947d415a86ccea53725e900229276b324e..5bf8e00ce3afb0bb800f2be4e976037bc41d4de9 100644
--- a/third_party/WebKit/LayoutTests/media/video-src-set.html
+++ b/third_party/WebKit/LayoutTests/media/video-src-set.html
@@ -1,17 +1,19 @@
-<video controls></video>
-<div>Test that setting src attribute triggers load</div>
-<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 setting "src" attribute triggers load.</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 video = document.querySelector("video");
var mediaFile = findMediaFile("video", "content/test");
- video.setAttribute('src', mediaFile);
- waitForEvent('loadstart', function () {
- testExpected("stripExtension(relativeURL(video.currentSrc))", stripExtension(mediaFile));
- endTest();
- } );
+ video.onloadstart = t.step_func_done(function() {
+ var url = video.currentSrc;
+ assert_equals(url.substr(url.lastIndexOf("/media/")+7), mediaFile);
+ });
- video.setAttribute('src', mediaFile);
-</script>
+ video.src = mediaFile;
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698