Chromium Code Reviews| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 OK, | 119 OK, |
| 120 CANCEL | 120 CANCEL |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 SafeBrowsingBlockingPageTest() { | 123 SafeBrowsingBlockingPageTest() { |
| 124 ResetUserResponse(); | 124 ResetUserResponse(); |
| 125 // The safe browsing UI manager does not need a service for this test. | 125 // The safe browsing UI manager does not need a service for this test. |
| 126 ui_manager_ = new TestSafeBrowsingUIManager(NULL); | 126 ui_manager_ = new TestSafeBrowsingUIManager(NULL); |
| 127 } | 127 } |
| 128 | 128 |
| 129 virtual void SetUp() { | 129 virtual void SetUp() OVERRIDE { |
| 130 ChromeRenderViewHostTestHarness::SetUp(); | 130 ChromeRenderViewHostTestHarness::SetUp(); |
| 131 SafeBrowsingBlockingPage::RegisterFactory(&factory_); | 131 SafeBrowsingBlockingPage::RegisterFactory(&factory_); |
| 132 MalwareDetails::RegisterFactory(NULL); // Create it fresh each time. | |
|
Scott Hess - ex-Googler
2013/10/31 22:07:20
Shouldn't this move to TearDown() rather than bein
mattm
2013/10/31 22:39:23
I believe it is just not being used. (Nothing was
| |
| 133 ResetUserResponse(); | 132 ResetUserResponse(); |
| 134 } | 133 } |
| 135 | 134 |
| 136 virtual void TearDown() { | 135 virtual void TearDown() OVERRIDE { |
| 137 // Release the UI manager before the BrowserThreads are destroyed. | 136 // Release the UI manager before the BrowserThreads are destroyed. |
| 138 ui_manager_ = NULL; | 137 ui_manager_ = NULL; |
| 138 SafeBrowsingBlockingPage::RegisterFactory(NULL); | |
| 139 ChromeRenderViewHostTestHarness::TearDown(); | 139 ChromeRenderViewHostTestHarness::TearDown(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void OnBlockingPageComplete(bool proceed) { | 142 void OnBlockingPageComplete(bool proceed) { |
| 143 if (proceed) | 143 if (proceed) |
| 144 user_response_ = OK; | 144 user_response_ = OK; |
| 145 else | 145 else |
| 146 user_response_ = CANCEL; | 146 user_response_ = CANCEL; |
| 147 } | 147 } |
| 148 | 148 |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 658 | 658 |
| 659 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( | 659 EXPECT_TRUE(profile->GetPrefs()->GetBoolean( |
| 660 prefs::kSafeBrowsingReportingEnabled)); | 660 prefs::kSafeBrowsingReportingEnabled)); |
| 661 | 661 |
| 662 // Simulate the user uncheck the report agreement checkbox. | 662 // Simulate the user uncheck the report agreement checkbox. |
| 663 sb_interstitial->SetReportingPreference(false); | 663 sb_interstitial->SetReportingPreference(false); |
| 664 | 664 |
| 665 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( | 665 EXPECT_FALSE(profile->GetPrefs()->GetBoolean( |
| 666 prefs::kSafeBrowsingReportingEnabled)); | 666 prefs::kSafeBrowsingReportingEnabled)); |
| 667 } | 667 } |
| OLD | NEW |