| OLD | NEW |
| 1 <body> | 1 <body> |
| 2 <p>Test that Audio() object loads the resource after src attribute is set and lo
ad() is called.</p> | 2 <p>Test that Audio() object loads the resource after src attribute is set and lo
ad() is called.</p> |
| 3 | 3 |
| 4 <script src=media-file.js></script> | 4 <script src=media-file.js></script> |
| 5 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 6 (Please avoid writing new tests using video-test.js) --> |
| 5 <script src=video-test.js></script> | 7 <script src=video-test.js></script> |
| 6 | 8 |
| 7 <script> | 9 <script> |
| 8 var audio = new Audio(); | 10 var audio = new Audio(); |
| 9 mediaElement = audio; | 11 mediaElement = audio; |
| 10 | 12 |
| 11 testExpected("audio instanceof HTMLAudioElement", true); | 13 testExpected("audio instanceof HTMLAudioElement", true); |
| 12 | 14 |
| 13 var mediaFile = findMediaFile("audio", "content/test"); | 15 var mediaFile = findMediaFile("audio", "content/test"); |
| 14 waitForEvent("loadstart", function () { testExpected("relativeURL(audio.curr
entSrc)", mediaFile); }); | 16 waitForEvent("loadstart", function () { testExpected("relativeURL(audio.curr
entSrc)", mediaFile); }); |
| 15 | 17 |
| 16 waitForEventAndEnd("canplaythrough"); | 18 waitForEventAndEnd("canplaythrough"); |
| 17 | 19 |
| 18 audio.src = mediaFile; | 20 audio.src = mediaFile; |
| 19 run("audio.load()"); | 21 run("audio.load()"); |
| 20 </script> | 22 </script> |
| OLD | NEW |