2010-04-14 Adam Barth <abarth@webkit.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Apr 2010 17:16:50 +0000 (17:16 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Apr 2010 17:16:50 +0000 (17:16 +0000)
        Reviewed by Darin Fisher.

        Add LayoutTests for parsing "path" URLs
        https://bugs.webkit.org/show_bug.cgi?id=37581

        * fast/url/path-url-expected.txt: Added.
        * fast/url/path-url.html: Added.
        * fast/url/script-tests/path-url.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@57586 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/url/path-url-expected.txt [new file with mode: 0644]
LayoutTests/fast/url/path-url.html [new file with mode: 0644]
LayoutTests/fast/url/script-tests/path-url.js [new file with mode: 0644]

index 8a305a3..8c58853 100644 (file)
@@ -2,6 +2,17 @@
 
         Reviewed by Darin Fisher.
 
+        Add LayoutTests for parsing "path" URLs
+        https://bugs.webkit.org/show_bug.cgi?id=37581
+
+        * fast/url/path-url-expected.txt: Added.
+        * fast/url/path-url.html: Added.
+        * fast/url/script-tests/path-url.js: Added.
+
+2010-04-14  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Fisher.
+
         Add LayoutTests for parsing standard URLs
         https://bugs.webkit.org/show_bug.cgi?id=37580
 
diff --git a/LayoutTests/fast/url/path-url-expected.txt b/LayoutTests/fast/url/path-url-expected.txt
new file mode 100644 (file)
index 0000000..73eaf54
--- /dev/null
@@ -0,0 +1,11 @@
+Canonicalization of path URLs
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS canonicalize('javascript:') is 'javascript:'
+FAIL canonicalize('JavaScript:Foo') should be javascript:Foo. Was JavaScript:Foo.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/url/path-url.html b/LayoutTests/fast/url/path-url.html
new file mode 100644 (file)
index 0000000..b1bfbbc
--- /dev/null
@@ -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/path-url.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/url/script-tests/path-url.js b/LayoutTests/fast/url/script-tests/path-url.js
new file mode 100644 (file)
index 0000000..5398df9
--- /dev/null
@@ -0,0 +1,17 @@
+description("Canonicalization of path URLs");
+
+cases = [ 
+  ["javascript:", "javascript:"],
+  ["JavaScript:Foo", "javascript:Foo"],
+  // Disabled because this gets treated as a relative URL.
+  // [":\":This /is interesting;?#", ":\":This /is interesting;?#"],
+];
+
+for (var i = 0; i < cases.length; ++i) {
+  test_vector = cases[i][0];
+  expected_result = cases[i][1];
+  shouldBe("canonicalize('" + test_vector + "')",
+           "'" + expected_result + "'");
+}
+
+var successfullyParsed = true;