| 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 } |
| 146 | 149 |
| 147 // Fill up the database with test URL. | 150 // Fill up the database with test URL. |
| 148 void AddUrl(const GURL& url, | 151 void AddUrl(const GURL& url, |
| 149 const std::string& list_name, | 152 const std::string& list_name, |
| 150 const std::vector<SBPrefix>& prefix_hits, | 153 const std::vector<SBPrefix>& prefix_hits, |
| 151 const std::vector<SBFullHashResult>& full_hits) { | 154 const std::vector<SBFullHashResult>& full_hits) { |
| 152 badurls_[url.spec()].list_name = list_name; | 155 badurls_[url.spec()].list_name = list_name; |
| 153 badurls_[url.spec()].prefix_hits = prefix_hits; | 156 badurls_[url.spec()].prefix_hits = prefix_hits; |
| 154 badurls_[url.spec()].full_hits = full_hits; | 157 badurls_[url.spec()].full_hits = full_hits; |
| 155 } | 158 } |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 TestSBUpdateCookies) { | 988 TestSBUpdateCookies) { |
| 986 content::WindowedNotificationObserver observer( | 989 content::WindowedNotificationObserver observer( |
| 987 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, | 990 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, |
| 988 content::Source<SafeBrowsingDatabaseManager>( | 991 content::Source<SafeBrowsingDatabaseManager>( |
| 989 sb_service_->database_manager())); | 992 sb_service_->database_manager())); |
| 990 BrowserThread::PostTask( | 993 BrowserThread::PostTask( |
| 991 BrowserThread::IO, FROM_HERE, | 994 BrowserThread::IO, FROM_HERE, |
| 992 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); | 995 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); |
| 993 observer.Wait(); | 996 observer.Wait(); |
| 994 } | 997 } |
| OLD | NEW |