| 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 "chrome/browser/prefs/pref_service.h" | 5 #include "chrome/browser/prefs/pref_service.h" |
| 6 #include "chrome/browser/profiles/profile.h" | 6 #include "chrome/browser/profiles/profile.h" |
| 7 #include "chrome/browser/safe_browsing/malware_details.h" | 7 #include "chrome/browser/safe_browsing/malware_details.h" |
| 8 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 8 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
| 9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 bool is_subresource, | 178 bool is_subresource, |
| 179 const GURL& url) { | 179 const GURL& url) { |
| 180 resource->callback = | 180 resource->callback = |
| 181 base::Bind(&SafeBrowsingBlockingPageTest::OnBlockingPageComplete, | 181 base::Bind(&SafeBrowsingBlockingPageTest::OnBlockingPageComplete, |
| 182 base::Unretained(this)); | 182 base::Unretained(this)); |
| 183 resource->url = url; | 183 resource->url = url; |
| 184 resource->is_subresource = is_subresource; | 184 resource->is_subresource = is_subresource; |
| 185 resource->threat_type = SafeBrowsingService::URL_MALWARE; | 185 resource->threat_type = SafeBrowsingService::URL_MALWARE; |
| 186 resource->render_process_host_id = contents()->GetRenderProcessHost()-> | 186 resource->render_process_host_id = contents()->GetRenderProcessHost()-> |
| 187 GetID(); | 187 GetID(); |
| 188 resource->render_view_id = contents()->GetRenderViewHost()->routing_id(); | 188 resource->render_view_id = contents()->GetRenderViewHost()->GetRoutingID(); |
| 189 } | 189 } |
| 190 | 190 |
| 191 UserResponse user_response_; | 191 UserResponse user_response_; |
| 192 TestSafeBrowsingBlockingPageFactory factory_; | 192 TestSafeBrowsingBlockingPageFactory factory_; |
| 193 content::TestBrowserThread ui_thread_; | 193 content::TestBrowserThread ui_thread_; |
| 194 content::TestBrowserThread file_user_blocking_thread_; | 194 content::TestBrowserThread file_user_blocking_thread_; |
| 195 content::TestBrowserThread io_thread_; | 195 content::TestBrowserThread io_thread_; |
| 196 }; | 196 }; |
| 197 | 197 |
| 198 // Tests showing a blocking page for a malware page and not proceeding. | 198 // Tests showing a blocking page for a malware page and not proceeding. |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 | 619 |
| 620 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( | 620 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( |
| 621 prefs::kSafeBrowsingReportingEnabled)); | 621 prefs::kSafeBrowsingReportingEnabled)); |
| 622 | 622 |
| 623 // Simulate the user uncheck the report agreement checkbox. | 623 // Simulate the user uncheck the report agreement checkbox. |
| 624 sb_interstitial->SetReportingPreference(false); | 624 sb_interstitial->SetReportingPreference(false); |
| 625 | 625 |
| 626 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( | 626 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( |
| 627 prefs::kSafeBrowsingReportingEnabled)); | 627 prefs::kSafeBrowsingReportingEnabled)); |
| 628 } | 628 } |
| OLD | NEW |