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/interstitials/chrome_controller_client.h" | 8 #include "chrome/browser/interstitials/chrome_controller_client.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 10 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 SafeBrowsingBlockingPageTest() { | 85 SafeBrowsingBlockingPageTest() { |
86 ResetUserResponse(); | 86 ResetUserResponse(); |
87 // The safe browsing UI manager does not need a service for this test. | 87 // The safe browsing UI manager does not need a service for this test. |
88 ui_manager_ = new TestSafeBrowsingUIManager(NULL); | 88 ui_manager_ = new TestSafeBrowsingUIManager(NULL); |
89 } | 89 } |
90 | 90 |
91 void SetUp() override { | 91 void SetUp() override { |
92 ChromeRenderViewHostTestHarness::SetUp(); | 92 ChromeRenderViewHostTestHarness::SetUp(); |
93 SafeBrowsingBlockingPage::RegisterFactory(&factory_); | 93 SafeBrowsingBlockingPage::RegisterFactory(&factory_); |
94 ResetUserResponse(); | 94 ResetUserResponse(); |
| 95 SafeBrowsingUIManager::CreateWhitelistForTesting(web_contents()); |
95 } | 96 } |
96 | 97 |
97 void TearDown() override { | 98 void TearDown() override { |
98 // Release the UI manager before the BrowserThreads are destroyed. | 99 // Release the UI manager before the BrowserThreads are destroyed. |
99 ui_manager_ = NULL; | 100 ui_manager_ = NULL; |
100 SafeBrowsingBlockingPage::RegisterFactory(NULL); | 101 SafeBrowsingBlockingPage::RegisterFactory(NULL); |
101 // Clean up singleton reference (crbug.com/110594). | 102 // Clean up singleton reference (crbug.com/110594). |
102 ThreatDetails::RegisterFactory(NULL); | 103 ThreatDetails::RegisterFactory(NULL); |
103 ChromeRenderViewHostTestHarness::TearDown(); | 104 ChromeRenderViewHostTestHarness::TearDown(); |
104 } | 105 } |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 | 835 |
835 // No report should have been sent. | 836 // No report should have been sent. |
836 EXPECT_EQ(0u, ui_manager_->GetThreatDetails()->size()); | 837 EXPECT_EQ(0u, ui_manager_->GetThreatDetails()->size()); |
837 ui_manager_->GetThreatDetails()->clear(); | 838 ui_manager_->GetThreatDetails()->clear(); |
838 } | 839 } |
839 | 840 |
840 // TODO(mattm): Add test for extended reporting not shown or sent in incognito | 841 // TODO(mattm): Add test for extended reporting not shown or sent in incognito |
841 // window. | 842 // window. |
842 | 843 |
843 } // namespace safe_browsing | 844 } // namespace safe_browsing |
OLD | NEW |