OLD | NEW |
(Empty) | |
| 1 <title>Mixed range responses must be handled as an error.</title> |
| 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> |
| 4 <script src="../../media-resources/media-file.js"></script> |
| 5 <body> |
| 6 <script> |
| 7 // This file tests the following behavior: |
| 8 // 1. The audio element sends the first request. |
| 9 // 2. mixed-range-response.php returns the first 3 bytes ("Ogg"). |
| 10 // 3. The element sends the second request with "Range: bytes=3-" header. |
| 11 // 4. mixed-range-response.php returns 206 response. |
| 12 // 5. The element sends the thired request to load-video.php. |
| 13 // 6. load-video.php returns the audio file from the fourth byte. |
| 14 // |
| 15 // The original URLs of 2. (mixed-range-response.php) and 6. (load-video.php) |
| 16 // are different. So an error should be occur. |
| 17 |
| 18 async_test(function(t) { |
| 19 var audio = document.createElement('audio'); |
| 20 audio.oncanplay = t.step_func(function() { |
| 21 throw 'CanPlay event should not be fired.'; |
| 22 }); |
| 23 audio.onerror = t.step_func(function() { |
| 24 t.done(); |
| 25 }); |
| 26 audio.src = './resources/mixed-range-response.php'; |
| 27 document.body.appendChild(audio); |
| 28 }); |
| 29 </script> |
| 30 </body> |
OLD | NEW |