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

Side by Side Diff: LayoutTests/http/tests/media/media-source/mediasource-htmlmediaelement-lifetime.html

Issue 552303006: Prevent more script-observable cases of HTMLMediaElement GC (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: make gc-while-seeking.html non-flaky Created 6 years, 3 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="/w3c/resources/testharness.js"></script>
7 <script src="/w3c/resources/testharnessreport.js"></script>
8 <script src="mediasource-util.js"></script>
9 </head>
10 <body>
11 <div id="log"></div>
12 <script>
13 window.jsTestIsAsync = true;
14
15 async_test(function(test)
16 {
17 var video = document.createElement("video");
18 var ms = new MediaSource();
19
20 function sourceOpened()
21 {
22 consoleWrite("sourceOpened called.");
23 var buffer = ms.addSourceBuffer('video/webm; codecs="vorbis,vp 8"');
24
25 consoleWrite("Running the garbage collector.");
26 video = null;
27 asyncGC(test.step_func(function()
28 {
29 assert_equals(ms.readyState, "open", "MediaSource object i s open.");
30
31 consoleWrite("Setting MediaSource duration.");
32 ms.duration = 100;
33 }));
34 }
35
36 function durationChanged()
37 {
38 consoleWrite("durationChanged called.");
39 test.done();
40 }
41
42 ms.addEventListener("sourceopen", test.step_func(sourceOpened));
43 video.addEventListener("durationchange", test.step_func(durationCh anged));
44 video.src = window.URL.createObjectURL(ms);
45 }, "Tests that the MediaSource keeps the HTMLMediaElement alive.");
46 </script>
47 </body>
48 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698