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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc

Issue 1073633002: Remove PrerenderLocalPredictor, part 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prerender-local-predictor-1
Patch Set: rebase Created 5 years, 8 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 (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 // This test creates a safebrowsing service using test safebrowsing database 5 // This test creates a safebrowsing service using test safebrowsing database
6 // and a test protocol manager. It is used to test logics in safebrowsing 6 // and a test protocol manager. It is used to test logics in safebrowsing
7 // service. 7 // service.
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 return true; 161 return true;
162 } 162 }
163 bool ContainsDownloadWhitelistedUrl(const GURL& url) override { return true; } 163 bool ContainsDownloadWhitelistedUrl(const GURL& url) override { return true; }
164 bool ContainsInclusionWhitelistedUrl(const GURL& url) override { 164 bool ContainsInclusionWhitelistedUrl(const GURL& url) override {
165 return true; 165 return true;
166 } 166 }
167 bool ContainsExtensionPrefixes(const std::vector<SBPrefix>& prefixes, 167 bool ContainsExtensionPrefixes(const std::vector<SBPrefix>& prefixes,
168 std::vector<SBPrefix>* prefix_hits) override { 168 std::vector<SBPrefix>* prefix_hits) override {
169 return false; 169 return false;
170 } 170 }
171 bool ContainsSideEffectFreeWhitelistUrl(const GURL& url) override {
172 return true;
173 }
174 bool ContainsMalwareIP(const std::string& ip_address) override { 171 bool ContainsMalwareIP(const std::string& ip_address) override {
175 return true; 172 return true;
176 } 173 }
177 bool UpdateStarted(std::vector<SBListChunkRanges>* lists) override { 174 bool UpdateStarted(std::vector<SBListChunkRanges>* lists) override {
178 ADD_FAILURE() << "Not implemented."; 175 ADD_FAILURE() << "Not implemented.";
179 return false; 176 return false;
180 } 177 }
181 void InsertChunks(const std::string& list_name, 178 void InsertChunks(const std::string& list_name,
182 const std::vector<SBChunkData*>& chunks) override { 179 const std::vector<SBChunkData*>& chunks) override {
183 ADD_FAILURE() << "Not implemented."; 180 ADD_FAILURE() << "Not implemented.";
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 public: 267 public:
271 TestSafeBrowsingDatabaseFactory() : db_(NULL) {} 268 TestSafeBrowsingDatabaseFactory() : db_(NULL) {}
272 ~TestSafeBrowsingDatabaseFactory() override {} 269 ~TestSafeBrowsingDatabaseFactory() override {}
273 270
274 SafeBrowsingDatabase* CreateSafeBrowsingDatabase( 271 SafeBrowsingDatabase* CreateSafeBrowsingDatabase(
275 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, 272 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
276 bool enable_download_protection, 273 bool enable_download_protection,
277 bool enable_client_side_whitelist, 274 bool enable_client_side_whitelist,
278 bool enable_download_whitelist, 275 bool enable_download_whitelist,
279 bool enable_extension_blacklist, 276 bool enable_extension_blacklist,
280 bool enable_side_effect_free_whitelist,
281 bool enable_ip_blacklist, 277 bool enable_ip_blacklist,
282 bool enabled_unwanted_software_list) override { 278 bool enabled_unwanted_software_list) override {
283 db_ = new TestSafeBrowsingDatabase(); 279 db_ = new TestSafeBrowsingDatabase();
284 return db_; 280 return db_;
285 } 281 }
286 TestSafeBrowsingDatabase* GetDb() { 282 TestSafeBrowsingDatabase* GetDb() {
287 return db_; 283 return db_;
288 } 284 }
289 private: 285 private:
290 // Owned by the SafebrowsingService. 286 // Owned by the SafebrowsingService.
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 content::WindowedNotificationObserver observer( 1261 content::WindowedNotificationObserver observer(
1266 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, 1262 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE,
1267 content::Source<SafeBrowsingDatabaseManager>( 1263 content::Source<SafeBrowsingDatabaseManager>(
1268 sb_service_->database_manager().get())); 1264 sb_service_->database_manager().get()));
1269 BrowserThread::PostTask( 1265 BrowserThread::PostTask(
1270 BrowserThread::IO, 1266 BrowserThread::IO,
1271 FROM_HERE, 1267 FROM_HERE,
1272 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); 1268 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this));
1273 observer.Wait(); 1269 observer.Wait();
1274 } 1270 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_database_unittest.cc ('k') | chrome/browser/safe_browsing/safe_browsing_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698