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

Side by Side Diff: LayoutTests/http/tests/media/media-source/mediasource-util.js

Issue 20114005: Layout Test for basic MSE seek scenario. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove unused function. 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 | « LayoutTests/http/tests/media/media-source/mediasource-play-then-seek-back-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 (function(window) { 1 (function(window) {
2 EventExpectationsManager = function(test) 2 EventExpectationsManager = function(test)
3 { 3 {
4 this.test_ = test; 4 this.test_ = test;
5 this.eventTargetList_ = []; 5 this.eventTargetList_ = [];
6 this.waitCallbacks_ = []; 6 this.waitCallbacks_ = [];
7 }; 7 };
8 8
9 EventExpectationsManager.prototype.expectEvent = function(object, eventName, description) 9 EventExpectationsManager.prototype.expectEvent = function(object, eventName, description)
10 { 10 {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 test.expectEvent = function(object, eventName, description) 174 test.expectEvent = function(object, eventName, description)
175 { 175 {
176 test.eventExpectations_.expectEvent(object, eventName, description); 176 test.eventExpectations_.expectEvent(object, eventName, description);
177 }; 177 };
178 178
179 test.waitForExpectedEvents = function(callback) 179 test.waitForExpectedEvents = function(callback)
180 { 180 {
181 test.eventExpectations_.waitForExpectedEvents(callback); 181 test.eventExpectations_.waitForExpectedEvents(callback);
182 }; 182 };
183 183
184 test.waitForCurrentTimeChange = function(mediaElement, callback)
185 {
186 var initialTime = mediaElement.currentTime;
187
188 var onTimeUpdate = test.step_func(function()
189 {
190 if (mediaElement.currentTime != initialTime) {
191 mediaElement.removeEventListener('timeupdate', onTimeUpdate) ;
192 callback();
193 }
194 });
195
196 mediaElement.addEventListener('timeupdate', onTimeUpdate);
197 }
198
184 var oldTestDone = test.done.bind(test); 199 var oldTestDone = test.done.bind(test);
185 test.done = function() 200 test.done = function()
186 { 201 {
187 if (test.status == test.PASS) 202 if (test.status == test.PASS) {
188 assert_false(test.eventExpectations_.expectingEvents(), "No pend ing event expectations."); 203 assert_false(test.eventExpectations_.expectingEvents(), "No pend ing event expectations.");
204 }
189 oldTestDone(); 205 oldTestDone();
190 }; 206 };
191 }; 207 };
192 208
193 window['MediaSourceUtil'] = MediaSourceUtil; 209 window['MediaSourceUtil'] = MediaSourceUtil;
194 window['media_test'] = function(testFunction, description, options) 210 window['media_test'] = function(testFunction, description, options)
195 { 211 {
196 options = options || {}; 212 options = options || {};
197 return async_test(function(test) 213 return async_test(function(test)
198 { 214 {
(...skipping 21 matching lines...) Expand all
220 }; 236 };
221 237
222 openMediaSource_(test, mediaTag, function(mediaSource) 238 openMediaSource_(test, mediaTag, function(mediaSource)
223 { 239 {
224 testFunction(test, mediaTag, mediaSource); 240 testFunction(test, mediaTag, mediaSource);
225 }); 241 });
226 }, description, options); 242 }, description, options);
227 243
228 }; 244 };
229 })(window); 245 })(window);
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/media/media-source/mediasource-play-then-seek-back-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698