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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/dataset-gc.html

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 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
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 </head> 5 </head>
6 <body> 6 <body>
7 <script src="script-tests/dataset-gc.js"></script> 7 <script>
8 description("This tests that custom properties on element.dataset persist GC.");
9
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
21 var d = document.createElement("div");
22
23 var dataset = d.dataset;
24 // Add a property to our prototype. It will be hidden by the corresponding data- attribute.
25 dataset.__proto__.customProperty = 1;
26 dataset.customProperty = 1; // Now set a property on ourselves.
27 shouldBe("d.getAttribute('data-custom-property')", "'1'");
28 shouldBe("d.dataset.customProperty", "'1'");
29
30 dataset = null;
31
32 gc();
33
34 // Test that the custom property persisted the GC.
35 shouldBe("d.dataset.customProperty", "'1'");
36 </script>
8 </body> 37 </body>
9 </html> 38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698