| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <body> | 2 <body> |
| 3 <p>Tests that invalid media src url does not result in crash.</p> | 3 <p>Tests that invalid media src url does not result in crash.</p> |
| 4 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 | 4 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 |
| 5 (Please avoid writing new tests using video-test.js) --> | 5 (Please avoid writing new tests using video-test.js) --> |
| 6 <script src=video-test.js></script> | 6 <script src=video-test.js></script> |
| 7 <script> | 7 <script> |
| 8 var invalid_url = "!:/" + String.fromCharCode(0) + "%aa#aa"; | 8 var invalid_url = "!:/" + String.fromCharCode(0) + "%aa#aa"; |
| 9 var error_count = 0; | 9 var error_count = 0; |
| 10 | 10 |
| 11 function errorEvent() | 11 function errorEvent() |
| 12 { | 12 { |
| 13 error_count++; | 13 error_count++; |
| 14 if (error_count == 2) | 14 if (error_count == 2) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 25 var video = document.createElement('video'); | 25 var video = document.createElement('video'); |
| 26 audio.src = invalid_url; | 26 audio.src = invalid_url; |
| 27 video.src = invalid_url; | 27 video.src = invalid_url; |
| 28 audio.onerror = errorEvent; | 28 audio.onerror = errorEvent; |
| 29 video.onerror = errorEvent; | 29 video.onerror = errorEvent; |
| 30 document.body.appendChild(audio); | 30 document.body.appendChild(audio); |
| 31 document.body.appendChild(video); | 31 document.body.appendChild(video); |
| 32 </script> | 32 </script> |
| 33 </body> | 33 </body> |
| 34 </html> | 34 </html> |
| OLD | NEW |