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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
1 <body> 1 <!DOCTYPE HTML>
2 <p>Test that media constructors behave consistently.</p> 2 <title>Test that media constructors behave consistently.</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
3 <video></video> 5 <video></video>
4 <audio></audio> 6 <audio></audio>
5 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
6 (Please avoid writing new tests using video-test.js) -->
7 <script src=video-test.js></script>
8 <script> 7 <script>
8 test(function() {
9 var audioJS = new Audio(); 9 var audioJS = new Audio();
10 var videoElem = document.getElementsByTagName('video')[0]; 10 var videoElem = document.querySelector("video");
11 var audioElem = document.getElementsByTagName('audio')[0]; 11 var audioElem = document.querySelector("audio");
12 testExpected("audioJS instanceof HTMLAudioElement", true); 12
13 testExpected("audioJS instanceof HTMLMediaElement", true); 13 assert_true(audioJS instanceof HTMLAudioElement);
14 testExpected("audioJS instanceof HTMLVideoElement", false); 14 assert_true(audioJS instanceof HTMLMediaElement);
15 testExpected("audioElem instanceof HTMLAudioElement", true); 15 assert_false(audioJS instanceof HTMLVideoElement);
16 testExpected("audioElem instanceof HTMLMediaElement", true); 16
17 testExpected("audioElem instanceof HTMLVideoElement", false); 17 assert_true(audioElem instanceof HTMLAudioElement);
18 testExpected("videoElem instanceof HTMLVideoElement", true); 18 assert_true(audioElem instanceof HTMLMediaElement);
19 testExpected("videoElem instanceof HTMLMediaElement", true); 19 assert_false(audioElem instanceof HTMLVideoElement);
20 testExpected("videoElem instanceof HTMLAudioElement", false); 20
21 endTest(); 21 assert_true(videoElem instanceof HTMLVideoElement);
22 </script> 22 assert_true(videoElem instanceof HTMLMediaElement);
23 assert_false(videoElem instanceof HTMLAudioElement);
24 });
25 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698