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 // 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 "chrome/browser/safe_browsing/safe_browsing_service.h" | 9 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
10 | 10 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 return true; | 246 return true; |
247 } | 247 } |
248 bool ContainsCsdWhitelistedUrl(const GURL& url) override { return true; } | 248 bool ContainsCsdWhitelistedUrl(const GURL& url) override { return true; } |
249 bool ContainsDownloadWhitelistedString(const std::string& str) override { | 249 bool ContainsDownloadWhitelistedString(const std::string& str) override { |
250 return true; | 250 return true; |
251 } | 251 } |
252 bool ContainsDownloadWhitelistedUrl(const GURL& url) override { return true; } | 252 bool ContainsDownloadWhitelistedUrl(const GURL& url) override { return true; } |
253 bool ContainsInclusionWhitelistedUrl(const GURL& url) override { | 253 bool ContainsInclusionWhitelistedUrl(const GURL& url) override { |
254 return true; | 254 return true; |
255 } | 255 } |
| 256 bool ContainsModuleWhitelistedString(const std::string& str) override { |
| 257 return true; |
| 258 } |
256 bool ContainsExtensionPrefixes(const std::vector<SBPrefix>& prefixes, | 259 bool ContainsExtensionPrefixes(const std::vector<SBPrefix>& prefixes, |
257 std::vector<SBPrefix>* prefix_hits) override { | 260 std::vector<SBPrefix>* prefix_hits) override { |
258 return false; | 261 return false; |
259 } | 262 } |
260 bool ContainsMalwareIP(const std::string& ip_address) override { | 263 bool ContainsMalwareIP(const std::string& ip_address) override { |
261 return true; | 264 return true; |
262 } | 265 } |
263 bool UpdateStarted(std::vector<SBListChunkRanges>* lists) override { | 266 bool UpdateStarted(std::vector<SBListChunkRanges>* lists) override { |
264 ADD_FAILURE() << "Not implemented."; | 267 ADD_FAILURE() << "Not implemented."; |
265 return false; | 268 return false; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 TestSafeBrowsingDatabaseFactory() : db_(NULL) {} | 373 TestSafeBrowsingDatabaseFactory() : db_(NULL) {} |
371 ~TestSafeBrowsingDatabaseFactory() override {} | 374 ~TestSafeBrowsingDatabaseFactory() override {} |
372 | 375 |
373 SafeBrowsingDatabase* CreateSafeBrowsingDatabase( | 376 SafeBrowsingDatabase* CreateSafeBrowsingDatabase( |
374 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, | 377 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, |
375 bool enable_download_protection, | 378 bool enable_download_protection, |
376 bool enable_client_side_whitelist, | 379 bool enable_client_side_whitelist, |
377 bool enable_download_whitelist, | 380 bool enable_download_whitelist, |
378 bool enable_extension_blacklist, | 381 bool enable_extension_blacklist, |
379 bool enable_ip_blacklist, | 382 bool enable_ip_blacklist, |
380 bool enabled_unwanted_software_list) override { | 383 bool enabled_unwanted_software_list, |
| 384 bool enable_module_whitelist) override { |
381 db_ = new TestSafeBrowsingDatabase(); | 385 db_ = new TestSafeBrowsingDatabase(); |
382 return db_; | 386 return db_; |
383 } | 387 } |
384 TestSafeBrowsingDatabase* GetDb() { return db_; } | 388 TestSafeBrowsingDatabase* GetDb() { return db_; } |
385 | 389 |
386 private: | 390 private: |
387 // Owned by the SafebrowsingService. | 391 // Owned by the SafebrowsingService. |
388 TestSafeBrowsingDatabase* db_; | 392 TestSafeBrowsingDatabase* db_; |
389 }; | 393 }; |
390 | 394 |
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1667 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, | 1671 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, |
1668 content::Source<SafeBrowsingDatabaseManager>( | 1672 content::Source<SafeBrowsingDatabaseManager>( |
1669 sb_service_->database_manager().get())); | 1673 sb_service_->database_manager().get())); |
1670 BrowserThread::PostTask( | 1674 BrowserThread::PostTask( |
1671 BrowserThread::IO, FROM_HERE, | 1675 BrowserThread::IO, FROM_HERE, |
1672 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); | 1676 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); |
1673 observer.Wait(); | 1677 observer.Wait(); |
1674 } | 1678 } |
1675 | 1679 |
1676 } // namespace safe_browsing | 1680 } // namespace safe_browsing |
OLD | NEW |