Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <title>Ensure that a TrackList won't be collected if it has custom properties.</ title> |
|
mlamouri (slow - plz ping)
2016/05/09 12:51:05
s/collected/garbage collected/
Srirama
2016/05/09 13:14:31
Acknowledged.
| |
| 3 <head> | 3 <video> |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 <track> |
| 5 </video> | |
| 6 <script src="../../resources/gc.js"></script> | |
| 7 <script src="../../resources/testharness.js"></script> | |
| 8 <script src="../../resources/testharnessreport.js"></script> | |
| 9 <script> | |
| 10 async_test(function(t) { | |
| 11 var video = document.querySelector("video"); | |
| 5 | 12 |
| 6 <script src=../media-file.js></script> | 13 assert_equals(video.textTracks.length, 1); |
| 7 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 | 14 // Add a custom property to a track. |
| 8 (Please avoid writing new tests using video-test.js) --> | 15 video.textTracks.myProperty = "chicken salad!"; |
| 9 <script src=../video-test.js></script> | 16 assert_equals(video.textTracks.length, 1); |
| 10 <script> | 17 assert_equals(video.textTracks.myProperty, "chicken salad!"); |
| 11 | 18 |
| 12 function forceGC() | 19 // Force garbage collection. |
| 13 { | 20 gc(); |
| 14 if (window.GCController) | 21 |
| 15 return GCController.collectAll(); | 22 setTimeout(t.step_func_done(function() { |
| 16 | 23 assert_equals(video.textTracks.length, 1); |
| 17 // Force garbage collection | 24 assert_equals(video.textTracks.myProperty, "chicken salad!"); |
| 18 for (var ndx = 0; ndx < 99000; ndx++) | 25 }), 0); |
| 19 var str = new String("1234"); | 26 }); |
|
mlamouri (slow - plz ping)
2016/05/09 12:51:05
I really don't see the point of this test... It do
Srirama
2016/05/09 13:14:31
You are right, even by removing that there is no c
mlamouri (slow - plz ping)
2016/05/10 09:08:28
I think you can delete this test. It doesn't do an
Srirama
2016/05/10 09:46:05
Done.
| |
| 20 } | 27 </script> |
| 21 | |
| 22 function start() | |
| 23 { | |
| 24 findMediaElement(); | |
| 25 | |
| 26 consoleWrite("** Add a custom property to a track."); | |
| 27 testExpected("video.textTracks.length", 1); | |
| 28 run("video.textTracks.myProperty = 'chicken salad!'"); | |
| 29 testExpected("video.textTracks.length", 1); | |
| 30 testExpected("video.textTracks.myProperty", "chicken salad!"); | |
| 31 | |
| 32 consoleWrite("<br>** Force garbage collection."); | |
| 33 forceGC(); | |
| 34 testExpected("video.textTracks.length", 1); | |
| 35 testExpected("video.textTracks.myProperty", "chicken salad!"); | |
| 36 | |
| 37 consoleWrite(""); | |
| 38 endTest(); | |
| 39 } | |
| 40 | |
| 41 </script> | |
| 42 </head> | |
| 43 <body onload="start()"> | |
| 44 <p>Ensure that a TrackList won't be collected if it has custom propertie s.</p> | |
| 45 <video> | |
| 46 <track> | |
| 47 </video> | |
| 48 </body> | |
| 49 </html> | |
| OLD | NEW |