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

Unified Diff: third_party/WebKit/LayoutTests/fast/html/hidden-attr-dom.html

Issue 2674643002: Stop using script-tests in fast/html/. (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/html/hidden-attr-dom.html
diff --git a/third_party/WebKit/LayoutTests/fast/html/hidden-attr-dom.html b/third_party/WebKit/LayoutTests/fast/html/hidden-attr-dom.html
index 4c05b42e43e7855dccc709d09d00e1538f385388..185a2ce7c222398cfb21ed670ab7b349af41c2f6 100644
--- a/third_party/WebKit/LayoutTests/fast/html/hidden-attr-dom.html
+++ b/third_party/WebKit/LayoutTests/fast/html/hidden-attr-dom.html
@@ -4,6 +4,35 @@
<script src="../../resources/js-test.js"></script>
</head>
<body>
-<script src="script-tests/hidden-attr-dom.js"></script>
+<script>
+description('Various tests for the the hidden IDL attribute.');
+
+var testParent = document.createElement('div');
+document.body.appendChild(testParent);
+
+debug('The IDL attribute reflects what is present in markup:');
+testParent.innerHTML = '<div id=h1 hidden></div><div id=h2 hidden=false></div><div id=h3 hidden=off></div><div id=s1></div>';
+var h1 = document.getElementById("h1");
+var h2 = document.getElementById("h2");
+var h3 = document.getElementById("h3");
+var s1 = document.getElementById("s1");
+
+shouldBeTrue('h1.hidden');
+shouldBeTrue('h2.hidden');
+shouldBeTrue('h3.hidden');
+shouldBeFalse('s1.hidden');
+
+debug('Changes via DOM Core are reflected through the IDL attribute:');
+
+shouldBeFalse('(h1.removeAttribute("hidden"), h1.hidden)');
+shouldBeTrue('(h1.setAttribute("hidden", ""), h1.hidden)');
+shouldBeTrue('(h2.setAttribute("hidden", ""), h2.hidden)');
+shouldBeTrue('(s1.setAttribute("hidden", ""), s1.hidden)');
+
+debug('Changes via IDL attribute are reflected in the core DOM:');
+
+shouldBe('(h3.hidden = false, h3.getAttribute("hidden"))', 'null');
+shouldBe('(h3.hidden = true, h3.getAttribute("hidden"))', '""');
+</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698