Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(851)

Side by Side Diff: LayoutTests/http/tests/media/media-source/mediasource-play-then-seek-back.html

Issue 20114005: Layout Test for basic MSE seek scenario. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code cleanup and reorganisation, round deux. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-play-then-seek-back-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="/w3c/resources/testharness.js"></script>
5 <script src="/w3c/resources/testharnessreport.js"></script>
6 <script src="mediasource-util.js"></script>
7 <script src="/media/resources/media-source/webm/segment-info.js"></scrip t>
8 <link rel="stylesheet" href="/w3c/resources/testharness.css">
9 </head>
10 <body>
11 <div id='log'></div>
12
13 <script>
14
15 function seekBackAfterPlayingTest(testFunction, description, options )
16 {
17 mediasource_test(function(test, mediaElement, mediaSource)
18 {
19 var segmentInfo = WebMSegmentInfo.testWebM;
20 test.failOnEvent(mediaElement, 'error');
21
22 var sourceBuffer = mediaSource.addSourceBuffer(segmentInfo.t ype);
23 MediaSourceUtil.loadBinaryData(test, segmentInfo.url, functi on(mediaData)
24 {
25 testFunction(test, mediaElement, mediaSource, segmentInf o, sourceBuffer, mediaData);
26 });
27 }, description, options);
28 }
29
30 seekBackAfterPlayingTest(function(test, mediaElement, mediaSource, s egmentInfo, sourceBuffer, mediaData)
31 {
32
33 mediaElement.play();
34 // Append all the segments
35 test.expectEvent(sourceBuffer, 'updateend', 'sourceBuffer');
36 test.expectEvent(mediaElement, 'playing', 'Playing triggered');
37 sourceBuffer.appendBuffer(mediaData);
38
39 function confirmPlayThenEnd()
40 {
41 function delayedPlayHandlerThatEnds()
wolenetz 2013/08/06 23:57:13 nit: This needs removal now that it is anonymously
anandc 2013/08/07 00:05:24 Yes, should have done that earlier. Thanks. Done n
42 {
43 assert_greater_than(mediaElement.currentTime, 0.0, 'Play back has started after seek.');
44 test.done();
45 }
46 test.waitForCurrentTimeChange(mediaElement, function ()
47 {
48 assert_greater_than(mediaElement.currentTime, 0.0, 'Play back has started after seek.');
49 test.done();
50 });
51 }
52
53 function finishSeekThenPlay()
54 {
55 assert_true(mediaElement.seeking, 'mediaElement is seeking') ;
56 assert_equals(mediaElement.currentTime, 0.0, 'Current time i s 0.0');
57 test.expectEvent(mediaElement, 'seeked', 'mediaElement finis hed seek');
58
59 test.waitForExpectedEvents(confirmPlayThenEnd);
60 }
61
62 function delayedPlayHandler()
63 {
64 assert_greater_than(mediaElement.currentTime, 0.0, 'Playback has started.');
65 test.expectEvent(mediaElement, 'seeking', 'mediaElement');
66 mediaElement.currentTime = 0.0;
67
68 test.waitForExpectedEvents(finishSeekThenPlay);
69 }
70
71 test.waitForExpectedEvents(function()
72 {
73 test.waitForCurrentTimeChange(mediaElement, delayedPlayHandl er);
74 });
75
76 }, 'Test playing then seeking back.');
77 </script>
78 </body>
79 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-play-then-seek-back-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698