Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
2010-04-14 Adam Barth <abarth@webkit.org>
Reviewed by Darin Fisher. Add port URL tests https://bugs.webkit.org/show_bug.cgi?id=37524 This went pretty well. * fast/url/port-expected.txt: Added. * fast/url/port.html: Added. * fast/url/script-tests/port.js: Added. Canonical link: https://commits.webkit.org/48876@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@57588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
4 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,14 @@ | ||
Test URLs that have a port number. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
FAIL canonicalize('http://www.example.com:as df/') should be http://www.example.com:as%20df/. Was http://www.example.com:as df/. | ||
PASS canonicalize('http://www.example.com:-2/') is 'http://www.example.com:-2/' | ||
FAIL canonicalize('http://www.example.com:80/') should be http://www.example.com/. Was http://www.example.com:80/. | ||
PASS canonicalize('http://www.example.com:8080/') is 'http://www.example.com:8080/' | ||
PASS canonicalize('foobar://www.example.com:80/') is 'foobar://www.example.com:80/' | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="../js/resources/js-test-style.css"> | ||
<script src="../js/resources/js-test-pre.js"></script> | ||
<script src="resources/utilities.js"></script> | ||
</head> | ||
<body> | ||
<p id="description"></p> | ||
<div id="console"></div> | ||
<script src="script-tests/port.js"></script> | ||
<script src="../js/resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,21 @@ | ||
description("Test URLs that have a port number."); | ||
|
||
cases = [ | ||
// Invalid input should be copied w/ failure. | ||
["as df", ":as%20df"], | ||
["-2", ":-2"], | ||
// Default port should be omitted. | ||
["80", ""], | ||
["8080", ":8080"], | ||
]; | ||
|
||
for (var i = 0; i < cases.length; ++i) { | ||
shouldBe("canonicalize('http://www.example.com:" + cases[i][0] + "/')", | ||
"'http://www.example.com" + cases[i][1] + "/'"); | ||
} | ||
|
||
// Unspecified port should mean always keep the port. | ||
shouldBe("canonicalize('foobar://www.example.com:80/')", | ||
"'foobar://www.example.com:80/'"); | ||
|
||
var successfullyParsed = true; |