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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Document/title-with-multiple-children.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/Document/title-with-multiple-children.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/title-with-multiple-children.html b/third_party/WebKit/LayoutTests/fast/dom/Document/title-with-multiple-children.html
index 427f72eea237d1e5ce9adc12aeefa03c9c0cb509..e7e4450b63c448799e1d1bad6d44291b5d4f246a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/title-with-multiple-children.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/title-with-multiple-children.html
@@ -4,6 +4,35 @@
<script src="../../../resources/js-test.js"></script>
</head>
<body>
-<script src="script-tests/title-with-multiple-children.js"></script>
+<script>
+description("This test checks to see if setting document.title works even if the title element has multiple children.");
+
+// Setup - create title element.
+shouldBe("document.getElementsByTagName('title').length", "0");
+var titleElement = document.createElement("title");
+document.body.appendChild(titleElement);
+
+// For case with no children.
+shouldBe("document.title", "''");
+shouldBe("titleElement.text", "''");
+
+// For case with single children.
+var firstText = "First";
+titleElement.appendChild(document.createTextNode(firstText));
+shouldBe("document.title", "firstText");
+shouldBe("titleElement.text", "firstText");
+
+// For case with 2 children.
+var secondText = "Second";
+titleElement.appendChild(document.createTextNode(secondText));
+shouldBe("document.title", "firstText + secondText");
+shouldBe("titleElement.text", "firstText + secondText");
+
+// override title with setting document.title with multiple title children.
+var expected = "This title is set by property";
+document.title = expected;
+shouldBe("document.title", "expected");
+shouldBe("titleElement.text", "expected");
+</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698