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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/script-tests/dataset-gc.js

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
(Empty)
1 description("This tests that custom properties on element.dataset persist GC.");
2
3 function gc()
4 {
5 if (window.GCController)
6 return GCController.collect();
7
8 for (var i = 0; i < 10000; i++) {
9 var s = new String("");
10 }
11 }
12
13
14 var d = document.createElement("div");
15
16 var dataset = d.dataset;
17 // Add a property to our prototype. It will be hidden by the corresponding data- attribute.
18 dataset.__proto__.customProperty = 1;
19 dataset.customProperty = 1; // Now set a property on ourselves.
20 shouldBe("d.getAttribute('data-custom-property')", "'1'");
21 shouldBe("d.dataset.customProperty", "'1'");
22
23 dataset = null;
24
25 gc();
26
27 // Test that the custom property persisted the GC.
28 shouldBe("d.dataset.customProperty", "'1'");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698