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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // Deletes the current database and creates a new one. | 110 // Deletes the current database and creates a new one. |
111 virtual bool ResetDatabase() OVERRIDE { | 111 virtual bool ResetDatabase() OVERRIDE { |
112 badurls_.clear(); | 112 badurls_.clear(); |
113 return true; | 113 return true; |
114 } | 114 } |
115 | 115 |
116 // Called on the IO thread to check if the given URL is safe or not. If we | 116 // Called on the IO thread to check if the given URL is safe or not. If we |
117 // can synchronously determine that the URL is safe, CheckUrl returns true, | 117 // can synchronously determine that the URL is safe, CheckUrl returns true, |
118 // otherwise it returns false. | 118 // otherwise it returns false. |
119 virtual bool ContainsBrowseUrl(const GURL& url, | 119 virtual bool ContainsBrowseUrl(const GURL& url, |
120 std::string* matching_list, | |
121 std::vector<SBPrefix>* prefix_hits, | 120 std::vector<SBPrefix>* prefix_hits, |
122 std::vector<SBFullHashResult>* full_hits, | 121 std::vector<SBFullHashResult>* full_hits, |
123 base::Time last_update) OVERRIDE { | 122 base::Time last_update) OVERRIDE { |
124 std::vector<GURL> urls(1, url); | 123 std::vector<GURL> urls(1, url); |
125 return ContainsUrl(safe_browsing_util::MALWARE, | 124 return ContainsUrl(safe_browsing_util::MALWARE, |
126 safe_browsing_util::PHISH, | 125 safe_browsing_util::PHISH, |
127 urls, prefix_hits, full_hits); | 126 urls, prefix_hits, full_hits); |
128 } | 127 } |
129 virtual bool ContainsDownloadUrl( | 128 virtual bool ContainsDownloadUrl( |
130 const std::vector<GURL>& urls, | 129 const std::vector<GURL>& urls, |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 content::WindowedNotificationObserver observer( | 993 content::WindowedNotificationObserver observer( |
995 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, | 994 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, |
996 content::Source<SafeBrowsingDatabaseManager>( | 995 content::Source<SafeBrowsingDatabaseManager>( |
997 sb_service_->database_manager().get())); | 996 sb_service_->database_manager().get())); |
998 BrowserThread::PostTask( | 997 BrowserThread::PostTask( |
999 BrowserThread::IO, | 998 BrowserThread::IO, |
1000 FROM_HERE, | 999 FROM_HERE, |
1001 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); | 1000 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); |
1002 observer.Wait(); | 1001 observer.Wait(); |
1003 } | 1002 } |
OLD | NEW |