| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 {"www.google.com?foo", "", "http://www.google.com/?foo"}, | 224 {"www.google.com?foo", "", "http://www.google.com/?foo"}, |
| 225 {"www.google.com#foo", "", "http://www.google.com/#foo"}, | 225 {"www.google.com#foo", "", "http://www.google.com/#foo"}, |
| 226 {"www.google.com?", "", "http://www.google.com/?"}, | 226 {"www.google.com?", "", "http://www.google.com/?"}, |
| 227 {"www.google.com#", "", "http://www.google.com/#"}, | 227 {"www.google.com#", "", "http://www.google.com/#"}, |
| 228 {"www.google.com:123?foo#bar", "", "http://www.google.com:123/?foo#bar"}, | 228 {"www.google.com:123?foo#bar", "", "http://www.google.com:123/?foo#bar"}, |
| 229 {"user@www.google.com", "", "http://user@www.google.com/"}, | 229 {"user@www.google.com", "", "http://user@www.google.com/"}, |
| 230 {"\xE6\xB0\xB4.com" , "", "http://\xE6\xB0\xB4.com/"}, | 230 {"\xE6\xB0\xB4.com" , "", "http://\xE6\xB0\xB4.com/"}, |
| 231 // It would be better if this next case got treated as http, but I don't see | 231 // It would be better if this next case got treated as http, but I don't see |
| 232 // a clean way to guess this isn't the new-and-exciting "user" scheme. | 232 // a clean way to guess this isn't the new-and-exciting "user" scheme. |
| 233 {"user:passwd@www.google.com:8080/", "", "user:passwd@www.google.com:8080/"}, | 233 {"user:passwd@www.google.com:8080/", "", "user:passwd@www.google.com:8080/"}, |
| 234 //{"file:///c:/foo/bar%20baz.txt", "", "file:///C:/foo/bar%20baz.txt"}, | 234 // {"file:///c:/foo/bar%20baz.txt", "", "file:///C:/foo/bar%20baz.txt"}, |
| 235 {"ftp.google.com", "", "ftp://ftp.google.com/"}, | 235 {"ftp.google.com", "", "ftp://ftp.google.com/"}, |
| 236 {" ftp.google.com", "", "ftp://ftp.google.com/"}, | 236 {" ftp.google.com", "", "ftp://ftp.google.com/"}, |
| 237 {"FTP.GooGle.com", "", "ftp://FTP.GooGle.com/"}, | 237 {"FTP.GooGle.com", "", "ftp://FTP.GooGle.com/"}, |
| 238 {"ftpblah.google.com", "", "http://ftpblah.google.com/"}, | 238 {"ftpblah.google.com", "", "http://ftpblah.google.com/"}, |
| 239 {"ftp", "", "http://ftp/"}, | 239 {"ftp", "", "http://ftp/"}, |
| 240 {"google.ftp.com", "", "http://google.ftp.com/"}, | 240 {"google.ftp.com", "", "http://google.ftp.com/"}, |
| 241 // URLs which end with 0x85 (NEL in ISO-8859). | 241 // URLs which end with 0x85 (NEL in ISO-8859). |
| 242 { "http://google.com/search?q=\xd0\x85", "", | 242 { "http://google.com/search?q=\xd0\x85", "", |
| 243 "http://google.com/search?q=\xd0\x85" | 243 "http://google.com/search?q=\xd0\x85" |
| 244 }, | 244 }, |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 // (should resolve to the same file as above) | 440 // (should resolve to the same file as above) |
| 441 relative_file_str = sub_dir.value() + FILE_PATH_LITERAL("/../") + | 441 relative_file_str = sub_dir.value() + FILE_PATH_LITERAL("/../") + |
| 442 sub_dir.value() + FILE_PATH_LITERAL("///./") + sub_file.value(); | 442 sub_dir.value() + FILE_PATH_LITERAL("///./") + sub_file.value(); |
| 443 fixedup = URLFixerUpper::FixupRelativeFile(dir, FilePath(relative_file_str)); | 443 fixedup = URLFixerUpper::FixupRelativeFile(dir, FilePath(relative_file_str)); |
| 444 EXPECT_TRUE(IsMatchingFileURL(fixedup, full_path)); | 444 EXPECT_TRUE(IsMatchingFileURL(fixedup, full_path)); |
| 445 | 445 |
| 446 // done with the subdir | 446 // done with the subdir |
| 447 EXPECT_TRUE(file_util::Delete(full_path, false)); | 447 EXPECT_TRUE(file_util::Delete(full_path, false)); |
| 448 EXPECT_TRUE(file_util::Delete(new_dir, true)); | 448 EXPECT_TRUE(file_util::Delete(new_dir, true)); |
| 449 } | 449 } |
| OLD | NEW |