OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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" |
| 11 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/net/url_fixer_upper.h" | 12 #include "chrome/browser/net/url_fixer_upper.h" |
12 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
13 #include "googleurl/src/url_parse.h" | 14 #include "googleurl/src/url_parse.h" |
14 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
15 #include "net/base/net_util.h" | 16 #include "net/base/net_util.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
17 | 18 |
18 namespace { | 19 namespace { |
19 class URLFixerUpperTest : public testing::Test { | 20 class URLFixerUpperTest : public testing::Test { |
20 }; | 21 }; |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 // (should resolve to the same file as above) | 466 // (should resolve to the same file as above) |
466 relative_file_str = sub_dir.value() + FILE_PATH_LITERAL("/../") + | 467 relative_file_str = sub_dir.value() + FILE_PATH_LITERAL("/../") + |
467 sub_dir.value() + FILE_PATH_LITERAL("///./") + sub_file.value(); | 468 sub_dir.value() + FILE_PATH_LITERAL("///./") + sub_file.value(); |
468 fixedup = URLFixerUpper::FixupRelativeFile(dir, FilePath(relative_file_str)); | 469 fixedup = URLFixerUpper::FixupRelativeFile(dir, FilePath(relative_file_str)); |
469 EXPECT_TRUE(IsMatchingFileURL(fixedup, full_path)); | 470 EXPECT_TRUE(IsMatchingFileURL(fixedup, full_path)); |
470 | 471 |
471 // done with the subdir | 472 // done with the subdir |
472 EXPECT_TRUE(file_util::Delete(full_path, false)); | 473 EXPECT_TRUE(file_util::Delete(full_path, false)); |
473 EXPECT_TRUE(file_util::Delete(new_dir, true)); | 474 EXPECT_TRUE(file_util::Delete(new_dir, true)); |
474 } | 475 } |
OLD | NEW |