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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void(const BrowseInfo* info, | 134 void(const BrowseInfo* info, |
135 ClientPhishingRequest*, | 135 ClientPhishingRequest*, |
136 const BrowserFeatureExtractor::DoneCallback&)); | 136 const BrowserFeatureExtractor::DoneCallback&)); |
137 }; | 137 }; |
138 | 138 |
139 // Helper function which quits the UI message loop from the IO message loop. | 139 // Helper function which quits the UI message loop from the IO message loop. |
140 void QuitUIMessageLoopFromIO() { | 140 void QuitUIMessageLoopFromIO() { |
141 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 141 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
142 BrowserThread::PostTask(BrowserThread::UI, | 142 BrowserThread::PostTask(BrowserThread::UI, |
143 FROM_HERE, | 143 FROM_HERE, |
144 new MessageLoop::QuitTask()); | 144 MessageLoop::QuitClosure()); |
145 } | 145 } |
146 } // namespace | 146 } // namespace |
147 | 147 |
148 class ClientSideDetectionHostTest : public TabContentsWrapperTestHarness { | 148 class ClientSideDetectionHostTest : public TabContentsWrapperTestHarness { |
149 public: | 149 public: |
150 virtual void SetUp() { | 150 virtual void SetUp() { |
151 // Set custom profile object so that we can mock calls to IsOffTheRecord. | 151 // Set custom profile object so that we can mock calls to IsOffTheRecord. |
152 // This needs to happen before we call the parent SetUp() function. We use | 152 // This needs to happen before we call the parent SetUp() function. We use |
153 // a nice mock because other parts of the code are calling IsOffTheRecord. | 153 // a nice mock because other parts of the code are calling IsOffTheRecord. |
154 mock_profile_ = new NiceMock<MockTestingProfile>(); | 154 mock_profile_ = new NiceMock<MockTestingProfile>(); |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 EXPECT_TRUE(Mock::VerifyAndClear(sb_service_.get())); | 737 EXPECT_TRUE(Mock::VerifyAndClear(sb_service_.get())); |
738 EXPECT_EQ(url, resource.url); | 738 EXPECT_EQ(url, resource.url); |
739 EXPECT_EQ(url, resource.original_url); | 739 EXPECT_EQ(url, resource.original_url); |
740 delete resource.client; | 740 delete resource.client; |
741 msg = process()->sink().GetFirstMessageMatching( | 741 msg = process()->sink().GetFirstMessageMatching( |
742 SafeBrowsingMsg_StartPhishingDetection::ID); | 742 SafeBrowsingMsg_StartPhishingDetection::ID); |
743 ASSERT_FALSE(msg); | 743 ASSERT_FALSE(msg); |
744 } | 744 } |
745 | 745 |
746 } // namespace safe_browsing | 746 } // namespace safe_browsing |
OLD | NEW |