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 15 matching lines...) Expand all Loading... | |
26 | 26 |
27 assert_greater_than_equal(newQuality.droppedVideoFrames, 0, "d roppedVideoFrames >= 0"); | 27 assert_greater_than_equal(newQuality.droppedVideoFrames, 0, "d roppedVideoFrames >= 0"); |
28 assert_greater_than_equal(newQuality.droppedVideoFrames, previ ousQuality.droppedVideoFrames, "droppedVideoFrames"); | 28 assert_greater_than_equal(newQuality.droppedVideoFrames, previ ousQuality.droppedVideoFrames, "droppedVideoFrames"); |
29 | 29 |
30 assert_greater_than_equal(newQuality.corruptedVideoFrames, 0, "corruptedVideoFrames >= 0"); | 30 assert_greater_than_equal(newQuality.corruptedVideoFrames, 0, "corruptedVideoFrames >= 0"); |
31 assert_greater_than_equal(newQuality.corruptedVideoFrames, pre viousQuality.corruptedVideoFrames, "corruptedVideoFrames"); | 31 assert_greater_than_equal(newQuality.corruptedVideoFrames, pre viousQuality.corruptedVideoFrames, "corruptedVideoFrames"); |
32 previousQuality = newQuality; | 32 previousQuality = newQuality; |
33 timeUpdateCount++; | 33 timeUpdateCount++; |
34 })); | 34 })); |
35 | 35 |
36 mediaElement.addEventListener("ended", test.step_func(function(e) | |
37 { | |
38 assert_greater_than(timeUpdateCount, 2, "timeUpdateCount"); | |
39 test.done(); | |
40 })); | |
41 | |
42 test.failOnEvent(mediaElement, 'error'); | 36 test.failOnEvent(mediaElement, 'error'); |
43 | 37 |
44 sourceBuffer.addEventListener('updateend', test.step_func(functio n() | 38 test.expectEvent(sourceBuffer, "updatestart"); |
45 { | 39 test.expectEvent(sourceBuffer, "update"); |
46 mediaSource.duration = 1; | 40 test.expectEvent(sourceBuffer, "updateend"); |
47 mediaSource.endOfStream(); | 41 sourceBuffer.appendBuffer(mediaData); |
48 mediaElement.play(); | 42 assert_true(sourceBuffer.updating, "sourceBuffer.updating"); |
49 })); | 43 |
50 sourceBuffer.appendBuffer(mediaData); | 44 test.waitForExpectedEvents(function() |
45 { | |
46 » assert_false(sourceBuffer.updating, "sourceBuffer.updating"); | |
philipj_slow
2014/06/16 13:26:18
nit: this and the following lines are indented wit
| |
47 | |
48 » » test.expectEvent(sourceBuffer, "updatestart"); | |
49 » » test.expectEvent(sourceBuffer, "update"); | |
50 » » test.expectEvent(sourceBuffer, "updateend"); | |
51 | |
52 mediaSource.duration = 1; | |
53 | |
54 assert_true(sourceBuffer.updating, "sourceBuffer.updating"); | |
55 }); | |
56 | |
57 test.waitForExpectedEvents(function() | |
58 { | |
59 assert_false(sourceBuffer.updating, "sourceBuffer.updating"); | |
60 | |
61 mediaSource.endOfStream(); | |
62 mediaElement.play(); | |
63 | |
64 test.expectEvent(mediaElement, "ended"); | |
65 }); | |
66 | |
67 test.waitForExpectedEvents(function() | |
68 { | |
69 assert_greater_than(timeUpdateCount, 2, "timeUpdateCount"); | |
70 test.done(); | |
71 }); | |
51 }, "Test HTMLVideoElement.getVideoPlaybackQuality() with MediaSource A PI", {timeout: 5000}); | 72 }, "Test HTMLVideoElement.getVideoPlaybackQuality() with MediaSource A PI", {timeout: 5000}); |
52 </script> | 73 </script> |
53 </body> | 74 </body> |
54 </html> | 75 </html> |
OLD | NEW |