| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <fstream> | 6 #include <fstream> |
| 7 | 7 |
| 8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.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" |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 { "tv:nbc.com", false }, | 974 { "tv:nbc.com", false }, |
| 975 { "urn:foo:A123,456", false }, | 975 { "urn:foo:A123,456", false }, |
| 976 { "vemmi://zeus.mctel.fr/demo", false }, | 976 { "vemmi://zeus.mctel.fr/demo", false }, |
| 977 { "wais://www.mydomain.net:8765/mydatabase", false }, | 977 { "wais://www.mydomain.net:8765/mydatabase", false }, |
| 978 { "xmpp:node@example.com", false }, | 978 { "xmpp:node@example.com", false }, |
| 979 { "xmpp://guest@example.com", false }, | 979 { "xmpp://guest@example.com", false }, |
| 980 }; | 980 }; |
| 981 | 981 |
| 982 URLIndexPrivateData& private_data(*GetPrivateData()); | 982 URLIndexPrivateData& private_data(*GetPrivateData()); |
| 983 const std::set<std::string>& whitelist(scheme_whitelist()); | 983 const std::set<std::string>& whitelist(scheme_whitelist()); |
| 984 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) { | 984 for (size_t i = 0; i < arraysize(data); ++i) { |
| 985 GURL url(data[i].url_spec); | 985 GURL url(data[i].url_spec); |
| 986 EXPECT_EQ(data[i].expected_is_whitelisted, | 986 EXPECT_EQ(data[i].expected_is_whitelisted, |
| 987 private_data.URLSchemeIsWhitelisted(url, whitelist)); | 987 private_data.URLSchemeIsWhitelisted(url, whitelist)); |
| 988 } | 988 } |
| 989 } | 989 } |
| 990 | 990 |
| 991 TEST_F(InMemoryURLIndexTest, ReadVisitsFromHistory) { | 991 TEST_F(InMemoryURLIndexTest, ReadVisitsFromHistory) { |
| 992 const HistoryInfoMap& history_info_map = GetPrivateData()->history_info_map_; | 992 const HistoryInfoMap& history_info_map = GetPrivateData()->history_info_map_; |
| 993 | 993 |
| 994 // Check (for URL with id 1) that the number of visits and their | 994 // Check (for URL with id 1) that the number of visits and their |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 full_file_path.GetComponents(&actual_parts); | 1225 full_file_path.GetComponents(&actual_parts); |
| 1226 ASSERT_EQ(expected_parts.size(), actual_parts.size()); | 1226 ASSERT_EQ(expected_parts.size(), actual_parts.size()); |
| 1227 size_t count = expected_parts.size(); | 1227 size_t count = expected_parts.size(); |
| 1228 for (size_t i = 0; i < count; ++i) | 1228 for (size_t i = 0; i < count; ++i) |
| 1229 EXPECT_EQ(expected_parts[i], actual_parts[i]); | 1229 EXPECT_EQ(expected_parts[i], actual_parts[i]); |
| 1230 // Must clear the history_dir_ to satisfy the dtor's DCHECK. | 1230 // Must clear the history_dir_ to satisfy the dtor's DCHECK. |
| 1231 set_history_dir(base::FilePath()); | 1231 set_history_dir(base::FilePath()); |
| 1232 } | 1232 } |
| 1233 | 1233 |
| 1234 } // namespace history | 1234 } // namespace history |
| OLD | NEW |