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

Side by Side Diff: LayoutTests/http/tests/media/media-source/webkitmediasource-garbage-collection-before-sourceopen.html

Issue 245893002: Improve unprefixed MediaSource test coverage. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="/media-resources/video-test.js"></script>
5 </head>
6 <body>
7 <video autoplay controls="controls" id='vid'></video>
8 <p>Tests that webkitsourceopen event fires even if garbage collection ha ppens between setting video.src &amp; the webkitsourceopen event.</p>
9 <script type="text/javascript">
10 function createMediaSourceURL()
11 {
12 var mediaSource = new WebKitMediaSource();
13 var onSourceOpen = function (e)
14 {
15 sourceOpened = true;
16 consoleWrite("onSourceOpen called.");
17 endTest();
18 };
19 consoleWrite("Setting webkitsourceopen event listener.");
20 mediaSource.addEventListener('webkitsourceopen', onSourceOpen);
21 return window.URL.createObjectURL(mediaSource);
22 }
23
24 function start()
25 {
26 var video = document.getElementById('vid');
27 var sourceOpened = false;
28 var onStalled = function (e)
29 {
30 if (sourceOpened)
31 return;
32
33 failTest('stalled event fired before webkitsourceopen');
34 };
35 video.addEventListener('stalled', onStalled);
36
37 var url = createMediaSourceURL();
38 consoleWrite("Running garbage collector.");
39 gc();
40
41 consoleWrite("Setting video.src to object URL.");
42 video.src = url;
43 }
44 start();
45 </script>
46 </body>
47 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698