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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 content::PAGE_TRANSITION_TYPED); | 119 content::PAGE_TRANSITION_TYPED); |
120 } | 120 } |
121 | 121 |
122 void GoBack(bool is_cross_site) { | 122 void GoBack(bool is_cross_site) { |
123 NavigationEntry* entry = contents()->GetController().GetEntryAtOffset(-1); | 123 NavigationEntry* entry = contents()->GetController().GetEntryAtOffset(-1); |
124 ASSERT_TRUE(entry); | 124 ASSERT_TRUE(entry); |
125 contents()->GetController().GoBack(); | 125 contents()->GetController().GoBack(); |
126 | 126 |
127 // The pending RVH should commit for cross-site navigations. | 127 // The pending RVH should commit for cross-site navigations. |
128 content::RenderViewHost* rvh = is_cross_site ? | 128 content::RenderViewHost* rvh = is_cross_site ? |
129 WebContentsTester::For(contents())->pending_rvh() : | 129 WebContentsTester::For(contents())->GetPendingRenderViewHost() : |
130 contents()->GetRenderViewHost(); | 130 contents()->GetRenderViewHost(); |
131 WebContentsTester::For(contents())->TestDidNavigate( | 131 WebContentsTester::For(contents())->TestDidNavigate( |
132 rvh, | 132 rvh, |
133 entry->GetPageID(), | 133 entry->GetPageID(), |
134 GURL(entry->GetURL()), | 134 GURL(entry->GetURL()), |
135 content::PAGE_TRANSITION_TYPED); | 135 content::PAGE_TRANSITION_TYPED); |
136 } | 136 } |
137 | 137 |
138 void ShowInterstitial(bool is_subresource, const char* url) { | 138 void ShowInterstitial(bool is_subresource, const char* url) { |
139 SafeBrowsingService::UnsafeResource resource; | 139 SafeBrowsingService::UnsafeResource resource; |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 | 626 |
627 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( | 627 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( |
628 prefs::kSafeBrowsingReportingEnabled)); | 628 prefs::kSafeBrowsingReportingEnabled)); |
629 | 629 |
630 // Simulate the user uncheck the report agreement checkbox. | 630 // Simulate the user uncheck the report agreement checkbox. |
631 sb_interstitial->SetReportingPreference(false); | 631 sb_interstitial->SetReportingPreference(false); |
632 | 632 |
633 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( | 633 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( |
634 prefs::kSafeBrowsingReportingEnabled)); | 634 prefs::kSafeBrowsingReportingEnabled)); |
635 } | 635 } |
OLD | NEW |