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

Side by Side Diff: components/precache/content/precache_manager_unittest.cc

Issue 666133002: Standardize usage of virtual/override/final in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/precache/content/precache_manager.h" 5 #include "components/precache/content/precache_manager.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 std::multiset<GURL> requested_urls_; 82 std::multiset<GURL> requested_urls_;
83 }; 83 };
84 84
85 class FakeURLListProvider : public URLListProvider { 85 class FakeURLListProvider : public URLListProvider {
86 public: 86 public:
87 FakeURLListProvider(const std::list<GURL>& urls, bool run_immediately) 87 FakeURLListProvider(const std::list<GURL>& urls, bool run_immediately)
88 : urls_(urls), 88 : urls_(urls),
89 run_immediately_(run_immediately), 89 run_immediately_(run_immediately),
90 was_get_urls_called_(false) {} 90 was_get_urls_called_(false) {}
91 91
92 virtual void GetURLs(const GetURLsCallback& callback) override { 92 void GetURLs(const GetURLsCallback& callback) override {
93 was_get_urls_called_ = true; 93 was_get_urls_called_ = true;
94 94
95 if (run_immediately_) { 95 if (run_immediately_) {
96 callback.Run(urls_); 96 callback.Run(urls_);
97 } else { 97 } else {
98 // Post the callback to be run later in the message loop. 98 // Post the callback to be run later in the message loop.
99 base::MessageLoop::current()->PostTask(FROM_HERE, 99 base::MessageLoop::current()->PostTask(FROM_HERE,
100 base::Bind(callback, urls_)); 100 base::Bind(callback, urls_));
101 } 101 }
102 } 102 }
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 kCurrentTime, 1000, true); 349 kCurrentTime, 1000, true);
350 expected_histogram_count_map["Precache.Saved"] += 2; 350 expected_histogram_count_map["Precache.Saved"] += 2;
351 351
352 base::MessageLoop::current()->RunUntilIdle(); 352 base::MessageLoop::current()->RunUntilIdle();
353 EXPECT_EQ(expected_histogram_count_map, GetHistogramCountMap()); 353 EXPECT_EQ(expected_histogram_count_map, GetHistogramCountMap());
354 } 354 }
355 355
356 } // namespace 356 } // namespace
357 357
358 } // namespace precache 358 } // namespace precache
OLDNEW
« no previous file with comments | « components/precache/content/precache_manager_factory.h ('k') | components/precache/core/precache_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698