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

Unified 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, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/dom/dataset-gc.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/dataset-gc.html b/third_party/WebKit/LayoutTests/fast/dom/dataset-gc.html
index 9729ca9ef98959b1eacd2c8bf7f5427c691eaa49..9f55e6dc70ebcb4b849c7acf4f1a2bedb2ab0b0b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/dataset-gc.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/dataset-gc.html
@@ -4,6 +4,35 @@
<script src="../../resources/js-test.js"></script>
</head>
<body>
-<script src="script-tests/dataset-gc.js"></script>
+<script>
+description("This tests that custom properties on element.dataset persist GC.");
+
+function gc()
+{
+ if (window.GCController)
+ return GCController.collect();
+
+ for (var i = 0; i < 10000; i++) {
+ var s = new String("");
+ }
+}
+
+
+var d = document.createElement("div");
+
+var dataset = d.dataset;
+// Add a property to our prototype. It will be hidden by the corresponding data- attribute.
+dataset.__proto__.customProperty = 1;
+dataset.customProperty = 1; // Now set a property on ourselves.
+shouldBe("d.getAttribute('data-custom-property')", "'1'");
+shouldBe("d.dataset.customProperty", "'1'");
+
+dataset = null;
+
+gc();
+
+// Test that the custom property persisted the GC.
+shouldBe("d.dataset.customProperty", "'1'");
+</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698