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

Side by Side Diff: third_party/WebKit/LayoutTests/media/remoteplayback/availability-callback-gc.html

Issue 2415723002: [Blink, RemotePlayback] watchAvailability() implementation. (Closed)
Patch Set: Added layout test for callback gc Created 4 years, 2 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 | third_party/WebKit/LayoutTests/media/remoteplayback/cancel-watch-availability.html » ('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 that the callback is not garbage collected if registered.</t itle>
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 <script src="../media-file.js"></script>
8 </head>
9 <body>
10 <script>
11 function gc() {
12 if (window.GCController)
13 GCController.collect();
14 else {
15 for (var i = 0; i < 10000; ++i) {
16 ({ });
17 }
18 }
19 }
20
21 async_test(function(t)
22 {
23 var v = document.createElement('video');
24 v.src = findMediaFile('video', 'content/test');
25 document.body.appendChild(v);
26
27 function callback(available) {}
28 var callbackRef = t.step_func_done(callback);
29
30 v.remote.watchAvailability(callbackRef).then(
31 function() { callbackRef = null; gc(); },
32 t.unreached_func());
33 }, 'Test that the callback is not garbage collected if registered.') ;
34 </script>
35 </body>
36 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/remoteplayback/cancel-watch-availability.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698