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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.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/HTMLAnchorElement/set-href-attribute-whitespace.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html
index 3aae634b439c20cf41d3f2b98bcaa630b3dd59ec..1dbbdeb89a6c2a225d33f63c467bb8f813a81bb0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html
@@ -4,6 +4,54 @@
<script src="../../../resources/js-test.js"></script>
</head>
<body>
-<script src="script-tests/set-href-attribute-whitespace.js"></script>
+<script>
+description('Test setting the href attribute of an HTMLAnchorElement to a URL with leading and trailing whitespace.');
+
+var a = document.createElement('a');
+
+debug("Set href that starts with a space");
+a.href = " https://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts with a newline");
+a.href = "\nhttps://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts with a tab");
+a.href = "\thttps://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts with a carriage return");
+a.href = "\rhttps://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts with a combination of newlines, spaces and tabs");
+a.href = "\n \t\r \nhttps://www.mydomain.com/path/testurl.html?key=value";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a space");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value ";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a newline");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value\n";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a tab");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value\t";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a carriage return");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value\r";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that ends with a combination of newlines, spaces and tabs");
+a.href = "https://www.mydomain.com/path/testurl.html?key=value\n \t\r \n";
+shouldBe("a.hostname", "'www.mydomain.com'");
+
+debug("Set href that starts and ends with a combination of newlines, spaces and tabs");
+a.href = "\n \t\r \nhttps://www.mydomain.com/path/testurl.html?key=value\n \t\r \n";
+shouldBe("a.hostname", "'www.mydomain.com'");
+</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698