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 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
976 { "tftp://example.com/mystartupfile", false }, | 976 { "tftp://example.com/mystartupfile", false }, |
977 { "tip://123.123.123.123/?urn:xopen:xid", false }, | 977 { "tip://123.123.123.123/?urn:xopen:xid", false }, |
978 { "tv:nbc.com", false }, | 978 { "tv:nbc.com", false }, |
979 { "urn:foo:A123,456", false }, | 979 { "urn:foo:A123,456", false }, |
980 { "vemmi://zeus.mctel.fr/demo", false }, | 980 { "vemmi://zeus.mctel.fr/demo", false }, |
981 { "wais://www.mydomain.net:8765/mydatabase", false }, | 981 { "wais://www.mydomain.net:8765/mydatabase", false }, |
982 { "xmpp:node@example.com", false }, | 982 { "xmpp:node@example.com", false }, |
983 { "xmpp://guest@example.com", false }, | 983 { "xmpp://guest@example.com", false }, |
984 }; | 984 }; |
985 | 985 |
986 URLIndexPrivateData& private_data(*GetPrivateData()); | |
987 const std::set<std::string>& whitelist(scheme_whitelist()); | 986 const std::set<std::string>& whitelist(scheme_whitelist()); |
988 for (size_t i = 0; i < arraysize(data); ++i) { | 987 for (size_t i = 0; i < arraysize(data); ++i) { |
989 GURL url(data[i].url_spec); | 988 GURL url(data[i].url_spec); |
990 EXPECT_EQ(data[i].expected_is_whitelisted, | 989 EXPECT_EQ(data[i].expected_is_whitelisted, |
991 private_data.URLSchemeIsWhitelisted(url, whitelist)); | 990 GetPrivateData()->URLSchemeIsWhitelisted(url, whitelist)); |
Peter Kasting
2014/11/18 00:41:03
This is really just a DCHECK + cheap accessor so i
| |
992 } | 991 } |
993 } | 992 } |
994 | 993 |
995 TEST_F(InMemoryURLIndexTest, ReadVisitsFromHistory) { | 994 TEST_F(InMemoryURLIndexTest, ReadVisitsFromHistory) { |
996 const HistoryInfoMap& history_info_map = GetPrivateData()->history_info_map_; | 995 const HistoryInfoMap& history_info_map = GetPrivateData()->history_info_map_; |
997 | 996 |
998 // Check (for URL with id 1) that the number of visits and their | 997 // Check (for URL with id 1) that the number of visits and their |
999 // transition types are what we expect. We don't bother checking | 998 // transition types are what we expect. We don't bother checking |
1000 // the timestamps because it's too much trouble. (The timestamps go | 999 // the timestamps because it's too much trouble. (The timestamps go |
1001 // through a transformation in InMemoryURLIndexTest::SetUp(). We | 1000 // through a transformation in InMemoryURLIndexTest::SetUp(). We |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1229 full_file_path.GetComponents(&actual_parts); | 1228 full_file_path.GetComponents(&actual_parts); |
1230 ASSERT_EQ(expected_parts.size(), actual_parts.size()); | 1229 ASSERT_EQ(expected_parts.size(), actual_parts.size()); |
1231 size_t count = expected_parts.size(); | 1230 size_t count = expected_parts.size(); |
1232 for (size_t i = 0; i < count; ++i) | 1231 for (size_t i = 0; i < count; ++i) |
1233 EXPECT_EQ(expected_parts[i], actual_parts[i]); | 1232 EXPECT_EQ(expected_parts[i], actual_parts[i]); |
1234 // Must clear the history_dir_ to satisfy the dtor's DCHECK. | 1233 // Must clear the history_dir_ to satisfy the dtor's DCHECK. |
1235 set_history_dir(base::FilePath()); | 1234 set_history_dir(base::FilePath()); |
1236 } | 1235 } |
1237 | 1236 |
1238 } // namespace history | 1237 } // namespace history |
OLD | NEW |