| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <memory> |
| 5 #include <set> | 6 #include <set> |
| 6 #include <utility> | 7 #include <utility> |
| 7 #include <vector> | 8 #include <vector> |
| 8 | 9 |
| 9 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 12 #include "chrome/browser/predictors/predictor_database.h" | 13 #include "chrome/browser/predictors/predictor_database.h" |
| 13 #include "chrome/browser/predictors/resource_prefetch_predictor_tables.h" | 14 #include "chrome/browser/predictors/resource_prefetch_predictor_tables.h" |
| 14 #include "chrome/browser/predictors/resource_prefetch_predictor_test_util.h" | 15 #include "chrome/browser/predictors/resource_prefetch_predictor_test_util.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 34 void TestDeleteData(); | 35 void TestDeleteData(); |
| 35 void TestDeleteSingleDataPoint(); | 36 void TestDeleteSingleDataPoint(); |
| 36 void TestDeleteAllData(); | 37 void TestDeleteAllData(); |
| 37 | 38 |
| 38 content::TestBrowserThreadBundle thread_bundle_; | 39 content::TestBrowserThreadBundle thread_bundle_; |
| 39 TestingProfile profile_; | 40 TestingProfile profile_; |
| 40 std::unique_ptr<PredictorDatabase> db_; | 41 std::unique_ptr<PredictorDatabase> db_; |
| 41 scoped_refptr<ResourcePrefetchPredictorTables> tables_; | 42 scoped_refptr<ResourcePrefetchPredictorTables> tables_; |
| 42 | 43 |
| 43 using PrefetchDataMap = ResourcePrefetchPredictorTables::PrefetchDataMap; | 44 using PrefetchDataMap = ResourcePrefetchPredictorTables::PrefetchDataMap; |
| 45 using RedirectDataMap = ResourcePrefetchPredictorTables::RedirectDataMap; |
| 44 | 46 |
| 45 private: | 47 private: |
| 46 using PrefetchData = ResourcePrefetchPredictorTables::PrefetchData; | 48 using PrefetchData = ResourcePrefetchPredictorTables::PrefetchData; |
| 47 | 49 |
| 48 // Initializes the tables, |test_url_data_| and |test_host_data_|. | 50 // Initializes the tables, |test_url_data_| and |test_host_data_|. |
| 49 void InitializeSampleData(); | 51 void InitializeSampleData(); |
| 50 | 52 |
| 51 // Checks that the input PrefetchData are the same, although the resources | 53 // Checks that the input PrefetchData are the same, although the resources |
| 52 // can be in different order. | 54 // can be in different order. |
| 53 void TestPrefetchDataAreEqual(const PrefetchDataMap& lhs, | 55 void TestPrefetchDataAreEqual(const PrefetchDataMap& lhs, |
| 54 const PrefetchDataMap& rhs) const; | 56 const PrefetchDataMap& rhs) const; |
| 55 void TestResourcesAreEqual(const std::vector<ResourceData>& lhs, | 57 void TestResourcesAreEqual(const std::vector<ResourceData>& lhs, |
| 56 const std::vector<ResourceData>& rhs) const; | 58 const std::vector<ResourceData>& rhs) const; |
| 57 | 59 |
| 60 // Checks that the input RedirectData are the same, although the redirects |
| 61 // can be in different order. |
| 62 void TestRedirectDataAreEqual(const RedirectDataMap& lhs, |
| 63 const RedirectDataMap& rhs) const; |
| 64 void TestRedirectsAreEqual(const std::vector<RedirectStat>& lhs, |
| 65 const std::vector<RedirectStat>& rhs) const; |
| 66 |
| 58 void AddKey(PrefetchDataMap* m, const std::string& key) const; | 67 void AddKey(PrefetchDataMap* m, const std::string& key) const; |
| 68 void AddKey(RedirectDataMap* m, const std::string& key) const; |
| 59 | 69 |
| 60 PrefetchDataMap test_url_data_; | 70 PrefetchDataMap test_url_data_; |
| 61 PrefetchDataMap test_host_data_; | 71 PrefetchDataMap test_host_data_; |
| 72 RedirectDataMap test_url_redirect_data_; |
| 73 RedirectDataMap test_host_redirect_data_; |
| 62 }; | 74 }; |
| 63 | 75 |
| 64 class ResourcePrefetchPredictorTablesReopenTest | 76 class ResourcePrefetchPredictorTablesReopenTest |
| 65 : public ResourcePrefetchPredictorTablesTest { | 77 : public ResourcePrefetchPredictorTablesTest { |
| 66 public: | 78 public: |
| 67 void SetUp() override { | 79 void SetUp() override { |
| 68 // Write data to the table, and then reopen the db. | 80 // Write data to the table, and then reopen the db. |
| 69 ResourcePrefetchPredictorTablesTest::SetUp(); | 81 ResourcePrefetchPredictorTablesTest::SetUp(); |
| 70 ResourcePrefetchPredictorTablesTest::TearDown(); | 82 ResourcePrefetchPredictorTablesTest::TearDown(); |
| 71 | 83 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 88 } | 100 } |
| 89 | 101 |
| 90 void ResourcePrefetchPredictorTablesTest::TearDown() { | 102 void ResourcePrefetchPredictorTablesTest::TearDown() { |
| 91 tables_ = NULL; | 103 tables_ = NULL; |
| 92 db_.reset(); | 104 db_.reset(); |
| 93 base::RunLoop().RunUntilIdle(); | 105 base::RunLoop().RunUntilIdle(); |
| 94 } | 106 } |
| 95 | 107 |
| 96 void ResourcePrefetchPredictorTablesTest::TestGetAllData() { | 108 void ResourcePrefetchPredictorTablesTest::TestGetAllData() { |
| 97 PrefetchDataMap actual_url_data, actual_host_data; | 109 PrefetchDataMap actual_url_data, actual_host_data; |
| 98 tables_->GetAllData(&actual_url_data, &actual_host_data); | 110 RedirectDataMap actual_url_redirect_data, actual_host_redirect_data; |
| 111 tables_->GetAllData(&actual_url_data, &actual_host_data, |
| 112 &actual_url_redirect_data, &actual_host_redirect_data); |
| 99 | 113 |
| 100 TestPrefetchDataAreEqual(test_url_data_, actual_url_data); | 114 TestPrefetchDataAreEqual(test_url_data_, actual_url_data); |
| 101 TestPrefetchDataAreEqual(test_host_data_, actual_host_data); | 115 TestPrefetchDataAreEqual(test_host_data_, actual_host_data); |
| 116 TestRedirectDataAreEqual(test_url_redirect_data_, actual_url_redirect_data); |
| 117 TestRedirectDataAreEqual(test_host_redirect_data_, actual_host_redirect_data); |
| 102 } | 118 } |
| 103 | 119 |
| 104 void ResourcePrefetchPredictorTablesTest::TestDeleteData() { | 120 void ResourcePrefetchPredictorTablesTest::TestDeleteData() { |
| 105 std::vector<std::string> urls_to_delete, hosts_to_delete; | 121 std::vector<std::string> urls_to_delete = {"http://www.google.com", |
| 106 urls_to_delete.push_back("http://www.google.com"); | 122 "http://www.yahoo.com"}; |
| 107 urls_to_delete.push_back("http://www.yahoo.com"); | 123 std::vector<std::string> hosts_to_delete = {"www.yahoo.com"}; |
| 108 hosts_to_delete.push_back("www.yahoo.com"); | |
| 109 | 124 |
| 110 tables_->DeleteData(urls_to_delete, hosts_to_delete); | 125 tables_->DeleteResourceData(urls_to_delete, hosts_to_delete); |
| 126 |
| 127 urls_to_delete = {"http://fb.com/google", "http://google.com"}; |
| 128 hosts_to_delete = {"microsoft.com"}; |
| 129 |
| 130 tables_->DeleteRedirectData(urls_to_delete, hosts_to_delete); |
| 111 | 131 |
| 112 PrefetchDataMap actual_url_data, actual_host_data; | 132 PrefetchDataMap actual_url_data, actual_host_data; |
| 113 tables_->GetAllData(&actual_url_data, &actual_host_data); | 133 RedirectDataMap actual_url_redirect_data, actual_host_redirect_data; |
| 134 tables_->GetAllData(&actual_url_data, &actual_host_data, |
| 135 &actual_url_redirect_data, &actual_host_redirect_data); |
| 114 | 136 |
| 115 PrefetchDataMap expected_url_data, expected_host_data; | 137 PrefetchDataMap expected_url_data, expected_host_data; |
| 138 RedirectDataMap expected_url_redirect_data, expected_host_redirect_data; |
| 116 AddKey(&expected_url_data, "http://www.reddit.com"); | 139 AddKey(&expected_url_data, "http://www.reddit.com"); |
| 117 AddKey(&expected_host_data, "www.facebook.com"); | 140 AddKey(&expected_host_data, "www.facebook.com"); |
| 141 AddKey(&expected_url_redirect_data, "http://nyt.com"); |
| 142 AddKey(&expected_host_redirect_data, "bbc.com"); |
| 118 | 143 |
| 119 TestPrefetchDataAreEqual(expected_url_data, actual_url_data); | 144 TestPrefetchDataAreEqual(expected_url_data, actual_url_data); |
| 120 TestPrefetchDataAreEqual(expected_host_data, actual_host_data); | 145 TestPrefetchDataAreEqual(expected_host_data, actual_host_data); |
| 146 TestRedirectDataAreEqual(expected_url_redirect_data, |
| 147 actual_url_redirect_data); |
| 148 TestRedirectDataAreEqual(expected_host_redirect_data, |
| 149 actual_host_redirect_data); |
| 121 } | 150 } |
| 122 | 151 |
| 123 void ResourcePrefetchPredictorTablesTest::TestDeleteSingleDataPoint() { | 152 void ResourcePrefetchPredictorTablesTest::TestDeleteSingleDataPoint() { |
| 124 // Delete a URL. | 153 // Delete a URL. |
| 125 tables_->DeleteSingleDataPoint("http://www.reddit.com", | 154 tables_->DeleteSingleResourceDataPoint("http://www.reddit.com", |
| 126 PREFETCH_KEY_TYPE_URL); | 155 PREFETCH_KEY_TYPE_URL); |
| 127 | 156 |
| 128 PrefetchDataMap actual_url_data, actual_host_data; | 157 PrefetchDataMap actual_url_data, actual_host_data; |
| 129 tables_->GetAllData(&actual_url_data, &actual_host_data); | 158 RedirectDataMap actual_url_redirect_data, actual_host_redirect_data; |
| 159 tables_->GetAllData(&actual_url_data, &actual_host_data, |
| 160 &actual_url_redirect_data, &actual_host_redirect_data); |
| 130 | 161 |
| 131 PrefetchDataMap expected_url_data; | 162 PrefetchDataMap expected_url_data; |
| 132 AddKey(&expected_url_data, "http://www.google.com"); | 163 AddKey(&expected_url_data, "http://www.google.com"); |
| 133 AddKey(&expected_url_data, "http://www.yahoo.com"); | 164 AddKey(&expected_url_data, "http://www.yahoo.com"); |
| 134 | 165 |
| 135 TestPrefetchDataAreEqual(expected_url_data, actual_url_data); | 166 TestPrefetchDataAreEqual(expected_url_data, actual_url_data); |
| 136 TestPrefetchDataAreEqual(test_host_data_, actual_host_data); | 167 TestPrefetchDataAreEqual(test_host_data_, actual_host_data); |
| 168 TestRedirectDataAreEqual(test_url_redirect_data_, actual_url_redirect_data); |
| 169 TestRedirectDataAreEqual(test_host_redirect_data_, actual_host_redirect_data); |
| 137 | 170 |
| 138 // Delete a host. | 171 // Delete a host. |
| 139 tables_->DeleteSingleDataPoint("www.facebook.com", PREFETCH_KEY_TYPE_HOST); | 172 tables_->DeleteSingleResourceDataPoint("www.facebook.com", |
| 173 PREFETCH_KEY_TYPE_HOST); |
| 140 actual_url_data.clear(); | 174 actual_url_data.clear(); |
| 141 actual_host_data.clear(); | 175 actual_host_data.clear(); |
| 142 tables_->GetAllData(&actual_url_data, &actual_host_data); | 176 actual_url_redirect_data.clear(); |
| 177 actual_host_redirect_data.clear(); |
| 178 tables_->GetAllData(&actual_url_data, &actual_host_data, |
| 179 &actual_url_redirect_data, &actual_host_redirect_data); |
| 143 | 180 |
| 144 PrefetchDataMap expected_host_data; | 181 PrefetchDataMap expected_host_data; |
| 145 AddKey(&expected_host_data, "www.yahoo.com"); | 182 AddKey(&expected_host_data, "www.yahoo.com"); |
| 146 | 183 |
| 147 TestPrefetchDataAreEqual(expected_url_data, actual_url_data); | 184 TestPrefetchDataAreEqual(expected_url_data, actual_url_data); |
| 148 TestPrefetchDataAreEqual(expected_host_data, actual_host_data); | 185 TestPrefetchDataAreEqual(expected_host_data, actual_host_data); |
| 186 TestRedirectDataAreEqual(test_url_redirect_data_, actual_url_redirect_data); |
| 187 TestRedirectDataAreEqual(test_host_redirect_data_, actual_host_redirect_data); |
| 188 |
| 189 // Delete a URL redirect. |
| 190 tables_->DeleteSingleRedirectDataPoint("http://nyt.com", |
| 191 PREFETCH_KEY_TYPE_URL); |
| 192 actual_url_data.clear(); |
| 193 actual_host_data.clear(); |
| 194 actual_url_redirect_data.clear(); |
| 195 actual_host_redirect_data.clear(); |
| 196 tables_->GetAllData(&actual_url_data, &actual_host_data, |
| 197 &actual_url_redirect_data, &actual_host_redirect_data); |
| 198 |
| 199 RedirectDataMap expected_url_redirect_data; |
| 200 AddKey(&expected_url_redirect_data, "http://fb.com/google"); |
| 201 AddKey(&expected_url_redirect_data, "http://google.com"); |
| 202 |
| 203 TestPrefetchDataAreEqual(expected_url_data, actual_url_data); |
| 204 TestPrefetchDataAreEqual(expected_host_data, actual_host_data); |
| 205 TestRedirectDataAreEqual(expected_url_redirect_data, |
| 206 actual_url_redirect_data); |
| 207 TestRedirectDataAreEqual(test_host_redirect_data_, actual_host_redirect_data); |
| 208 |
| 209 // Delete a host redirect. |
| 210 tables_->DeleteSingleRedirectDataPoint("bbc.com", PREFETCH_KEY_TYPE_HOST); |
| 211 actual_url_data.clear(); |
| 212 actual_host_data.clear(); |
| 213 actual_url_redirect_data.clear(); |
| 214 actual_host_redirect_data.clear(); |
| 215 tables_->GetAllData(&actual_url_data, &actual_host_data, |
| 216 &actual_url_redirect_data, &actual_host_redirect_data); |
| 217 |
| 218 RedirectDataMap expected_host_redirect_data; |
| 219 AddKey(&expected_host_redirect_data, "microsoft.com"); |
| 220 |
| 221 TestPrefetchDataAreEqual(expected_url_data, actual_url_data); |
| 222 TestPrefetchDataAreEqual(expected_host_data, actual_host_data); |
| 223 TestRedirectDataAreEqual(expected_url_redirect_data, |
| 224 actual_url_redirect_data); |
| 225 TestRedirectDataAreEqual(expected_host_redirect_data, |
| 226 actual_host_redirect_data); |
| 149 } | 227 } |
| 150 | 228 |
| 151 void ResourcePrefetchPredictorTablesTest::TestUpdateData() { | 229 void ResourcePrefetchPredictorTablesTest::TestUpdateData() { |
| 152 PrefetchData google(PREFETCH_KEY_TYPE_URL, "http://www.google.com"); | 230 PrefetchData google(PREFETCH_KEY_TYPE_URL, "http://www.google.com"); |
| 153 google.last_visit = base::Time::FromInternalValue(10); | 231 google.last_visit = base::Time::FromInternalValue(10); |
| 154 google.resources.push_back(CreateResourceData( | 232 google.resources.push_back(CreateResourceData( |
| 155 "http://www.google.com/style.css", content::RESOURCE_TYPE_STYLESHEET, 6, | 233 "http://www.google.com/style.css", content::RESOURCE_TYPE_STYLESHEET, 6, |
| 156 2, 0, 1.0, net::MEDIUM, true, false)); | 234 2, 0, 1.0, net::MEDIUM, true, false)); |
| 157 google.resources.push_back(CreateResourceData( | 235 google.resources.push_back(CreateResourceData( |
| 158 "http://www.google.com/image.png", content::RESOURCE_TYPE_IMAGE, 6, 4, 1, | 236 "http://www.google.com/image.png", content::RESOURCE_TYPE_IMAGE, 6, 4, 1, |
| 159 4.2, net::MEDIUM, false, false)); | 237 4.2, net::MEDIUM, false, false)); |
| 160 google.resources.push_back(CreateResourceData( | 238 google.resources.push_back(CreateResourceData( |
| 161 "http://www.google.com/a.xml", content::RESOURCE_TYPE_LAST_TYPE, 1, 0, 0, | 239 "http://www.google.com/a.xml", content::RESOURCE_TYPE_LAST_TYPE, 1, 0, 0, |
| 162 6.1, net::MEDIUM, false, false)); | 240 6.1, net::MEDIUM, false, false)); |
| 163 google.resources.push_back(CreateResourceData( | 241 google.resources.push_back(CreateResourceData( |
| 164 "http://www.resources.google.com/script.js", | 242 "http://www.resources.google.com/script.js", |
| 165 content::RESOURCE_TYPE_SCRIPT, 12, 0, 0, 8.5, net::MEDIUM, true, true)); | 243 content::RESOURCE_TYPE_SCRIPT, 12, 0, 0, 8.5, net::MEDIUM, true, true)); |
| 166 | 244 |
| 167 PrefetchData yahoo(PREFETCH_KEY_TYPE_HOST, "www.yahoo.com"); | 245 PrefetchData yahoo(PREFETCH_KEY_TYPE_HOST, "www.yahoo.com"); |
| 168 yahoo.last_visit = base::Time::FromInternalValue(7); | 246 yahoo.last_visit = base::Time::FromInternalValue(7); |
| 169 yahoo.resources.push_back(CreateResourceData( | 247 yahoo.resources.push_back(CreateResourceData( |
| 170 "http://www.yahoo.com/image.png", content::RESOURCE_TYPE_IMAGE, 120, 1, 1, | 248 "http://www.yahoo.com/image.png", content::RESOURCE_TYPE_IMAGE, 120, 1, 1, |
| 171 10.0, net::MEDIUM, true, false)); | 249 10.0, net::MEDIUM, true, false)); |
| 172 | 250 |
| 173 tables_->UpdateData(google, yahoo); | 251 RedirectData facebook; |
| 252 facebook.set_primary_key("http://fb.com/google"); |
| 253 facebook.set_last_visit_time(20); |
| 254 InitializeRedirectStat(facebook.add_redirect_endpoints(), |
| 255 "https://facebook.fr/google", 4, 2, 1); |
| 256 |
| 257 RedirectData microsoft; |
| 258 microsoft.set_primary_key("microsoft.com"); |
| 259 microsoft.set_last_visit_time(21); |
| 260 InitializeRedirectStat(microsoft.add_redirect_endpoints(), "m.microsoft.com", |
| 261 5, 7, 1); |
| 262 InitializeRedirectStat(microsoft.add_redirect_endpoints(), "microsoft.org", 7, |
| 263 2, 0); |
| 264 |
| 265 tables_->UpdateData(google, yahoo, facebook, microsoft); |
| 174 | 266 |
| 175 PrefetchDataMap actual_url_data, actual_host_data; | 267 PrefetchDataMap actual_url_data, actual_host_data; |
| 176 tables_->GetAllData(&actual_url_data, &actual_host_data); | 268 RedirectDataMap actual_url_redirect_data, actual_host_redirect_data; |
| 269 tables_->GetAllData(&actual_url_data, &actual_host_data, |
| 270 &actual_url_redirect_data, &actual_host_redirect_data); |
| 177 | 271 |
| 178 PrefetchDataMap expected_url_data, expected_host_data; | 272 PrefetchDataMap expected_url_data, expected_host_data; |
| 273 RedirectDataMap expected_url_redirect_data, expected_host_redirect_data; |
| 179 AddKey(&expected_url_data, "http://www.reddit.com"); | 274 AddKey(&expected_url_data, "http://www.reddit.com"); |
| 180 AddKey(&expected_url_data, "http://www.yahoo.com"); | 275 AddKey(&expected_url_data, "http://www.yahoo.com"); |
| 181 expected_url_data.insert(std::make_pair("http://www.google.com", google)); | 276 expected_url_data.insert(std::make_pair("http://www.google.com", google)); |
| 182 | 277 |
| 183 AddKey(&expected_host_data, "www.facebook.com"); | 278 AddKey(&expected_host_data, "www.facebook.com"); |
| 184 expected_host_data.insert(std::make_pair("www.yahoo.com", yahoo)); | 279 expected_host_data.insert(std::make_pair("www.yahoo.com", yahoo)); |
| 185 | 280 |
| 281 AddKey(&expected_url_redirect_data, "http://nyt.com"); |
| 282 AddKey(&expected_url_redirect_data, "http://google.com"); |
| 283 expected_url_redirect_data.insert( |
| 284 std::make_pair("http://fb.com/google", facebook)); |
| 285 |
| 286 AddKey(&expected_host_redirect_data, "bbc.com"); |
| 287 expected_host_redirect_data.insert( |
| 288 std::make_pair("microsoft.com", microsoft)); |
| 289 |
| 186 TestPrefetchDataAreEqual(expected_url_data, actual_url_data); | 290 TestPrefetchDataAreEqual(expected_url_data, actual_url_data); |
| 187 TestPrefetchDataAreEqual(expected_host_data, actual_host_data); | 291 TestPrefetchDataAreEqual(expected_host_data, actual_host_data); |
| 292 TestRedirectDataAreEqual(expected_url_redirect_data, |
| 293 actual_url_redirect_data); |
| 294 TestRedirectDataAreEqual(expected_host_redirect_data, |
| 295 actual_host_redirect_data); |
| 188 } | 296 } |
| 189 | 297 |
| 190 void ResourcePrefetchPredictorTablesTest::TestDeleteAllData() { | 298 void ResourcePrefetchPredictorTablesTest::TestDeleteAllData() { |
| 191 tables_->DeleteAllData(); | 299 tables_->DeleteAllData(); |
| 192 | 300 |
| 193 PrefetchDataMap actual_url_data, actual_host_data; | 301 PrefetchDataMap actual_url_data, actual_host_data; |
| 194 tables_->GetAllData(&actual_url_data, &actual_host_data); | 302 RedirectDataMap actual_url_redirect_data, actual_host_redirect_data; |
| 303 tables_->GetAllData(&actual_url_data, &actual_host_data, |
| 304 &actual_url_redirect_data, &actual_host_redirect_data); |
| 195 EXPECT_TRUE(actual_url_data.empty()); | 305 EXPECT_TRUE(actual_url_data.empty()); |
| 196 EXPECT_TRUE(actual_host_data.empty()); | 306 EXPECT_TRUE(actual_host_data.empty()); |
| 307 EXPECT_TRUE(actual_url_redirect_data.empty()); |
| 308 EXPECT_TRUE(actual_host_redirect_data.empty()); |
| 197 } | 309 } |
| 198 | 310 |
| 199 void ResourcePrefetchPredictorTablesTest::TestPrefetchDataAreEqual( | 311 void ResourcePrefetchPredictorTablesTest::TestPrefetchDataAreEqual( |
| 200 const PrefetchDataMap& lhs, | 312 const PrefetchDataMap& lhs, |
| 201 const PrefetchDataMap& rhs) const { | 313 const PrefetchDataMap& rhs) const { |
| 202 EXPECT_EQ(lhs.size(), rhs.size()); | 314 EXPECT_EQ(lhs.size(), rhs.size()); |
| 203 | 315 |
| 204 for (const std::pair<std::string, PrefetchData>& p : rhs) { | 316 for (const std::pair<std::string, PrefetchData>& p : rhs) { |
| 205 PrefetchDataMap::const_iterator lhs_it = lhs.find(p.first); | 317 const auto lhs_it = lhs.find(p.first); |
| 206 ASSERT_TRUE(lhs_it != lhs.end()) << p.first; | 318 ASSERT_TRUE(lhs_it != lhs.end()) << p.first; |
| 319 EXPECT_TRUE(lhs_it->second.key_type == p.second.key_type); |
| 320 EXPECT_TRUE(lhs_it->second.last_visit == p.second.last_visit); |
| 207 | 321 |
| 208 TestResourcesAreEqual(lhs_it->second.resources, p.second.resources); | 322 TestResourcesAreEqual(lhs_it->second.resources, p.second.resources); |
| 209 } | 323 } |
| 210 } | 324 } |
| 211 | 325 |
| 212 void ResourcePrefetchPredictorTablesTest::TestResourcesAreEqual( | 326 void ResourcePrefetchPredictorTablesTest::TestResourcesAreEqual( |
| 213 const std::vector<ResourceData>& lhs, | 327 const std::vector<ResourceData>& lhs, |
| 214 const std::vector<ResourceData>& rhs) const { | 328 const std::vector<ResourceData>& rhs) const { |
| 215 EXPECT_EQ(lhs.size(), rhs.size()); | 329 EXPECT_EQ(lhs.size(), rhs.size()); |
| 216 | 330 |
| 217 std::set<std::string> resources_seen; | 331 std::set<std::string> resources_seen; |
| 218 for (const auto& rhs_resource : rhs) { | 332 for (const auto& rhs_resource : rhs) { |
| 219 const std::string& resource = rhs_resource.resource_url(); | 333 const std::string& resource = rhs_resource.resource_url(); |
| 220 EXPECT_FALSE(base::ContainsKey(resources_seen, resource)); | 334 EXPECT_FALSE(base::ContainsKey(resources_seen, resource)); |
| 221 | 335 |
| 222 for (const auto& lhs_resource : lhs) { | 336 for (const auto& lhs_resource : lhs) { |
| 223 if (lhs_resource == rhs_resource) { | 337 if (lhs_resource == rhs_resource) { |
| 224 resources_seen.insert(resource); | 338 resources_seen.insert(resource); |
| 225 break; | 339 break; |
| 226 } | 340 } |
| 227 } | 341 } |
| 228 EXPECT_TRUE(base::ContainsKey(resources_seen, resource)); | 342 EXPECT_TRUE(base::ContainsKey(resources_seen, resource)); |
| 229 } | 343 } |
| 230 EXPECT_EQ(lhs.size(), resources_seen.size()); | 344 EXPECT_EQ(lhs.size(), resources_seen.size()); |
| 231 } | 345 } |
| 232 | 346 |
| 347 void ResourcePrefetchPredictorTablesTest::TestRedirectDataAreEqual( |
| 348 const RedirectDataMap& lhs, |
| 349 const RedirectDataMap& rhs) const { |
| 350 EXPECT_EQ(lhs.size(), rhs.size()); |
| 351 |
| 352 for (const auto& p : rhs) { |
| 353 const auto lhs_it = lhs.find(p.first); |
| 354 ASSERT_TRUE(lhs_it != lhs.end()) << p.first; |
| 355 EXPECT_EQ(lhs_it->second.primary_key(), p.second.primary_key()); |
| 356 EXPECT_EQ(lhs_it->second.last_visit_time(), p.second.last_visit_time()); |
| 357 |
| 358 std::vector<RedirectStat> lhs_redirects( |
| 359 lhs_it->second.redirect_endpoints().begin(), |
| 360 lhs_it->second.redirect_endpoints().end()); |
| 361 std::vector<RedirectStat> rhs_redirects( |
| 362 p.second.redirect_endpoints().begin(), |
| 363 p.second.redirect_endpoints().end()); |
| 364 |
| 365 TestRedirectsAreEqual(lhs_redirects, rhs_redirects); |
| 366 } |
| 367 } |
| 368 |
| 369 void ResourcePrefetchPredictorTablesTest::TestRedirectsAreEqual( |
| 370 const std::vector<RedirectStat>& lhs, |
| 371 const std::vector<RedirectStat>& rhs) const { |
| 372 EXPECT_EQ(lhs.size(), rhs.size()); |
| 373 |
| 374 std::map<std::string, RedirectStat> lhs_index; |
| 375 // Repeated redirects are not allowed. |
| 376 for (const auto& r : lhs) |
| 377 EXPECT_TRUE(lhs_index.insert(std::make_pair(r.url(), r)).second); |
| 378 |
| 379 for (const auto& r : rhs) { |
| 380 auto lhs_it = lhs_index.find(r.url()); |
| 381 if (lhs_it != lhs_index.end()) { |
| 382 EXPECT_EQ(r, lhs_it->second); |
| 383 lhs_index.erase(lhs_it); |
| 384 } else { |
| 385 ADD_FAILURE() << r.url(); |
| 386 } |
| 387 } |
| 388 |
| 389 EXPECT_TRUE(lhs_index.empty()); |
| 390 } |
| 391 |
| 233 void ResourcePrefetchPredictorTablesTest::AddKey(PrefetchDataMap* m, | 392 void ResourcePrefetchPredictorTablesTest::AddKey(PrefetchDataMap* m, |
| 234 const std::string& key) const { | 393 const std::string& key) const { |
| 235 PrefetchDataMap::const_iterator it = test_url_data_.find(key); | 394 PrefetchDataMap::const_iterator it = test_url_data_.find(key); |
| 236 if (it != test_url_data_.end()) { | 395 if (it != test_url_data_.end()) { |
| 237 m->insert(std::make_pair(it->first, it->second)); | 396 m->insert(*it); |
| 238 return; | 397 return; |
| 239 } | 398 } |
| 240 it = test_host_data_.find(key); | 399 it = test_host_data_.find(key); |
| 241 ASSERT_TRUE(it != test_host_data_.end()); | 400 ASSERT_TRUE(it != test_host_data_.end()); |
| 242 m->insert(std::make_pair(it->first, it->second)); | 401 m->insert(*it); |
| 402 } |
| 403 |
| 404 void ResourcePrefetchPredictorTablesTest::AddKey(RedirectDataMap* m, |
| 405 const std::string& key) const { |
| 406 auto it = test_url_redirect_data_.find(key); |
| 407 if (it != test_url_redirect_data_.end()) { |
| 408 m->insert(*it); |
| 409 return; |
| 410 } |
| 411 it = test_host_redirect_data_.find(key); |
| 412 ASSERT_TRUE(it != test_host_redirect_data_.end()); |
| 413 m->insert(*it); |
| 243 } | 414 } |
| 244 | 415 |
| 245 void ResourcePrefetchPredictorTablesTest::InitializeSampleData() { | 416 void ResourcePrefetchPredictorTablesTest::InitializeSampleData() { |
| 417 PrefetchData empty_url_data(PREFETCH_KEY_TYPE_URL, std::string()); |
| 418 PrefetchData empty_host_data(PREFETCH_KEY_TYPE_HOST, std::string()); |
| 419 RedirectData empty_url_redirect_data; |
| 420 RedirectData empty_host_redirect_data; |
| 421 |
| 246 { // Url data. | 422 { // Url data. |
| 247 PrefetchData google(PREFETCH_KEY_TYPE_URL, "http://www.google.com"); | 423 PrefetchData google(PREFETCH_KEY_TYPE_URL, "http://www.google.com"); |
| 248 google.last_visit = base::Time::FromInternalValue(1); | 424 google.last_visit = base::Time::FromInternalValue(1); |
| 249 google.resources.push_back(CreateResourceData( | 425 google.resources.push_back(CreateResourceData( |
| 250 "http://www.google.com/style.css", content::RESOURCE_TYPE_STYLESHEET, 5, | 426 "http://www.google.com/style.css", content::RESOURCE_TYPE_STYLESHEET, 5, |
| 251 2, 1, 1.1, net::MEDIUM, false, false)); | 427 2, 1, 1.1, net::MEDIUM, false, false)); |
| 252 google.resources.push_back(CreateResourceData( | 428 google.resources.push_back(CreateResourceData( |
| 253 "http://www.google.com/script.js", content::RESOURCE_TYPE_SCRIPT, 4, 0, | 429 "http://www.google.com/script.js", content::RESOURCE_TYPE_SCRIPT, 4, 0, |
| 254 1, 2.1, net::MEDIUM, false, false)); | 430 1, 2.1, net::MEDIUM, false, false)); |
| 255 google.resources.push_back(CreateResourceData( | 431 google.resources.push_back(CreateResourceData( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 276 yahoo.last_visit = base::Time::FromInternalValue(3); | 452 yahoo.last_visit = base::Time::FromInternalValue(3); |
| 277 yahoo.resources.push_back(CreateResourceData( | 453 yahoo.resources.push_back(CreateResourceData( |
| 278 "http://www.google.com/image.png", content::RESOURCE_TYPE_IMAGE, 20, 1, | 454 "http://www.google.com/image.png", content::RESOURCE_TYPE_IMAGE, 20, 1, |
| 279 0, 10.0, net::MEDIUM, false, false)); | 455 0, 10.0, net::MEDIUM, false, false)); |
| 280 | 456 |
| 281 test_url_data_.clear(); | 457 test_url_data_.clear(); |
| 282 test_url_data_.insert(std::make_pair("http://www.google.com", google)); | 458 test_url_data_.insert(std::make_pair("http://www.google.com", google)); |
| 283 test_url_data_.insert(std::make_pair("http://www.reddit.com", reddit)); | 459 test_url_data_.insert(std::make_pair("http://www.reddit.com", reddit)); |
| 284 test_url_data_.insert(std::make_pair("http://www.yahoo.com", yahoo)); | 460 test_url_data_.insert(std::make_pair("http://www.yahoo.com", yahoo)); |
| 285 | 461 |
| 286 PrefetchData empty_host_data(PREFETCH_KEY_TYPE_HOST, std::string()); | 462 tables_->UpdateData(google, empty_host_data, empty_url_redirect_data, |
| 287 tables_->UpdateData(google, empty_host_data); | 463 empty_host_redirect_data); |
| 288 tables_->UpdateData(reddit, empty_host_data); | 464 tables_->UpdateData(reddit, empty_host_data, empty_url_redirect_data, |
| 289 tables_->UpdateData(yahoo, empty_host_data); | 465 empty_host_redirect_data); |
| 466 tables_->UpdateData(yahoo, empty_host_data, empty_url_redirect_data, |
| 467 empty_host_redirect_data); |
| 290 } | 468 } |
| 291 | 469 |
| 292 { // Host data. | 470 { // Host data. |
| 293 PrefetchData facebook(PREFETCH_KEY_TYPE_HOST, "www.facebook.com"); | 471 PrefetchData facebook(PREFETCH_KEY_TYPE_HOST, "www.facebook.com"); |
| 294 facebook.last_visit = base::Time::FromInternalValue(4); | 472 facebook.last_visit = base::Time::FromInternalValue(4); |
| 295 facebook.resources.push_back(CreateResourceData( | 473 facebook.resources.push_back(CreateResourceData( |
| 296 "http://www.facebook.com/style.css", content::RESOURCE_TYPE_STYLESHEET, | 474 "http://www.facebook.com/style.css", content::RESOURCE_TYPE_STYLESHEET, |
| 297 5, 2, 1, 1.1, net::MEDIUM, false, false)); | 475 5, 2, 1, 1.1, net::MEDIUM, false, false)); |
| 298 facebook.resources.push_back(CreateResourceData( | 476 facebook.resources.push_back(CreateResourceData( |
| 299 "http://www.facebook.com/script.js", content::RESOURCE_TYPE_SCRIPT, 4, | 477 "http://www.facebook.com/script.js", content::RESOURCE_TYPE_SCRIPT, 4, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 312 PrefetchData yahoo(PREFETCH_KEY_TYPE_HOST, "www.yahoo.com"); | 490 PrefetchData yahoo(PREFETCH_KEY_TYPE_HOST, "www.yahoo.com"); |
| 313 yahoo.last_visit = base::Time::FromInternalValue(5); | 491 yahoo.last_visit = base::Time::FromInternalValue(5); |
| 314 yahoo.resources.push_back(CreateResourceData( | 492 yahoo.resources.push_back(CreateResourceData( |
| 315 "http://www.google.com/image.png", content::RESOURCE_TYPE_IMAGE, 20, 1, | 493 "http://www.google.com/image.png", content::RESOURCE_TYPE_IMAGE, 20, 1, |
| 316 0, 10.0, net::MEDIUM, false, false)); | 494 0, 10.0, net::MEDIUM, false, false)); |
| 317 | 495 |
| 318 test_host_data_.clear(); | 496 test_host_data_.clear(); |
| 319 test_host_data_.insert(std::make_pair("www.facebook.com", facebook)); | 497 test_host_data_.insert(std::make_pair("www.facebook.com", facebook)); |
| 320 test_host_data_.insert(std::make_pair("www.yahoo.com", yahoo)); | 498 test_host_data_.insert(std::make_pair("www.yahoo.com", yahoo)); |
| 321 | 499 |
| 322 PrefetchData empty_url_data(PREFETCH_KEY_TYPE_URL, std::string()); | 500 tables_->UpdateData(empty_url_data, facebook, empty_url_redirect_data, |
| 323 tables_->UpdateData(empty_url_data, facebook); | 501 empty_host_redirect_data); |
| 324 tables_->UpdateData(empty_url_data, yahoo); | 502 tables_->UpdateData(empty_url_data, yahoo, empty_url_redirect_data, |
| 503 empty_host_redirect_data); |
| 504 } |
| 505 |
| 506 { // Url redirect data. |
| 507 RedirectData facebook; |
| 508 facebook.set_primary_key("http://fb.com/google"); |
| 509 facebook.set_last_visit_time(6); |
| 510 InitializeRedirectStat(facebook.add_redirect_endpoints(), |
| 511 "https://facebook.com/google", 5, 1, 0); |
| 512 InitializeRedirectStat(facebook.add_redirect_endpoints(), |
| 513 "https://facebook.com/login", 3, 5, 1); |
| 514 |
| 515 RedirectData nytimes; |
| 516 nytimes.set_primary_key("http://nyt.com"); |
| 517 nytimes.set_last_visit_time(7); |
| 518 InitializeRedirectStat(nytimes.add_redirect_endpoints(), |
| 519 "https://nytimes.com", 2, 0, 0); |
| 520 |
| 521 RedirectData google; |
| 522 google.set_primary_key("http://google.com"); |
| 523 google.set_last_visit_time(8); |
| 524 InitializeRedirectStat(google.add_redirect_endpoints(), |
| 525 "https://google.com", 3, 0, 0); |
| 526 |
| 527 test_url_redirect_data_.clear(); |
| 528 test_url_redirect_data_.insert( |
| 529 std::make_pair(facebook.primary_key(), facebook)); |
| 530 test_url_redirect_data_.insert( |
| 531 std::make_pair(nytimes.primary_key(), nytimes)); |
| 532 test_url_redirect_data_.insert( |
| 533 std::make_pair(google.primary_key(), google)); |
| 534 |
| 535 tables_->UpdateData(empty_url_data, empty_host_data, facebook, |
| 536 empty_host_redirect_data); |
| 537 tables_->UpdateData(empty_url_data, empty_host_data, nytimes, |
| 538 empty_host_redirect_data); |
| 539 tables_->UpdateData(empty_url_data, empty_host_data, google, |
| 540 empty_host_redirect_data); |
| 541 } |
| 542 |
| 543 { // Host redirect data. |
| 544 RedirectData bbc; |
| 545 bbc.set_primary_key("bbc.com"); |
| 546 bbc.set_last_visit_time(9); |
| 547 InitializeRedirectStat(bbc.add_redirect_endpoints(), "www.bbc.com", 8, 4, |
| 548 1); |
| 549 InitializeRedirectStat(bbc.add_redirect_endpoints(), "m.bbc.com", 5, 8, 0); |
| 550 InitializeRedirectStat(bbc.add_redirect_endpoints(), "bbc.co.uk", 1, 3, 0); |
| 551 |
| 552 RedirectData microsoft; |
| 553 microsoft.set_primary_key("microsoft.com"); |
| 554 microsoft.set_last_visit_time(10); |
| 555 InitializeRedirectStat(microsoft.add_redirect_endpoints(), |
| 556 "www.microsoft.com", 10, 0, 0); |
| 557 |
| 558 test_host_redirect_data_.clear(); |
| 559 test_host_redirect_data_.insert(std::make_pair(bbc.primary_key(), bbc)); |
| 560 test_host_redirect_data_.insert( |
| 561 std::make_pair(microsoft.primary_key(), microsoft)); |
| 562 tables_->UpdateData(empty_url_data, empty_host_data, |
| 563 empty_url_redirect_data, bbc); |
| 564 tables_->UpdateData(empty_url_data, empty_host_data, |
| 565 empty_url_redirect_data, microsoft); |
| 325 } | 566 } |
| 326 } | 567 } |
| 327 | 568 |
| 328 void ResourcePrefetchPredictorTablesTest::ReopenDatabase() { | 569 void ResourcePrefetchPredictorTablesTest::ReopenDatabase() { |
| 329 db_.reset(new PredictorDatabase(&profile_)); | 570 db_.reset(new PredictorDatabase(&profile_)); |
| 330 base::RunLoop().RunUntilIdle(); | 571 base::RunLoop().RunUntilIdle(); |
| 331 tables_ = db_->resource_prefetch_tables(); | 572 tables_ = db_->resource_prefetch_tables(); |
| 332 } | 573 } |
| 333 | 574 |
| 334 // Test cases. | 575 // Test cases. |
| 335 | 576 |
| 336 TEST_F(ResourcePrefetchPredictorTablesTest, ComputeScore) { | 577 TEST_F(ResourcePrefetchPredictorTablesTest, ComputeResourceScore) { |
| 337 ResourceData js_resource = CreateResourceData( | 578 ResourceData js_resource = CreateResourceData( |
| 338 "http://www.resources.google.com/script.js", | 579 "http://www.resources.google.com/script.js", |
| 339 content::RESOURCE_TYPE_SCRIPT, 11, 0, 0, 1., net::MEDIUM, false, false); | 580 content::RESOURCE_TYPE_SCRIPT, 11, 0, 0, 1., net::MEDIUM, false, false); |
| 340 ResourceData image_resource = CreateResourceData( | 581 ResourceData image_resource = CreateResourceData( |
| 341 "http://www.resources.google.com/image.jpg", content::RESOURCE_TYPE_IMAGE, | 582 "http://www.resources.google.com/image.jpg", content::RESOURCE_TYPE_IMAGE, |
| 342 11, 0, 0, 1., net::MEDIUM, false, false); | 583 11, 0, 0, 1., net::MEDIUM, false, false); |
| 343 ResourceData css_resource = | 584 ResourceData css_resource = |
| 344 CreateResourceData("http://www.resources.google.com/stylesheet.css", | 585 CreateResourceData("http://www.resources.google.com/stylesheet.css", |
| 345 content::RESOURCE_TYPE_STYLESHEET, 11, 0, 0, 1., | 586 content::RESOURCE_TYPE_STYLESHEET, 11, 0, 0, 1., |
| 346 net::MEDIUM, false, false); | 587 net::MEDIUM, false, false); |
| 347 ResourceData font_resource = | 588 ResourceData font_resource = |
| 348 CreateResourceData("http://www.resources.google.com/font.woff", | 589 CreateResourceData("http://www.resources.google.com/font.woff", |
| 349 content::RESOURCE_TYPE_FONT_RESOURCE, 11, 0, 0, 1., | 590 content::RESOURCE_TYPE_FONT_RESOURCE, 11, 0, 0, 1., |
| 350 net::MEDIUM, false, false); | 591 net::MEDIUM, false, false); |
| 351 float js_resource_score = | 592 float js_resource_score = |
| 352 ResourcePrefetchPredictorTables::ComputeScore(js_resource); | 593 ResourcePrefetchPredictorTables::ComputeResourceScore(js_resource); |
| 353 float css_resource_score = | 594 float css_resource_score = |
| 354 ResourcePrefetchPredictorTables::ComputeScore(css_resource); | 595 ResourcePrefetchPredictorTables::ComputeResourceScore(css_resource); |
| 355 float font_resource_score = | 596 float font_resource_score = |
| 356 ResourcePrefetchPredictorTables::ComputeScore(font_resource); | 597 ResourcePrefetchPredictorTables::ComputeResourceScore(font_resource); |
| 357 float image_resource_score = | 598 float image_resource_score = |
| 358 ResourcePrefetchPredictorTables::ComputeScore(image_resource); | 599 ResourcePrefetchPredictorTables::ComputeResourceScore(image_resource); |
| 359 | 600 |
| 360 EXPECT_TRUE(js_resource_score == css_resource_score); | 601 EXPECT_TRUE(js_resource_score == css_resource_score); |
| 361 EXPECT_TRUE(js_resource_score == font_resource_score); | 602 EXPECT_TRUE(js_resource_score == font_resource_score); |
| 362 EXPECT_NEAR(199., js_resource_score, 1e-4); | 603 EXPECT_NEAR(199., js_resource_score, 1e-4); |
| 363 EXPECT_NEAR(99., image_resource_score, 1e-4); | 604 EXPECT_NEAR(99., image_resource_score, 1e-4); |
| 364 } | 605 } |
| 365 | 606 |
| 366 TEST_F(ResourcePrefetchPredictorTablesTest, GetAllData) { | 607 TEST_F(ResourcePrefetchPredictorTablesTest, GetAllData) { |
| 367 TestGetAllData(); | 608 TestGetAllData(); |
| 368 } | 609 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 396 ResourcePrefetchPredictorTables::SetDatabaseVersion(db, version + 1)); | 637 ResourcePrefetchPredictorTables::SetDatabaseVersion(db, version + 1)); |
| 397 EXPECT_EQ(version + 1, | 638 EXPECT_EQ(version + 1, |
| 398 ResourcePrefetchPredictorTables::GetDatabaseVersion(db)); | 639 ResourcePrefetchPredictorTables::GetDatabaseVersion(db)); |
| 399 | 640 |
| 400 ReopenDatabase(); | 641 ReopenDatabase(); |
| 401 | 642 |
| 402 db = tables_->DB(); | 643 db = tables_->DB(); |
| 403 ASSERT_EQ(version, ResourcePrefetchPredictorTables::GetDatabaseVersion(db)); | 644 ASSERT_EQ(version, ResourcePrefetchPredictorTables::GetDatabaseVersion(db)); |
| 404 | 645 |
| 405 PrefetchDataMap url_data, host_data; | 646 PrefetchDataMap url_data, host_data; |
| 406 tables_->GetAllData(&url_data, &host_data); | 647 RedirectDataMap url_redirect_data, host_redirect_data; |
| 648 tables_->GetAllData(&url_data, &host_data, &url_redirect_data, |
| 649 &host_redirect_data); |
| 407 EXPECT_TRUE(url_data.empty()); | 650 EXPECT_TRUE(url_data.empty()); |
| 408 EXPECT_TRUE(host_data.empty()); | 651 EXPECT_TRUE(host_data.empty()); |
| 409 } | 652 } |
| 410 | 653 |
| 411 TEST_F(ResourcePrefetchPredictorTablesReopenTest, GetAllData) { | 654 TEST_F(ResourcePrefetchPredictorTablesReopenTest, GetAllData) { |
| 412 TestGetAllData(); | 655 TestGetAllData(); |
| 413 } | 656 } |
| 414 | 657 |
| 415 TEST_F(ResourcePrefetchPredictorTablesReopenTest, UpdateData) { | 658 TEST_F(ResourcePrefetchPredictorTablesReopenTest, UpdateData) { |
| 416 TestUpdateData(); | 659 TestUpdateData(); |
| 417 } | 660 } |
| 418 | 661 |
| 419 TEST_F(ResourcePrefetchPredictorTablesReopenTest, DeleteData) { | 662 TEST_F(ResourcePrefetchPredictorTablesReopenTest, DeleteData) { |
| 420 TestDeleteData(); | 663 TestDeleteData(); |
| 421 } | 664 } |
| 422 | 665 |
| 423 TEST_F(ResourcePrefetchPredictorTablesReopenTest, DeleteSingleDataPoint) { | 666 TEST_F(ResourcePrefetchPredictorTablesReopenTest, DeleteSingleDataPoint) { |
| 424 TestDeleteSingleDataPoint(); | 667 TestDeleteSingleDataPoint(); |
| 425 } | 668 } |
| 426 | 669 |
| 427 TEST_F(ResourcePrefetchPredictorTablesReopenTest, DeleteAllData) { | 670 TEST_F(ResourcePrefetchPredictorTablesReopenTest, DeleteAllData) { |
| 428 TestDeleteAllData(); | 671 TestDeleteAllData(); |
| 429 } | 672 } |
| 430 | 673 |
| 431 } // namespace predictors | 674 } // namespace predictors |
| OLD | NEW |