OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
509 // test relative directories and duplicate slashes | 509 // test relative directories and duplicate slashes |
510 // (should resolve to the same file as above) | 510 // (should resolve to the same file as above) |
511 relative_file_str = sub_dir.value() + FILE_PATH_LITERAL("/../") + | 511 relative_file_str = sub_dir.value() + FILE_PATH_LITERAL("/../") + |
512 sub_dir.value() + FILE_PATH_LITERAL("///./") + sub_file.value(); | 512 sub_dir.value() + FILE_PATH_LITERAL("///./") + sub_file.value(); |
513 EXPECT_TRUE(IsMatchingFileURL(URLFixerUpper::FixupRelativeFile(dir, | 513 EXPECT_TRUE(IsMatchingFileURL(URLFixerUpper::FixupRelativeFile(dir, |
514 FilePath(relative_file_str)).possibly_invalid_spec(), full_path)); | 514 FilePath(relative_file_str)).possibly_invalid_spec(), full_path)); |
515 | 515 |
516 // done with the subdir | 516 // done with the subdir |
517 EXPECT_TRUE(file_util::Delete(full_path, false)); | 517 EXPECT_TRUE(file_util::Delete(full_path, false)); |
518 EXPECT_TRUE(file_util::Delete(new_dir, true)); | 518 EXPECT_TRUE(file_util::Delete(new_dir, true)); |
519 | |
520 // test than an obvious HTTP URL isn't accidentally treated as an absolute | |
jar (doing other things)
2011/08/06 02:33:28
nit: Comments should be sentences, starting with u
| |
521 // file path (on account of system-specific craziness) | |
522 FilePath empty_path; | |
523 FilePath http_url_path(FILE_PATH_LITERAL("http://../")); | |
524 EXPECT_TRUE(URLFixerUpper::FixupRelativeFile( | |
525 empty_path, http_url_path).SchemeIs("http")); | |
519 } | 526 } |
OLD | NEW |