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

Unified Diff: third_party/WebKit/LayoutTests/media/media-constants.html

Issue 2031503002: Convert media-captions-* and media-constants-* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/media-constants.html
diff --git a/third_party/WebKit/LayoutTests/media/media-constants.html b/third_party/WebKit/LayoutTests/media/media-constants.html
index c4b5858a7d8ef7b0d75f81e02be2429a7857b020..221bbd5f87d1da7c8da53f5c86a054de74df5e25 100644
--- a/third_party/WebKit/LayoutTests/media/media-constants.html
+++ b/third_party/WebKit/LayoutTests/media/media-constants.html
@@ -1,35 +1,23 @@
<!DOCTYPE html>
-<html>
-<head>
- <!-- 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 type="text/javascript">
- function doTest ()
- {
- testExpected("HTMLMediaElement.NETWORK_EMPTY", 0);
- testExpected("HTMLMediaElement.NETWORK_IDLE", 1);
- testExpected("HTMLMediaElement.NETWORK_LOADING", 2);
- testExpected("HTMLMediaElement.NETWORK_NO_SOURCE", 3);
- consoleWrite("");
+<title>Test HTMLMediaElement and MediaError constants.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ assert_equals(HTMLMediaElement.NETWORK_EMPTY, 0);
+ assert_equals(HTMLMediaElement.NETWORK_IDLE, 1);
+ assert_equals(HTMLMediaElement.NETWORK_LOADING, 2);
+ assert_equals(HTMLMediaElement.NETWORK_NO_SOURCE, 3);
- testExpected("HTMLMediaElement.HAVE_NOTHING", 0);
- testExpected("HTMLMediaElement.HAVE_METADATA", 1);
- testExpected("HTMLMediaElement.HAVE_CURRENT_DATA", 2);
- testExpected("HTMLMediaElement.HAVE_FUTURE_DATA", 3);
- testExpected("HTMLMediaElement.HAVE_ENOUGH_DATA", 4);
- consoleWrite("");
+ assert_equals(HTMLMediaElement.HAVE_NOTHING, 0);
+ assert_equals(HTMLMediaElement.HAVE_METADATA, 1);
+ assert_equals(HTMLMediaElement.HAVE_CURRENT_DATA, 2);
+ assert_equals(HTMLMediaElement.HAVE_FUTURE_DATA, 3);
+ assert_equals(HTMLMediaElement.HAVE_ENOUGH_DATA, 4);
- testExpected("MediaError.MEDIA_ERR_ABORTED", 1);
- testExpected("MediaError.MEDIA_ERR_NETWORK", 2);
- testExpected("MediaError.MEDIA_ERR_DECODE", 3);
- testExpected("MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED", 4);
-
- endTest();
- }
- </script>
-</head>
-<body onload="doTest()">
- <p>Test HTMLMediaElement and MediaError constants.</p>
-</body>
-</html>
+ assert_equals(MediaError.MEDIA_ERR_ABORTED, 1);
+ assert_equals(MediaError.MEDIA_ERR_NETWORK, 2);
+ assert_equals(MediaError.MEDIA_ERR_DECODE, 3);
+ assert_equals(MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED, 4);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698