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

Unified Diff: third_party/WebKit/LayoutTests/fast/html/figcaption-element.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/figcaption-element.html
diff --git a/third_party/WebKit/LayoutTests/fast/html/figcaption-element.html b/third_party/WebKit/LayoutTests/fast/html/figcaption-element.html
index a0ceb8fc4c2a0a4c551ce64413cf0b4057584f47..0587b43cd9a3b38d0e4a8356224372671abb4420 100644
--- a/third_party/WebKit/LayoutTests/fast/html/figcaption-element.html
+++ b/third_party/WebKit/LayoutTests/fast/html/figcaption-element.html
@@ -4,6 +4,45 @@
<script src="../../resources/js-test.js"></script>
</head>
<body>
-<script src="script-tests/figcaption-element.js"></script>
+<script>
+description('Various tests for the figcaption element.');
+
+function getStyleValue(id, propertyName) {
+ return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue(propertyName);
+}
+
+var testParent = document.createElement('div');
+document.body.appendChild(testParent);
+
+debug('&lt;figcaption> default styling:');
+testParent.innerHTML = '<figcaption id="figcaption0">element</figure>';
+var emSize = getStyleValue("figcaption0","font-size");
+shouldBe('getStyleValue("figcaption0","display")', '"block"');
+
+debug('&lt;figcaption> closes &lt;p>:');
+testParent.innerHTML = '<p>Test that <figcaption id="figcaption1">a figcaption element</figcaption> closes &lt;p>.</p>';
+var figcaption1 = document.getElementById('figcaption1');
+shouldBeFalse('figcaption1.parentNode.nodeName == "p"');
+
+debug('&lt;p> does not close &lt;figcaption>:');
+testParent.innerHTML = '<figcaption>Test that <p id="p1">a p element</p> does not close a figcaption element.</figcaption>';
+var p1 = document.getElementById('p1');
+shouldBe('p1.parentNode.nodeName', '"FIGCAPTION"');
+
+debug('&lt;figcaption> can be nested inside &lt;figcaption> or &lt;footer>:');
+testParent.innerHTML = '<figcaption id="figcaption2">Test that <figcaption id="figcaption3">a figcaption element</figcaption> can be nested inside another figcaption element.</figcaption>';
+var figcaption3 = document.getElementById('figcaption3');
+shouldBe('figcaption3.parentNode.id', '"figcaption2"');
+testParent.innerHTML = '<footer id="footer1">Test that <figcaption id="figcaption5">a figcaption element</figcaption> can be nested inside a footer element.</footer>';
+var figcaption5 = document.getElementById('figcaption5');
+shouldBe('figcaption5.parentNode.id', '"footer1"');
+
+debug('Residual style:');
+testParent.innerHTML = '<b><figcaption id="figcaption4">This text should be bold.</figcaption> <span id="span1">This is also bold.</span></b>';
+shouldBe('getStyleValue("figcaption4","font-weight")', '"bold"');
+shouldBe('getStyleValue("span1","font-weight")', '"bold"');
+document.body.removeChild(testParent);
+
+</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698