| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 const std::vector<SBChunkDelete>& chunk_deletes) OVERRIDE { | 136 const std::vector<SBChunkDelete>& chunk_deletes) OVERRIDE { |
| 137 ADD_FAILURE() << "Not implemented."; | 137 ADD_FAILURE() << "Not implemented."; |
| 138 } | 138 } |
| 139 virtual void UpdateFinished(bool update_succeeded) OVERRIDE { | 139 virtual void UpdateFinished(bool update_succeeded) OVERRIDE { |
| 140 ADD_FAILURE() << "Not implemented."; | 140 ADD_FAILURE() << "Not implemented."; |
| 141 } | 141 } |
| 142 virtual void CacheHashResults(const std::vector<SBPrefix>& prefixes, | 142 virtual void CacheHashResults(const std::vector<SBPrefix>& prefixes, |
| 143 const std::vector<SBFullHashResult>& full_hits) OVERRIDE { | 143 const std::vector<SBFullHashResult>& full_hits) OVERRIDE { |
| 144 // Do nothing for the cache. | 144 // Do nothing for the cache. |
| 145 } | 145 } |
| 146 virtual bool MalwareIPMatchKillSwitchOn() OVERRIDE { | |
| 147 return false; | |
| 148 } | |
| 149 | 146 |
| 150 // Fill up the database with test URL. | 147 // Fill up the database with test URL. |
| 151 void AddUrl(const GURL& url, | 148 void AddUrl(const GURL& url, |
| 152 const std::string& list_name, | 149 const std::string& list_name, |
| 153 const std::vector<SBPrefix>& prefix_hits, | 150 const std::vector<SBPrefix>& prefix_hits, |
| 154 const std::vector<SBFullHashResult>& full_hits) { | 151 const std::vector<SBFullHashResult>& full_hits) { |
| 155 badurls_[url.spec()].list_name = list_name; | 152 badurls_[url.spec()].list_name = list_name; |
| 156 badurls_[url.spec()].prefix_hits = prefix_hits; | 153 badurls_[url.spec()].prefix_hits = prefix_hits; |
| 157 badurls_[url.spec()].full_hits = full_hits; | 154 badurls_[url.spec()].full_hits = full_hits; |
| 158 } | 155 } |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 content::WindowedNotificationObserver observer( | 986 content::WindowedNotificationObserver observer( |
| 990 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, | 987 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, |
| 991 content::Source<SafeBrowsingDatabaseManager>( | 988 content::Source<SafeBrowsingDatabaseManager>( |
| 992 sb_service_->database_manager().get())); | 989 sb_service_->database_manager().get())); |
| 993 BrowserThread::PostTask( | 990 BrowserThread::PostTask( |
| 994 BrowserThread::IO, | 991 BrowserThread::IO, |
| 995 FROM_HERE, | 992 FROM_HERE, |
| 996 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); | 993 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); |
| 997 observer.Wait(); | 994 observer.Wait(); |
| 998 } | 995 } |
| OLD | NEW |