| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 public: | 82 public: |
| 83 explicit FakeSafeBrowsingService(const std::string& url_prefix) | 83 explicit FakeSafeBrowsingService(const std::string& url_prefix) |
| 84 : url_prefix_(url_prefix) {} | 84 : url_prefix_(url_prefix) {} |
| 85 | 85 |
| 86 SafeBrowsingProtocolConfig GetProtocolConfig() const override { | 86 SafeBrowsingProtocolConfig GetProtocolConfig() const override { |
| 87 SafeBrowsingProtocolConfig config; | 87 SafeBrowsingProtocolConfig config; |
| 88 config.url_prefix = url_prefix_; | 88 config.url_prefix = url_prefix_; |
| 89 // Makes sure the auto update is not triggered. The tests will force the | 89 // Makes sure the auto update is not triggered. The tests will force the |
| 90 // update when needed. | 90 // update when needed. |
| 91 config.disable_auto_update = true; | 91 config.disable_auto_update = true; |
| 92 #if defined(OS_ANDROID) | |
| 93 config.disable_connection_check = true; | |
| 94 #endif | |
| 95 config.client_name = "browser_tests"; | 92 config.client_name = "browser_tests"; |
| 96 return config; | 93 return config; |
| 97 } | 94 } |
| 98 | 95 |
| 99 private: | 96 private: |
| 100 ~FakeSafeBrowsingService() override {} | 97 ~FakeSafeBrowsingService() override {} |
| 101 | 98 |
| 102 std::string url_prefix_; | 99 std::string url_prefix_; |
| 103 | 100 |
| 104 DISALLOW_COPY_AND_ASSIGN(FakeSafeBrowsingService); | 101 DISALLOW_COPY_AND_ASSIGN(FakeSafeBrowsingService); |
| (...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 content::WindowedNotificationObserver observer( | 1353 content::WindowedNotificationObserver observer( |
| 1357 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, | 1354 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, |
| 1358 content::Source<SafeBrowsingDatabaseManager>( | 1355 content::Source<SafeBrowsingDatabaseManager>( |
| 1359 sb_service_->database_manager().get())); | 1356 sb_service_->database_manager().get())); |
| 1360 BrowserThread::PostTask( | 1357 BrowserThread::PostTask( |
| 1361 BrowserThread::IO, | 1358 BrowserThread::IO, |
| 1362 FROM_HERE, | 1359 FROM_HERE, |
| 1363 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); | 1360 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); |
| 1364 observer.Wait(); | 1361 observer.Wait(); |
| 1365 } | 1362 } |
| OLD | NEW |