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

Unified Diff: third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html

Issue 2117513003: Convert video-source* 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-source-add-after-remove-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-source-add-after-remove.html
diff --git a/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html b/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html
index 7ab852c259be9b27456ea6c958414a3c5c25e71b..eb42abf5fb4f6a1130ed4655a1182627f8210d29 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-add-after-remove.html
@@ -1,25 +1,22 @@
-<!doctype html>
-<html>
- <head>
- <title>Add &lt;source> after removing failed candidate</title>
- <!-- 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>
- <script src=media-file.js></script>
- <script>
- function error()
- {
- findMediaElement();
- video.removeChild(video.firstChild);
- var source = document.createElement("source");
- source.src = findMediaFile("video", "content/test");
- video.appendChild(source);
- waitForEventAndEnd("loadedmetadata");
- }
- </script>
- </head>
+<!DOCTYPE html>
+<title>Test adding "source" after removing failed candidate loads media normally.</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 source = document.querySelector("source");
- <body>
- <video><source onerror="error()"></video>
- </body>
-</html>
+ source.onerror = t.step_func(function() {
+ video.removeChild(video.firstChild);
+ var newSource = document.createElement("source");
+ newSource.src = findMediaFile("video", "content/test");
+ video.appendChild(newSource);
+ video.onloadedmetadata = t.step_func_done();
+ });
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-source-add-after-remove-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698