Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc

Issue 2230203002: chrome: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed accidental components/ change Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <set> 5 #include <set>
6 #include <utility> 6 #include <utility>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 void ResourcePrefetchPredictorTablesTest::TestResourceRowsAreEqual( 232 void ResourcePrefetchPredictorTablesTest::TestResourceRowsAreEqual(
233 const ResourceRows& lhs, 233 const ResourceRows& lhs,
234 const ResourceRows& rhs) const { 234 const ResourceRows& rhs) const {
235 EXPECT_EQ(lhs.size(), rhs.size()); 235 EXPECT_EQ(lhs.size(), rhs.size());
236 236
237 std::set<GURL> resources_seen; 237 std::set<GURL> resources_seen;
238 for (ResourceRows::const_iterator rhs_it = rhs.begin(); 238 for (ResourceRows::const_iterator rhs_it = rhs.begin();
239 rhs_it != rhs.end(); ++rhs_it) { 239 rhs_it != rhs.end(); ++rhs_it) {
240 const GURL& resource = rhs_it->resource_url; 240 const GURL& resource = rhs_it->resource_url;
241 EXPECT_FALSE(ContainsKey(resources_seen, resource)); 241 EXPECT_FALSE(base::ContainsKey(resources_seen, resource));
242 242
243 for (ResourceRows::const_iterator lhs_it = lhs.begin(); 243 for (ResourceRows::const_iterator lhs_it = lhs.begin();
244 lhs_it != lhs.end(); ++lhs_it) { 244 lhs_it != lhs.end(); ++lhs_it) {
245 if (*rhs_it == *lhs_it) { 245 if (*rhs_it == *lhs_it) {
246 resources_seen.insert(resource); 246 resources_seen.insert(resource);
247 break; 247 break;
248 } 248 }
249 } 249 }
250 EXPECT_TRUE(ContainsKey(resources_seen, resource)); 250 EXPECT_TRUE(base::ContainsKey(resources_seen, resource));
251 } 251 }
252 EXPECT_EQ(lhs.size(), resources_seen.size()); 252 EXPECT_EQ(lhs.size(), resources_seen.size());
253 } 253 }
254 254
255 void ResourcePrefetchPredictorTablesTest::AddKey(PrefetchDataMap* m, 255 void ResourcePrefetchPredictorTablesTest::AddKey(PrefetchDataMap* m,
256 const std::string& key) const { 256 const std::string& key) const {
257 PrefetchDataMap::const_iterator it = test_url_data_.find(key); 257 PrefetchDataMap::const_iterator it = test_url_data_.find(key);
258 if (it != test_url_data_.end()) { 258 if (it != test_url_data_.end()) {
259 m->insert(std::make_pair(it->first, it->second)); 259 m->insert(std::make_pair(it->first, it->second));
260 return; 260 return;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 401
402 TEST_F(ResourcePrefetchPredictorTablesReopenTest, DeleteSingleDataPoint) { 402 TEST_F(ResourcePrefetchPredictorTablesReopenTest, DeleteSingleDataPoint) {
403 TestDeleteSingleDataPoint(); 403 TestDeleteSingleDataPoint();
404 } 404 }
405 405
406 TEST_F(ResourcePrefetchPredictorTablesReopenTest, DeleteAllData) { 406 TEST_F(ResourcePrefetchPredictorTablesReopenTest, DeleteAllData) {
407 TestDeleteAllData(); 407 TestDeleteAllData();
408 } 408 }
409 409
410 } // namespace predictors 410 } // namespace predictors
OLDNEW
« no previous file with comments | « chrome/browser/predictors/autocomplete_action_predictor.cc ('k') | chrome/browser/predictors/resource_prefetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698