summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 02:22:50 +0000
committerukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 02:22:50 +0000
commitbd570d0d7e1bc9d1488b06d5810e9c03fcdffce0 (patch)
treebb3d85033593c0bc400a2c3392291627c4b5fffb
parent415e9cb74e16fb4be951ee33a3278ebe5bd4890f (diff)
downloadchromium_src-bd570d0d7e1bc9d1488b06d5810e9c03fcdffce0.zip
chromium_src-bd570d0d7e1bc9d1488b06d5810e9c03fcdffce0.tar.gz
chromium_src-bd570d0d7e1bc9d1488b06d5810e9c03fcdffce0.tar.bz2
Fix GKURL SameGetters and Different Getters
WebKit r51589 fixed chromium's KURL::query() to match with original KURL. query() returns an empty string if query is specified but empty. (e.g. http://example.com/path?) query() returns a null string if query is not specified. (e.g. http://example.com/path) This is necessary to distinguish these two URLs. BUG=29212 TEST=test_shell_tests passes Review URL: http://codereview.chromium.org/462017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33778 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/tools/webcore_unit_tests/GKURL_unittest.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/webkit/tools/webcore_unit_tests/GKURL_unittest.cpp b/webkit/tools/webcore_unit_tests/GKURL_unittest.cpp
index 7f864ad..64019ab 100644
--- a/webkit/tools/webcore_unit_tests/GKURL_unittest.cpp
+++ b/webkit/tools/webcore_unit_tests/GKURL_unittest.cpp
@@ -70,8 +70,7 @@ std::ostream& operator<<(std::ostream& out,
} // namespace
// Test the cases where we should be the same as WebKit's old KURL.
-// Disabled for now: http://crbug.com/29212
-TEST(GKURL, DISABLED_SameGetters) {
+TEST(GKURL, SameGetters) {
struct GetterCase {
const char* url;
const char* protocol;
@@ -85,10 +84,10 @@ TEST(GKURL, DISABLED_SameGetters) {
bool has_ref;
} cases[] = {
{"http://www.google.com/foo/blah?bar=baz#ref", "http", "www.google.com", 0, "", NULL, "blah", "bar=baz", "ref", true},
- {"http://foo.com:1234/foo/bar/", "http", "foo.com", 1234, "", NULL, "bar", "", NULL, false},
+ {"http://foo.com:1234/foo/bar/", "http", "foo.com", 1234, "", NULL, "bar", NULL, NULL, false},
{"http://www.google.com?#", "http", "www.google.com", 0, "", NULL, NULL, "", "", true},
- {"https://me:pass@google.com:23#foo", "https", "google.com", 23, "me", "pass", NULL, "", "foo", true},
- {"javascript:hello!//world", "javascript", "", 0, "", NULL, "world", "", NULL, false},
+ {"https://me:pass@google.com:23#foo", "https", "google.com", 23, "me", "pass", NULL, NULL, "foo", true},
+ {"javascript:hello!//world", "javascript", "", 0, "", NULL, "world", NULL, NULL, false},
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); i++) {
@@ -126,24 +125,23 @@ TEST(GKURL, DISABLED_SameGetters) {
// Test a few cases where we're different just to make sure we give reasonable
// output.
-// Disabled for now: http://crbug.com/29212
-TEST(GKURL, DISABLED_DifferentGetters) {
+TEST(GKURL, DifferentGetters) {
ComponentCase cases[] = {
// url protocol host port user pass path last_path query ref
// Old WebKit allows references and queries in what we call "path" URLs
// like javascript, so the path here will only consist of "hello!".
- {"javascript:hello!?#/\\world", "javascript", "", 0, "", NULL, "hello!?#/\\world", "world", "", NULL},
+ {"javascript:hello!?#/\\world", "javascript", "", 0, "", NULL, "hello!?#/\\world", "world", NULL, NULL},
// Old WebKit doesn't handle "parameters" in paths, so will
// disagree with us about where the path is for this URL.
- {"http://a.com/hello;world", "http", "a.com", 0, "", NULL, "/hello;world", "hello", "", NULL},
+ {"http://a.com/hello;world", "http", "a.com", 0, "", NULL, "/hello;world", "hello", NULL, NULL},
// WebKit doesn't like UTF-8 or UTF-16 input.
- {"http://\xe4\xbd\xa0\xe5\xa5\xbd\xe4\xbd\xa0\xe5\xa5\xbd/", "http", "xn--6qqa088eba", 0, "", NULL, "/", NULL, "", NULL},
+ {"http://\xe4\xbd\xa0\xe5\xa5\xbd\xe4\xbd\xa0\xe5\xa5\xbd/", "http", "xn--6qqa088eba", 0, "", NULL, "/", NULL, NULL, NULL},
// WebKit %-escapes non-ASCII characters in reference, but we don't.
- {"http://www.google.com/foo/blah?bar=baz#\xce\xb1\xce\xb2", "http", "www.google.com", 0, "", NULL, "/foo/blah/", "blah", "bar=baz", "\xce\xb1\xce\xb2"}
+ {"http://www.google.com/foo/blah?bar=baz#\xce\xb1\xce\xb2", "http", "www.google.com", 0, "", NULL, "/foo/blah/", "blah", "bar=baz", "\xce\xb1\xce\xb2"},
};
for (size_t i = 0; i < arraysize(cases); i++) {