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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-id.html

Issue 1927223002: Convert track tests from video-test.js to testharness.js based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/track/track-id.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-id.html b/third_party/WebKit/LayoutTests/media/track/track-id.html
index f2b25d41731a89c055e1f76ea576f4fdd36eb433..6edeebcf08b884b9da8b2ae29e5648fd9951fe44 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-id.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-id.html
@@ -1,44 +1,27 @@
<!DOCTYPE html>
-<html>
- <head>
-
- <script src=../media-file.js></script>
- <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
- <script src=../video-test.js></script>
- <script>
-
- var textTrack;
-
- function start()
- {
- findMediaElement();
- consoleWrite("");
-
- textTrack = document.getElementById("LoremIpsum").track;
-
- consoleWrite("<b>++ Test default attribute value</b>");
- testExpected("textTrack.id", "LoremIpsum");
- testExpected("video.textTracks[0].id", "LoremIpsum");
- consoleWrite("");
-
- consoleWrite("<b>++ Make sure we can look tracks up by id</b>");
- testExpected("video.textTracks.getTrackById('LoremIpsum')", textTrack);
- consoleWrite("");
-
- consoleWrite("<b>++ Test that it's readonly</b>");
- run("textTrack.id = 'newvalue';");
- testExpected("textTrack.id", "LoremIpsum");
-
- endTest();
- }
-
- </script>
- </head>
- <body >
- <p>Tests that the TextTrack "id" attribute is appropriately set.</p>
- <video>
- <track id="LoremIpsum" src="captions-webvtt/captions-fast.vtt" onload="start()" default>
- </video>
- </body>
-</html>
+<title>Tests that the TextTrack "id" attribute is set appropriately.</title>
+<video>
+ <track id="LoremIpsum" src="captions-webvtt/captions-fast.vtt" default>
+</video>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ var video = document.querySelector("video");
+
+ var track = document.querySelector("track");
+
+ var textTrack = track.track;
+
+ // Test default attribute value.
+ assert_equals(textTrack.id, "LoremIpsum");
+ assert_equals(video.textTracks[0].id, "LoremIpsum");
+
+ // Make sure we can look up tracks by id.
+ assert_equals(video.textTracks.getTrackById("LoremIpsum"), textTrack);
+
+ // Test that it's readonly.
+ textTrack.id = "newvalue";
mlamouri (slow - plz ping) 2016/04/29 12:42:11 I'm surprised this doesn't actually throws an exce
Srirama 2016/04/29 13:21:24 Yes, i didn't debug further but just noted it down
+ assert_equals(textTrack.id, "LoremIpsum");
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698