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/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "components/url_fixer/url_fixer.h" | 14 #include "components/url_fixer/url_fixer.h" |
15 #include "net/base/filename_util.h" | 15 #include "net/base/filename_util.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 #include "url/url_parse.h" | 18 #include "url/third_party/mozilla/url_parse.h" |
19 | 19 |
20 namespace url { | 20 namespace url { |
21 | 21 |
22 std::ostream& operator<<(std::ostream& os, const Component& part) { | 22 std::ostream& operator<<(std::ostream& os, const Component& part) { |
23 return os << "(begin=" << part.begin << ", len=" << part.len << ")"; | 23 return os << "(begin=" << part.begin << ", len=" << part.len << ")"; |
24 } | 24 } |
25 | 25 |
26 } // namespace url | 26 } // namespace url |
27 | 27 |
28 struct SegmentCase { | 28 struct SegmentCase { |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 EXPECT_TRUE(base::DeleteFile(full_path, false)); | 527 EXPECT_TRUE(base::DeleteFile(full_path, false)); |
528 EXPECT_TRUE(base::DeleteFile(new_dir, true)); | 528 EXPECT_TRUE(base::DeleteFile(new_dir, true)); |
529 | 529 |
530 // Test that an obvious HTTP URL isn't accidentally treated as an absolute | 530 // Test that an obvious HTTP URL isn't accidentally treated as an absolute |
531 // file path (on account of system-specific craziness). | 531 // file path (on account of system-specific craziness). |
532 base::FilePath empty_path; | 532 base::FilePath empty_path; |
533 base::FilePath http_url_path(FILE_PATH_LITERAL("http://../")); | 533 base::FilePath http_url_path(FILE_PATH_LITERAL("http://../")); |
534 EXPECT_TRUE( | 534 EXPECT_TRUE( |
535 url_fixer::FixupRelativeFile(empty_path, http_url_path).SchemeIs("http")); | 535 url_fixer::FixupRelativeFile(empty_path, http_url_path).SchemeIs("http")); |
536 } | 536 } |
OLD | NEW |