| 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 <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |