| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="/w3c/resources/testharness.js"></script> | 4 <script src="/w3c/resources/testharness.js"></script> |
| 5 <script src="/w3c/resources/testharnessreport.js"></script> | 5 <script src="/w3c/resources/testharnessreport.js"></script> |
| 6 <script src="mediasource-util.js"></script> | 6 <script src="mediasource-util.js"></script> |
| 7 <link rel='stylesheet' href='/w3c/resources/testharness.css'> | 7 <link rel='stylesheet' href='/w3c/resources/testharness.css'> |
| 8 </head> | 8 </head> |
| 9 <body> | 9 <body> |
| 10 <div id="log"></div> | 10 <div id="log"></div> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 assert_true(sourceBuffer.updating, "sourceBuffer.updating"); | 42 assert_true(sourceBuffer.updating, "sourceBuffer.updating"); |
| 43 | 43 |
| 44 test.waitForExpectedEvents(function() | 44 test.waitForExpectedEvents(function() |
| 45 { | 45 { |
| 46 assert_false(sourceBuffer.updating, "sourceBuffer.updating"); | 46 assert_false(sourceBuffer.updating, "sourceBuffer.updating"); |
| 47 | 47 |
| 48 test.expectEvent(sourceBuffer, "updatestart"); | 48 test.expectEvent(sourceBuffer, "updatestart"); |
| 49 test.expectEvent(sourceBuffer, "update"); | 49 test.expectEvent(sourceBuffer, "update"); |
| 50 test.expectEvent(sourceBuffer, "updateend"); | 50 test.expectEvent(sourceBuffer, "updateend"); |
| 51 | 51 |
| 52 mediaSource.duration = 1; | 52 // Truncate the buffered media to about 1 second duration. |
| 53 | 53 sourceBuffer.remove(1, +Infinity); |
| 54 assert_true(sourceBuffer.updating, "sourceBuffer.updating"); | 54 assert_true(sourceBuffer.updating, "sourceBuffer.updating"); |
| 55 }); | 55 }); |
| 56 | 56 |
| 57 test.waitForExpectedEvents(function() | 57 test.waitForExpectedEvents(function() |
| 58 { | 58 { |
| 59 assert_false(sourceBuffer.updating, "sourceBuffer.updating"); | 59 assert_false(sourceBuffer.updating, "sourceBuffer.updating"); |
| 60 | 60 |
| 61 mediaSource.endOfStream(); | 61 mediaSource.endOfStream(); |
| 62 mediaElement.play(); | 62 mediaElement.play(); |
| 63 | 63 |
| 64 test.expectEvent(mediaElement, "ended"); | 64 test.expectEvent(mediaElement, "ended"); |
| 65 }); | 65 }); |
| 66 | 66 |
| 67 test.waitForExpectedEvents(function() | 67 test.waitForExpectedEvents(function() |
| 68 { | 68 { |
| 69 assert_greater_than(timeUpdateCount, 2, "timeUpdateCount"); | 69 assert_greater_than(timeUpdateCount, 2, "timeUpdateCount"); |
| 70 test.done(); | 70 test.done(); |
| 71 }); | 71 }); |
| 72 }, "Test HTMLVideoElement.getVideoPlaybackQuality() with MediaSource A
PI", {timeout: 5000}); | 72 }, "Test HTMLVideoElement.getVideoPlaybackQuality() with MediaSource A
PI", {timeout: 5000}); |
| 73 </script> | 73 </script> |
| 74 </body> | 74 </body> |
| 75 </html> | 75 </html> |
| OLD | NEW |