Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: chrome/browser/safe_browsing/client_side_detection_host_unittest.cc

Issue 18068017: Change RenderViewHostTestHarness to create BrowserContext after thread startup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
diff --git a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
index 3a696b547cb434d54c7c4c7e3b7a3892ef167d2c..432aea57e6e974b0c59d7cfbf9a2553c14de3318 100644
--- a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
@@ -180,12 +180,6 @@ class ClientSideDetectionHostTest : public ChromeRenderViewHostTestHarness {
typedef SafeBrowsingUIManager::UnsafeResource UnsafeResource;
virtual void SetUp() {
- // Set custom profile object so that we can mock calls to IsOffTheRecord.
- // This needs to happen before we call the parent SetUp() function. We use
- // a nice mock because other parts of the code are calling IsOffTheRecord.
- mock_profile_ = new NiceMock<MockTestingProfile>();
- browser_context_.reset(mock_profile_);
-
ChromeRenderViewHostTestHarness::SetUp();
// Inject service classes.
@@ -221,6 +215,14 @@ class ClientSideDetectionHostTest : public ChromeRenderViewHostTestHarness {
ChromeRenderViewHostTestHarness::TearDown();
}
+ virtual content::BrowserContext* CreateBrowserContext() OVERRIDE {
+ // Set custom profile object so that we can mock calls to IsOffTheRecord.
+ // This needs to happen before we call the parent SetUp() function. We use
+ // a nice mock because other parts of the code are calling IsOffTheRecord.
+ mock_profile_ = new NiceMock<MockTestingProfile>();
+ return mock_profile_;
+ }
+
void OnPhishingDetectionDone(const std::string& verdict_str) {
csd_host_->OnPhishingDetectionDone(verdict_str);
}

Powered by Google App Engine
This is Rietveld 408576698