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

Side by Side Diff: LayoutTests/media/encrypted-media/encrypted-media-lifetime-mediakeys.html

Issue 180203002: Add EME content test that forces garbage collection (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: lifetime-mediakeys Created 6 years, 10 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/media/encrypted-media/encrypted-media-lifetime-mediakeys-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 <title>Test MediaKeys lifetime</title>
ddorwin 2014/02/26 22:40:40 This doesn't seem to do much more than test the st
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 <script src="../../resources/gc.js"></script>
8 </head>
9 <body>
10 <div id="log"></div>
11 <script>
12 test(function()
13 {
14 var mediaKeys;
15
16 // Create a MediaKeys object.
17 mediaKeys = new MediaKeys("org.w3.clearkey");
18 assert_not_equals(mediaKeys, null);
19 assert_equals(mediaKeys.keySystem, 'org.w3.clearkey');
20
21 // Run gc(), should not affect MediaKeys object since we have
22 // a reference to it.
23 gc();
24 assert_not_equals(mediaKeys, null);
25 assert_equals(mediaKeys.keySystem, 'org.w3.clearkey');
26
27 // Drop reference to the MediaKeys object and run gc again.
28 // Object should be collected this time.
29 mediaKeys = null;
30 gc();
31
32 // Create a large number of MediaKeys objects and then run gc.
33 // All but the last one created should be garbage collected.
ddorwin 2014/02/26 22:40:40 We can't actually verify the others are GC'd unles
34 for (var i = 0; i < 100; ++i)
35 mediaKeys = new MediaKeys("org.w3.clearkey");
36 gc();
37
38 // Last MediaKeys object created should still be referenced.
39 assert_not_equals(mediaKeys, null);
40 assert_equals(mediaKeys.keySystem, 'org.w3.clearkey');
41
42 // Release the last MediaKeys object created.
43 mediaKeys = null;
44 gc();
45 }, "MediaKeys lifetime");
46 </script>
47 </body>
48 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/media/encrypted-media/encrypted-media-lifetime-mediakeys-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698