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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-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 PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 <script src="../../../resources/gc.js"></script>
5 </head> 6 </head>
6 <body> 7 <body>
7 <script> 8 <script>
8 description('This tests that properties on the classList persists GC.'); 9 description('This tests that properties on the classList persists GC.');
9 10
10 function gc()
11 {
12 if (window.GCController)
13 return GCController.collect();
14
15 for (var i = 0; i < 10000; i++) {
16 var s = new String;
17 }
18 }
19
20 var d = document.createElement('div'); 11 var d = document.createElement('div');
21 12
22 // Ensure the classList is created. 13 // Ensure the classList is created.
23 var classList = d.classList; 14 var classList = d.classList;
24 15
25 // Set a custom property. 16 // Set a custom property.
26 d.classList.life = 42; 17 d.classList.life = 42;
27 shouldEvaluateTo('d.classList.life', 42); 18 shouldEvaluateTo('d.classList.life', 42);
28 19
29 // Null out reference to the dataset. 20 // Null out reference to the dataset.
30 classList = null; 21 classList = null;
31 22
32 gc(); 23 gc();
33 24
34 // Test that the classList wrapper persisted the GC and still has the custom pro perty. 25 // Test that the classList wrapper persisted the GC and still has the custom pro perty.
35 shouldEvaluateTo('d.classList.life', 42); 26 shouldEvaluateTo('d.classList.life', 42);
36 </script> 27 </script>
37 </body> 28 </body>
38 </html> 29 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698