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 #include <list> | 5 #include <list> |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 9 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
10 #include "chrome/browser/safe_browsing/test_safe_browsing_service.h" | 10 #include "chrome/browser/safe_browsing/test_safe_browsing_service.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 scoped_refptr<TestSafeBrowsingUIManager> ui_manager_; | 206 scoped_refptr<TestSafeBrowsingUIManager> ui_manager_; |
207 | 207 |
208 private: | 208 private: |
209 void InitResource(SafeBrowsingUIManager::UnsafeResource* resource, | 209 void InitResource(SafeBrowsingUIManager::UnsafeResource* resource, |
210 bool is_subresource, | 210 bool is_subresource, |
211 const GURL& url) { | 211 const GURL& url) { |
212 resource->callback = | 212 resource->callback = |
213 base::Bind(&SafeBrowsingBlockingPageTest::OnBlockingPageComplete, | 213 base::Bind(&SafeBrowsingBlockingPageTest::OnBlockingPageComplete, |
214 base::Unretained(this)); | 214 base::Unretained(this)); |
215 resource->callback_thread = | 215 resource->callback_thread = content::BrowserThread::GetTaskRunnerForThread( |
216 content::BrowserThread::GetMessageLoopProxyForThread( | 216 content::BrowserThread::IO); |
217 content::BrowserThread::IO); | |
218 resource->url = url; | 217 resource->url = url; |
219 resource->is_subresource = is_subresource; | 218 resource->is_subresource = is_subresource; |
220 resource->threat_type = SB_THREAT_TYPE_URL_MALWARE; | 219 resource->threat_type = SB_THREAT_TYPE_URL_MALWARE; |
221 resource->render_process_host_id = | 220 resource->render_process_host_id = |
222 web_contents()->GetRenderProcessHost()->GetID(); | 221 web_contents()->GetRenderProcessHost()->GetID(); |
223 resource->render_frame_id = web_contents()->GetMainFrame()->GetRoutingID(); | 222 resource->render_frame_id = web_contents()->GetMainFrame()->GetRoutingID(); |
224 resource->threat_source = safe_browsing::ThreatSource::LOCAL_PVER3; | 223 resource->threat_source = safe_browsing::ThreatSource::LOCAL_PVER3; |
225 } | 224 } |
226 | 225 |
227 UserResponse user_response_; | 226 UserResponse user_response_; |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 | 855 |
857 // No report should have been sent. | 856 // No report should have been sent. |
858 EXPECT_EQ(0u, ui_manager_->GetThreatDetails()->size()); | 857 EXPECT_EQ(0u, ui_manager_->GetThreatDetails()->size()); |
859 ui_manager_->GetThreatDetails()->clear(); | 858 ui_manager_->GetThreatDetails()->clear(); |
860 } | 859 } |
861 | 860 |
862 // TODO(mattm): Add test for extended reporting not shown or sent in incognito | 861 // TODO(mattm): Add test for extended reporting not shown or sent in incognito |
863 // window. | 862 // window. |
864 | 863 |
865 } // namespace safe_browsing | 864 } // namespace safe_browsing |
OLD | NEW |