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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "chrome/browser/safe_browsing/browser_feature_extractor.h" | 10 #include "chrome/browser/safe_browsing/browser_feature_extractor.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 database_manager_ = | 212 database_manager_ = |
213 new StrictMock<MockSafeBrowsingDatabaseManager>(sb_service); | 213 new StrictMock<MockSafeBrowsingDatabaseManager>(sb_service); |
214 ui_manager_ = new StrictMock<MockSafeBrowsingUIManager>(sb_service); | 214 ui_manager_ = new StrictMock<MockSafeBrowsingUIManager>(sb_service); |
215 csd_host_.reset(safe_browsing::ClientSideDetectionHost::Create( | 215 csd_host_.reset(safe_browsing::ClientSideDetectionHost::Create( |
216 web_contents())); | 216 web_contents())); |
217 csd_host_->set_client_side_detection_service(csd_service_.get()); | 217 csd_host_->set_client_side_detection_service(csd_service_.get()); |
218 csd_host_->set_safe_browsing_managers(ui_manager_, database_manager_); | 218 csd_host_->set_safe_browsing_managers(ui_manager_, database_manager_); |
219 // We need to create this here since we don't call | 219 // We need to create this here since we don't call |
220 // DidNavigateMainFramePostCommit in this test. | 220 // DidNavigateMainFramePostCommit in this test. |
221 csd_host_->browse_info_.reset(new BrowseInfo); | 221 csd_host_->browse_info_.reset(new BrowseInfo); |
| 222 |
| 223 // By default this is set to false. Turn it on as if we are in canary or |
| 224 // dev channel |
| 225 csd_host_->malware_report_enabled_ = true; |
222 } | 226 } |
223 | 227 |
224 static void RunAllPendingOnIO(base::WaitableEvent* event) { | 228 static void RunAllPendingOnIO(base::WaitableEvent* event) { |
225 MessageLoop::current()->RunUntilIdle(); | 229 MessageLoop::current()->RunUntilIdle(); |
226 event->Signal(); | 230 event->Signal(); |
227 } | 231 } |
228 | 232 |
229 virtual void TearDown() { | 233 virtual void TearDown() { |
230 // Delete the host object on the UI thread and release the | 234 // Delete the host object on the UI thread and release the |
231 // SafeBrowsingService. | 235 // SafeBrowsingService. |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 EXPECT_TRUE(Mock::VerifyAndClear(ui_manager_.get())); | 965 EXPECT_TRUE(Mock::VerifyAndClear(ui_manager_.get())); |
962 EXPECT_EQ(url, resource.url); | 966 EXPECT_EQ(url, resource.url); |
963 EXPECT_EQ(url, resource.original_url); | 967 EXPECT_EQ(url, resource.original_url); |
964 resource.callback.Reset(); | 968 resource.callback.Reset(); |
965 msg = process()->sink().GetFirstMessageMatching( | 969 msg = process()->sink().GetFirstMessageMatching( |
966 SafeBrowsingMsg_StartPhishingDetection::ID); | 970 SafeBrowsingMsg_StartPhishingDetection::ID); |
967 ASSERT_FALSE(msg); | 971 ASSERT_FALSE(msg); |
968 } | 972 } |
969 | 973 |
970 } // namespace safe_browsing | 974 } // namespace safe_browsing |
OLD | NEW |