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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/safe_browsing/malware_details.h" | 10 #include "chrome/browser/safe_browsing/malware_details.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 OK, | 91 OK, |
92 CANCEL | 92 CANCEL |
93 }; | 93 }; |
94 | 94 |
95 SafeBrowsingBlockingPageTest() { | 95 SafeBrowsingBlockingPageTest() { |
96 ResetUserResponse(); | 96 ResetUserResponse(); |
97 // The safe browsing UI manager does not need a service for this test. | 97 // The safe browsing UI manager does not need a service for this test. |
98 ui_manager_ = new TestSafeBrowsingUIManager(NULL); | 98 ui_manager_ = new TestSafeBrowsingUIManager(NULL); |
99 } | 99 } |
100 | 100 |
101 virtual void SetUp() override { | 101 void SetUp() override { |
102 ChromeRenderViewHostTestHarness::SetUp(); | 102 ChromeRenderViewHostTestHarness::SetUp(); |
103 SafeBrowsingBlockingPage::RegisterFactory(&factory_); | 103 SafeBrowsingBlockingPage::RegisterFactory(&factory_); |
104 ResetUserResponse(); | 104 ResetUserResponse(); |
105 } | 105 } |
106 | 106 |
107 virtual void TearDown() override { | 107 void TearDown() override { |
108 // Release the UI manager before the BrowserThreads are destroyed. | 108 // Release the UI manager before the BrowserThreads are destroyed. |
109 ui_manager_ = NULL; | 109 ui_manager_ = NULL; |
110 SafeBrowsingBlockingPage::RegisterFactory(NULL); | 110 SafeBrowsingBlockingPage::RegisterFactory(NULL); |
111 // Clean up singleton reference (crbug.com/110594). | 111 // Clean up singleton reference (crbug.com/110594). |
112 MalwareDetails::RegisterFactory(NULL); | 112 MalwareDetails::RegisterFactory(NULL); |
113 ChromeRenderViewHostTestHarness::TearDown(); | 113 ChromeRenderViewHostTestHarness::TearDown(); |
114 } | 114 } |
115 | 115 |
116 void OnBlockingPageComplete(bool proceed) { | 116 void OnBlockingPageComplete(bool proceed) { |
117 if (proceed) | 117 if (proceed) |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 | 656 |
657 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( | 657 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( |
658 prefs::kSafeBrowsingExtendedReportingEnabled)); | 658 prefs::kSafeBrowsingExtendedReportingEnabled)); |
659 | 659 |
660 // Simulate the user uncheck the report agreement checkbox. | 660 // Simulate the user uncheck the report agreement checkbox. |
661 sb_interstitial->SetReportingPreference(false); | 661 sb_interstitial->SetReportingPreference(false); |
662 | 662 |
663 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( | 663 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( |
664 prefs::kSafeBrowsingExtendedReportingEnabled)); | 664 prefs::kSafeBrowsingExtendedReportingEnabled)); |
665 } | 665 } |
OLD | NEW |