| OLD | NEW |
| 1 <!doctype html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <title>Test adding "source" after removing failed candidate loads media normally
.</title> |
| 3 <head> | 3 <script src="../resources/testharness.js"></script> |
| 4 <title>Add <source> after removing failed candidate</title> | 4 <script src="../resources/testharnessreport.js"></script> |
| 5 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 5 <script src="media-file.js"></script> |
| 6 (Please avoid writing new tests using video-test.js) --> | 6 <video> |
| 7 <script src=video-test.js></script> | 7 <source></source> |
| 8 <script src=media-file.js></script> | 8 </video> |
| 9 <script> | 9 <script> |
| 10 function error() | 10 async_test(function(t) { |
| 11 { | 11 var video = document.querySelector("video"); |
| 12 findMediaElement(); | 12 var source = document.querySelector("source"); |
| 13 video.removeChild(video.firstChild); | |
| 14 var source = document.createElement("source"); | |
| 15 source.src = findMediaFile("video", "content/test"); | |
| 16 video.appendChild(source); | |
| 17 waitForEventAndEnd("loadedmetadata"); | |
| 18 } | |
| 19 </script> | |
| 20 </head> | |
| 21 | 13 |
| 22 <body> | 14 source.onerror = t.step_func(function() { |
| 23 <video><source onerror="error()"></video> | 15 video.removeChild(video.firstChild); |
| 24 </body> | 16 var newSource = document.createElement("source"); |
| 25 </html> | 17 newSource.src = findMediaFile("video", "content/test"); |
| 18 video.appendChild(newSource); |
| 19 video.onloadedmetadata = t.step_func_done(); |
| 20 }); |
| 21 }); |
| 22 </script> |
| OLD | NEW |