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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Attr/access-after-element-destruction.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/Attr/script-tests/TEMPLATE.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/Attr/access-after-element-destruction.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Attr/access-after-element-destruction.html b/third_party/WebKit/LayoutTests/fast/dom/Attr/access-after-element-destruction.html
index cdd702650aaa57a6b749a84e1744c3e6c619ea3c..c25f5976dfce2dd860f2326c6ba178a3e258dba0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Attr/access-after-element-destruction.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/Attr/access-after-element-destruction.html
@@ -4,6 +4,52 @@
<script src="../../../resources/js-test.js"></script>
</head>
<body>
-<script src="script-tests/access-after-element-destruction.js"></script>
+<script>
+description("Tests that accessing Attr after its Element has been destroyed works without crashing.");
+
+jsTestIsAsync = true;
+
+var element = document.createElement("p");
+element.setAttribute("a", "b");
+var attributes = element.attributes;
+element = null;
+var attr = null;
+
+asyncGC(function() {
+ shouldBe("attributes.length", "1");
+ shouldBe("attributes[0]", "attributes.item(0)");
+ shouldBe("attributes.getNamedItem('a')", "attributes.item(0)");
+
+ shouldBe("attributes.item(0).name", "'a'");
+ shouldBe("attributes.item(0).value", "'b'");
+ shouldBe("attributes.item(0).ownerElement.tagName", "'P'");
+
+ attributes.item(0).value = 'c';
+
+ shouldBe("attributes.item(0).value", "'c'");
+
+ attributes.removeNamedItem('a');
+
+ shouldBe("attributes.length", "0");
+
+ element = document.createElement("p");
+ element.setAttribute("a", "b");
+ attr = element.attributes.item(0);
+ element = null;
+
+ asyncGC(function() {
+
+ shouldBe("attr.name", "'a'");
+ shouldBe("attr.value", "'b'");
+ shouldBe("attr.ownerElement.tagName", "'P'");
+
+ attr.value = 'c';
+
+ shouldBe("attr.value", "'c'");
+
+ finishJSTest();
+ });
+});
+</script>
</body>
</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/Attr/script-tests/TEMPLATE.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698