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

Unified Diff: third_party/WebKit/LayoutTests/media/constructors.html

Issue 2019643002: Convert before-*, broken-* and constructors.html tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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/constructors.html
diff --git a/third_party/WebKit/LayoutTests/media/constructors.html b/third_party/WebKit/LayoutTests/media/constructors.html
index c4f70da38b0d0501026ab9a6a404459337acc50a..663483d87d5b8554e0991482e66304e42b4a206f 100644
--- a/third_party/WebKit/LayoutTests/media/constructors.html
+++ b/third_party/WebKit/LayoutTests/media/constructors.html
@@ -1,22 +1,25 @@
-<body>
-<p>Test that media constructors behave consistently.</p>
+<!DOCTYPE HTML>
+<title>Test that media constructors behave consistently.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
<video></video>
<audio></audio>
-<!-- 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>
+test(function() {
var audioJS = new Audio();
- var videoElem = document.getElementsByTagName('video')[0];
- var audioElem = document.getElementsByTagName('audio')[0];
- testExpected("audioJS instanceof HTMLAudioElement", true);
- testExpected("audioJS instanceof HTMLMediaElement", true);
- testExpected("audioJS instanceof HTMLVideoElement", false);
- testExpected("audioElem instanceof HTMLAudioElement", true);
- testExpected("audioElem instanceof HTMLMediaElement", true);
- testExpected("audioElem instanceof HTMLVideoElement", false);
- testExpected("videoElem instanceof HTMLVideoElement", true);
- testExpected("videoElem instanceof HTMLMediaElement", true);
- testExpected("videoElem instanceof HTMLAudioElement", false);
- endTest();
-</script>
+ var videoElem = document.querySelector("video");
+ var audioElem = document.querySelector("audio");
+
+ assert_true(audioJS instanceof HTMLAudioElement);
+ assert_true(audioJS instanceof HTMLMediaElement);
+ assert_false(audioJS instanceof HTMLVideoElement);
+
+ assert_true(audioElem instanceof HTMLAudioElement);
+ assert_true(audioElem instanceof HTMLMediaElement);
+ assert_false(audioElem instanceof HTMLVideoElement);
+
+ assert_true(videoElem instanceof HTMLVideoElement);
+ assert_true(videoElem instanceof HTMLMediaElement);
+ assert_false(videoElem instanceof HTMLAudioElement);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698