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

Side by Side Diff: third_party/WebKit/LayoutTests/media/mediasession/mojo/callback-alive-after-gc.html

Issue 2847943002: Cleanup LayoutTests that define a function gc(). (Closed)
Patch Set: Fixing Layout Tests Failures Created 3 years, 7 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Test that setting MediaSession callbacks are alive after garbage-collecti on</title> 2 <title>Test that setting MediaSession callbacks are alive after garbage-collecti on</title>
3 <script src="../../../resources/testharness.js"></script> 3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script> 4 <script src="../../../resources/testharnessreport.js"></script>
5 <script src="../../../resources/mojo-helpers.js"></script> 5 <script src="../../../resources/mojo-helpers.js"></script>
6 <script src="../../../resources/gc.js"></script>
6 <script src="resources/mediasessionservice-mock.js"></script> 7 <script src="resources/mediasessionservice-mock.js"></script>
7 <script src="resources/utils.js"></script> 8 <script src="resources/utils.js"></script>
8 <script> 9 <script>
9 10
10 var mock; 11 var mock;
11 12
12 function gc() {
13 if (window.GCController) {
14 GCController.collect();
15 } else {
16 for (var i = 0; i < 10000; ++i) {
17 ({ });
18 }
19 }
20 }
21
22 async_test(function(t) { 13 async_test(function(t) {
23 mediaSessionServiceMock.then(m => { 14 mediaSessionServiceMock.then(m => {
24 mock = m; 15 mock = m;
25 mock.setClientCallback(_ => { 16 mock.setClientCallback(_ => {
26 gc(); 17 gc();
27 setTimeout(_ => { 18 setTimeout(_ => {
28 mock.getClient().didReceiveAction(MediaSessionAction.PLAY); 19 mock.getClient().didReceiveAction(MediaSessionAction.PLAY);
29 }); 20 });
30 }); 21 });
31 window.navigator.mediaSession.setActionHandler("play", _ => { t.done(); }); 22 window.navigator.mediaSession.setActionHandler("play", _ => { t.done(); });
32 }); 23 });
33 }); 24 });
34 </script> 25 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698