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

Side by Side Diff: third_party/WebKit/LayoutTests/media/audio-constructor-preload.html

Issue 1997263002: Convert audio-constructor* 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 unified diff | Download patch
OLDNEW
1 <html> 1 <!DOCTYPE html>
2 <head> 2 <title>Test that Audio() sets "preload" attribute.</title>
3 <script src=media-file.js></script> 3 <script src="media-file.js"></script>
4 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 4 <script src="../resources/testharness.js"></script>
5 (Please avoid writing new tests using video-test.js) --> 5 <script src="../resources/testharnessreport.js"></script>
6 <script src=video-test.js></script> 6 <script>
7 async_test(function(t) {
8 var audio = new Audio();
7 9
8 <script> 10 // Test initial attribute value.
11 assert_equals(audio.getAttribute("preload"), "auto");
12 assert_equals(audio.preload, "auto");
9 13
10 function canplaythrough() 14 audio.oncanplaythrough = t.step_func_done(function() {
11 { 15 assert_equals(audio.getAttribute("preload"), "auto");
12 consoleWrite("++ Test after 'canplaythrough' event"); 16 assert_equals(audio.preload, "auto");
13 testExpected("mediaElement.getAttribute('preload')", "auto"); 17 });
14 testExpected("mediaElement.preload", "auto");
15 endTest();
16 }
17 18
18 function start() 19 audio.src = findMediaFile("audio", "content/test");
19 { 20 audio.load();
20 run("mediaElement = new Audio()"); 21 });
21 consoleWrite(""); 22 </script>
22
23 consoleWrite("++ Test initial attribute value");
24 testExpected("mediaElement.getAttribute('preload')", "auto");
25 testExpected("mediaElement.preload", "auto");
26 consoleWrite("");
27
28 mediaElement.addEventListener("canplaythrough", canplaythrough);
29 run("mediaElement.src = '" + findMediaFile("audio", "content/tes t") + "'");
30 run("mediaElement.load()");
31
32 consoleWrite("");
33 }
34
35 </script>
36 </head>
37
38 <body onload="start()">
39 <p>Test that Audio() sets 'preload' attribute.</p>
40 </body>
41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698