| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_path.h" | 5 #include "base/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/task.h" | 8 #include "base/task.h" |
| 9 #include "chrome/browser/safe_browsing/browser_feature_extractor.h" | 9 #include "chrome/browser/safe_browsing/browser_feature_extractor.h" |
| 10 #include "chrome/browser/safe_browsing/client_side_detection_host.h" | 10 #include "chrome/browser/safe_browsing/client_side_detection_host.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } | 144 } |
| 145 } // namespace | 145 } // namespace |
| 146 | 146 |
| 147 class ClientSideDetectionHostTest : public TabContentsWrapperTestHarness { | 147 class ClientSideDetectionHostTest : public TabContentsWrapperTestHarness { |
| 148 public: | 148 public: |
| 149 virtual void SetUp() { | 149 virtual void SetUp() { |
| 150 // Set custom profile object so that we can mock calls to IsOffTheRecord. | 150 // Set custom profile object so that we can mock calls to IsOffTheRecord. |
| 151 // This needs to happen before we call the parent SetUp() function. We use | 151 // This needs to happen before we call the parent SetUp() function. We use |
| 152 // a nice mock because other parts of the code are calling IsOffTheRecord. | 152 // a nice mock because other parts of the code are calling IsOffTheRecord. |
| 153 mock_profile_ = new NiceMock<MockTestingProfile>(); | 153 mock_profile_ = new NiceMock<MockTestingProfile>(); |
| 154 profile_.reset(mock_profile_); | 154 browser_context_.reset(mock_profile_); |
| 155 | 155 |
| 156 ui_thread_.reset(new BrowserThread(BrowserThread::UI, &message_loop_)); | 156 ui_thread_.reset(new BrowserThread(BrowserThread::UI, &message_loop_)); |
| 157 // Note: we're starting a real IO thread to make sure our DCHECKs that | 157 // Note: we're starting a real IO thread to make sure our DCHECKs that |
| 158 // verify which thread is running are actually tested. | 158 // verify which thread is running are actually tested. |
| 159 io_thread_.reset(new BrowserThread(BrowserThread::IO)); | 159 io_thread_.reset(new BrowserThread(BrowserThread::IO)); |
| 160 ASSERT_TRUE(io_thread_->Start()); | 160 ASSERT_TRUE(io_thread_->Start()); |
| 161 | 161 |
| 162 TabContentsWrapperTestHarness::SetUp(); | 162 TabContentsWrapperTestHarness::SetUp(); |
| 163 | 163 |
| 164 // Inject service classes. | 164 // Inject service classes. |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 EXPECT_TRUE(Mock::VerifyAndClear(sb_service_.get())); | 744 EXPECT_TRUE(Mock::VerifyAndClear(sb_service_.get())); |
| 745 EXPECT_EQ(url, resource.url); | 745 EXPECT_EQ(url, resource.url); |
| 746 EXPECT_EQ(url, resource.original_url); | 746 EXPECT_EQ(url, resource.original_url); |
| 747 delete resource.client; | 747 delete resource.client; |
| 748 msg = process()->sink().GetFirstMessageMatching( | 748 msg = process()->sink().GetFirstMessageMatching( |
| 749 SafeBrowsingMsg_StartPhishingDetection::ID); | 749 SafeBrowsingMsg_StartPhishingDetection::ID); |
| 750 ASSERT_FALSE(msg); | 750 ASSERT_FALSE(msg); |
| 751 } | 751 } |
| 752 | 752 |
| 753 } // namespace safe_browsing | 753 } // namespace safe_browsing |
| OLD | NEW |