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

Side by Side Diff: LayoutTests/http/tests/media/media-source/webkitmediasource-closed-on-htmlmediaelement-destruction.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="/js-test-resources/js-test.js"></script>
5 <script src="/media-resources/video-test.js"></script>
6 <script src="webkitmediasource-util.js"></script>
7
8 <script>
9 window.jsTestIsAsync = true;
10
11 var ms = new WebKitMediaSource();
12
13 function sourceOpened()
14 {
15 consoleWrite("sourceOpened called.");
16 var vid = document.getElementById('vid');
17 var buffer = ms.addSourceBuffer('video/webm; codecs="vorbis,vp8"') ;
18
19 MediaSourceTest.expectSourceState(ms, "open");
20
21 consoleWrite("Removing video element from DOM.");
22 vid.parentNode.removeChild(vid);
23 vid = null;
24
25 consoleWrite("Running the garbage collector.");
26 asyncGC(function() {
27 MediaSourceTest.expectSourceState(ms, "closed");
28
29 try {
30 buffer.timestampOffset = 42;
31 failTest("Expected an exception");
32 } catch (e) {
33 consoleWrite("Setting timestampOffset failed as expected: " + e.name);
34 }
35
36 endTest();
37 });
38 }
39
40 function sourceClosed()
41 {
42 consoleWrite("sourceClosed called.");
43 }
44
45 function onLoad()
46 {
47 waitForEventAndFail('error');
48
49 ms.addEventListener('webkitsourceopen', sourceOpened);
50 ms.addEventListener('webkitsourceclose', sourceClosed);
51
52 document.getElementById('vid').src = window.URL.createObjectURL(ms );
53 }
54 </script>
55 </head>
56 <body onload="onLoad()">
57 <video id="vid"></video>
58 <p>Tests that the MediaSource is closed when the HTMLMediaElement is destr oyed.</p>
59 </body>
60 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698