Chromium Code Reviews| Index: LayoutTests/http/tests/media/media-source/mediasource-getvideoplaybackquality.html |
| diff --git a/LayoutTests/http/tests/media/media-source/mediasource-getvideoplaybackquality.html b/LayoutTests/http/tests/media/media-source/mediasource-getvideoplaybackquality.html |
| index caef2e67301165679b49e13e4419b2cbd0d6cf2d..13b65eb12743a70887185ab0829520982982bbff 100644 |
| --- a/LayoutTests/http/tests/media/media-source/mediasource-getvideoplaybackquality.html |
| +++ b/LayoutTests/http/tests/media/media-source/mediasource-getvideoplaybackquality.html |
| @@ -33,21 +33,42 @@ |
| timeUpdateCount++; |
| })); |
| - mediaElement.addEventListener("ended", test.step_func(function(e) |
| + test.failOnEvent(mediaElement, 'error'); |
| + |
| + test.expectEvent(sourceBuffer, "updatestart"); |
| + test.expectEvent(sourceBuffer, "update"); |
| + test.expectEvent(sourceBuffer, "updateend"); |
| + sourceBuffer.appendBuffer(mediaData); |
| + assert_true(sourceBuffer.updating, "sourceBuffer.updating"); |
| + |
| + test.waitForExpectedEvents(function() |
| { |
| - assert_greater_than(timeUpdateCount, 2, "timeUpdateCount"); |
| - test.done(); |
| - })); |
| + assert_false(sourceBuffer.updating, "sourceBuffer.updating"); |
|
philipj_slow
2014/06/16 13:26:18
nit: this and the following lines are indented wit
|
| - test.failOnEvent(mediaElement, 'error'); |
| + test.expectEvent(sourceBuffer, "updatestart"); |
| + test.expectEvent(sourceBuffer, "update"); |
| + test.expectEvent(sourceBuffer, "updateend"); |
| + |
| + mediaSource.duration = 1; |
| - sourceBuffer.addEventListener('updateend', test.step_func(function() |
| - { |
| - mediaSource.duration = 1; |
| - mediaSource.endOfStream(); |
| - mediaElement.play(); |
| - })); |
| - sourceBuffer.appendBuffer(mediaData); |
| + assert_true(sourceBuffer.updating, "sourceBuffer.updating"); |
| + }); |
| + |
| + test.waitForExpectedEvents(function() |
| + { |
| + assert_false(sourceBuffer.updating, "sourceBuffer.updating"); |
| + |
| + mediaSource.endOfStream(); |
| + mediaElement.play(); |
| + |
| + test.expectEvent(mediaElement, "ended"); |
| + }); |
| + |
| + test.waitForExpectedEvents(function() |
| + { |
| + assert_greater_than(timeUpdateCount, 2, "timeUpdateCount"); |
| + test.done(); |
| + }); |
| }, "Test HTMLVideoElement.getVideoPlaybackQuality() with MediaSource API", {timeout: 5000}); |
| </script> |
| </body> |