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

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

Issue 2121453003: Convert video-source-error* and video-source-inserted* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nit 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-source-inserted.html
diff --git a/third_party/WebKit/LayoutTests/media/video-source-inserted.html b/third_party/WebKit/LayoutTests/media/video-source-inserted.html
index 7c93d324022987cf068203640421edca0b1b703e..f6a23e86e3c284f2a0c9464368adfd561c09f611 100644
--- a/third_party/WebKit/LayoutTests/media/video-source-inserted.html
+++ b/third_party/WebKit/LayoutTests/media/video-source-inserted.html
@@ -1,31 +1,22 @@
-<!doctype html>
-<html>
- <head>
- <title>networkState after inserting &lt;source&gt; test</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>
- </head>
- <body>
- <video controls><source></video>
+<!DOCTYPE html>
+<title>Test that an empty "source" inserted when networkState is NETWORK_EMPTY triggers resource selection, immediately changing networkState to NETWORK_NO_SOURCE.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<video>
+ <source></source>
+</video>
+<script>
+test(function() {
+ // "source" inserted by the parser.
+ var video = document.querySelector("video");
+ assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE);
- <p>Test that a &lt;source&gt; inserted when networkState is NETWORK_NO_SOURCE triggers
- resource selection, immediately changing networkState to NETWORK_NO_SOURCE.</p>
+ // "video" created with script.
+ video = document.createElement("video");
+ assert_equals(video.networkState, HTMLMediaElement.NETWORK_EMPTY);
- <script>
- consoleWrite("&lt;source&gt; inserted by the parser.");
- video = document.querySelector('video');
- testExpected("video.networkState", HTMLMediaElement.prototype.NETWORK_NO_SOURCE, "==");
-
- consoleWrite("<br>&lt;video&gt; created with script.");
- video = document.createElement('video');
- testExpected("video.networkState", HTMLMediaElement.prototype.NETWORK_EMPTY, "==");
- consoleWrite("&lt;source&gt; inserted by script.");
- video.appendChild(document.createElement('source'));
- testExpected("video.networkState", HTMLMediaElement.prototype.NETWORK_NO_SOURCE, "==");
- if (window.testRunner)
- testRunner.notifyDone();
- </script>
-
- </body>
-</html>
+ // "source" inserted by script.
+ video.appendChild(document.createElement("source"));
+ assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698