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/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 // Delete the host object on the UI thread and release the | 226 // Delete the host object on the UI thread and release the |
227 // SafeBrowsingService. | 227 // SafeBrowsingService. |
228 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, | 228 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, |
229 csd_host_.release()); | 229 csd_host_.release()); |
230 database_manager_ = NULL; | 230 database_manager_ = NULL; |
231 ui_manager_ = NULL; | 231 ui_manager_ = NULL; |
232 base::RunLoop().RunUntilIdle(); | 232 base::RunLoop().RunUntilIdle(); |
233 ChromeRenderViewHostTestHarness::TearDown(); | 233 ChromeRenderViewHostTestHarness::TearDown(); |
234 } | 234 } |
235 | 235 |
236 virtual content::BrowserContext* CreateBrowserContext() OVERRIDE { | 236 virtual content::BrowserContext* CreateBrowserContext() override { |
237 // Set custom profile object so that we can mock calls to IsOffTheRecord. | 237 // Set custom profile object so that we can mock calls to IsOffTheRecord. |
238 // This needs to happen before we call the parent SetUp() function. We use | 238 // This needs to happen before we call the parent SetUp() function. We use |
239 // a nice mock because other parts of the code are calling IsOffTheRecord. | 239 // a nice mock because other parts of the code are calling IsOffTheRecord. |
240 mock_profile_ = new NiceMock<MockTestingProfile>(); | 240 mock_profile_ = new NiceMock<MockTestingProfile>(); |
241 return mock_profile_; | 241 return mock_profile_; |
242 } | 242 } |
243 | 243 |
244 void OnPhishingDetectionDone(const std::string& verdict_str) { | 244 void OnPhishingDetectionDone(const std::string& verdict_str) { |
245 csd_host_->OnPhishingDetectionDone(verdict_str); | 245 csd_host_->OnPhishingDetectionDone(verdict_str); |
246 } | 246 } |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 EXPECT_EQ(url, resource.url); | 1141 EXPECT_EQ(url, resource.url); |
1142 EXPECT_EQ(url, resource.original_url); | 1142 EXPECT_EQ(url, resource.original_url); |
1143 | 1143 |
1144 ExpectStartPhishingDetection(NULL); | 1144 ExpectStartPhishingDetection(NULL); |
1145 | 1145 |
1146 // Showing a phishing warning will invalidate all the weak pointers which | 1146 // Showing a phishing warning will invalidate all the weak pointers which |
1147 // means we will not extract malware features. | 1147 // means we will not extract malware features. |
1148 ExpectShouldClassifyForMalwareResult(false); | 1148 ExpectShouldClassifyForMalwareResult(false); |
1149 } | 1149 } |
1150 } // namespace safe_browsing | 1150 } // namespace safe_browsing |
OLD | NEW |