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

Unified Diff: LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-host.js

Issue 26506003: Setting host without port should keep old port (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: git rebase Created 7 years, 2 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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-host.js
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-host.js b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-host.js
index c20430f1619e1d73fa49a3123d9390e370954270..b9ab87c2979bd54516fc56c49738a1f2aed48b39 100644
--- a/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-host.js
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-host.js
@@ -7,6 +7,11 @@ a.href = "https://www.mydomain.com:8080/path/";
a.host = "www.otherdomain.com:0";
shouldBe("a.href", "'https://www.otherdomain.com:0/path/'");
+debug("Set host without port");
+a.href = "https://www.mydomain.com:8080/path/";
+a.host = "www.otherdomain.com";
+shouldBe("a.href", "'https://www.otherdomain.com:8080/path/'");
+
// IE8 throws "The URL is invalid" exception.
debug("Set host with '?' in it");
try {
@@ -27,6 +32,11 @@ a.href = "https://www.mydomain.com:8080/path/";
a.host = "www.otherdomain.com:443";
shouldBe("a.href", "'https://www.otherdomain.com/path/'");
+debug("Set host with invalid port");
+a.href = "https://www.mydomain.com:8080/path/";
+a.host = "www.otherdomain.com:invalid";
+shouldBe("a.href", "'https://www.otherdomain.com:0/path/'");
+
// Firefox 3.5.2 rejects a port that contains non-digits.
debug("Set host with letters in port number");
a.href = "https://www.mydomain.com:8080/path/";
@@ -69,7 +79,7 @@ debug("Set host containing slashes in it");
try {
a.href = "https://www.mydomain.com:8080/path/";
a.host = "www.other\dom/ain.com";
-shouldBe("a.href", "'https://www.otherdom/ain.com/path/'");
+shouldBe("a.href", "'https://www.otherdom%2Fain.com:8080/path/'");
} catch(e) {
debug("Exception: " + e.description);
}
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698