OLD | NEW |
1 <body> | 1 <!DOCTYPE html> |
2 <p>Test that Audio("url") constructor loads the specified resource.</p> | 2 <title>Test that Audio("url") constructor loads the specified resource.</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> | |
7 <script> | 6 <script> |
| 7 async_test(function(t) { |
8 var audioFile = findMediaFile("audio", "content/test"); | 8 var audioFile = findMediaFile("audio", "content/test"); |
9 var audio = new Audio(audioFile); | 9 var audio = new Audio(audioFile); |
10 mediaElement = audio; | |
11 | 10 |
12 testExpected("audio instanceof HTMLAudioElement", true); | 11 audio.onloadstart = t.step_func(function () { |
| 12 var url = audio.currentSrc; |
| 13 assert_equals(url.substr(url.lastIndexOf("/media/")+7), audioFile); |
| 14 }); |
13 | 15 |
14 waitForEvent("loadstart", function () { testExpected("relativeURL(audio.curr
entSrc)", audioFile); }); | 16 audio.oncanplaythrough = t.step_func_done(); |
15 | 17 }); |
16 waitForEventAndEnd("canplaythrough"); | 18 </script> |
17 </script> | |
OLD | NEW |