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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc

Issue 190663012: Run ContentMain in a browser_test's browser process. This removes duplication of code in the browse… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: cleanup Created 6 years, 9 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/ui/views/bookmarks/bookmark_bar_view_test.cc
===================================================================
--- chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc (revision 257128)
+++ chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc (working copy)
@@ -12,6 +12,7 @@
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/bookmarks/bookmark_test_helpers.h"
+#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/bookmarks/bookmark_utils.h"
@@ -20,7 +21,9 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
+#include "chrome/common/chrome_content_client.h"
#include "chrome/common/pref_names.h"
+#include "chrome/test/base/chrome_unit_test_suite.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/scoped_testing_local_state.h"
#include "chrome/test/base/test_browser_window.h"
@@ -118,6 +121,13 @@
model_(NULL) {}
virtual void SetUp() OVERRIDE {
+ ChromeUnitTestSuite::InitializeProviders();
+ ChromeUnitTestSuite::InitializeResourceBundle();
+ content_client_.reset(new ChromeContentClient);
+ content::SetContentClient(content_client_.get());
+ browser_content_client_.reset(new chrome::ChromeContentBrowserClient());
+ content::SetBrowserClientForTesting(browser_content_client_.get());
+
views::MenuController::TurnOffMenuSelectionHoldForTest();
BookmarkBarView::DisableAnimationsForTesting(true);
@@ -185,6 +195,10 @@
ViewEventTestBase::TearDown();
BookmarkBarView::DisableAnimationsForTesting(false);
+
+ browser_content_client_.reset();
+ content_client_.reset();
+ content::SetContentClient(NULL);
}
protected:
@@ -239,6 +253,8 @@
}
gfx::Size bb_view_pref_;
+ scoped_ptr<ChromeContentClient> content_client_;
+ scoped_ptr<chrome::ChromeContentBrowserClient> browser_content_client_;
scoped_ptr<TestingProfile> profile_;
scoped_ptr<Browser> browser_;
scoped_ptr<ScopedTestingLocalState> local_state_;

Powered by Google App Engine
This is Rietveld 408576698