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

Unified Diff: third_party/WebKit/LayoutTests/fast/html/aside-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/aside-element.html
diff --git a/third_party/WebKit/LayoutTests/fast/html/aside-element.html b/third_party/WebKit/LayoutTests/fast/html/aside-element.html
index 73d04b216fef4e897b679a03cf4bdd1fb0071de2..d621eade7704552204f3f290b993ee062d67bde4 100644
--- a/third_party/WebKit/LayoutTests/fast/html/aside-element.html
+++ b/third_party/WebKit/LayoutTests/fast/html/aside-element.html
@@ -4,6 +4,48 @@
<script src="../../resources/js-test.js"></script>
</head>
<body>
-<script src="script-tests/aside-element.js"></script>
+<script>
+description('Various tests for the aside element.');
+
+var testParent = document.createElement('div');
+document.body.appendChild(testParent);
+
+debug('&lt;aside> closes &lt;p>:');
+testParent.innerHTML = '<p>Test that <aside id="aside1">an aside element</aside> closes &lt;p>.</p>';
+var aside1 = document.getElementById('aside1');
+shouldBeFalse('aside1.parentNode.nodeName == "p"');
+
+debug('&lt;p> does not close &lt;aside>:');
+testParent.innerHTML = '<aside>Test that <p id="p1">a p element</p> does not close an aside element.</aside>';
+var p1 = document.getElementById('p1');
+shouldBe('p1.parentNode.nodeName', '"ASIDE"');
+
+debug('&lt;aside> can be nested inside &lt;aside>:');
+testParent.innerHTML = '<aside id="aside2">Test that <aside id="aside3">an aside element</aside> can be nested inside another.</aside>';
+var aside3 = document.getElementById('aside3');
+shouldBe('aside3.parentNode.id', '"aside2"');
+
+debug('Residual style:');
+testParent.innerHTML = '<b><aside id="aside4">This text should be bold.</aside> <span id="span1">This is also bold.</span></b>';
+function getWeight(id) {
+ return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight');
+}
+shouldBe('getWeight("aside4")', '"bold"');
+shouldBe('getWeight("span1")', '"bold"');
+document.body.removeChild(testParent);
+
+debug('FormatBlock:');
+var editable = document.createElement('div');
+editable.innerHTML = '[<span id="span2">The text will be a child of &lt;aside>.</span>]';
+document.body.appendChild(editable);
+editable.contentEditable = true;
+var selection = window.getSelection();
+selection.selectAllChildren(editable);
+document.execCommand('FormatBlock', false, 'aside');
+selection.removeAllRanges();
+shouldBe('document.getElementById("span2").parentNode.nodeName', '"ASIDE"');
+document.body.removeChild(editable);
+
+</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698