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

Unified Diff: chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc

Issue 17127002: Correctly integrate StoragePartition into TestingProfile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix InstantNTP test. 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/ui/toolbar/wrench_menu_model_unittest.cc
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc b/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc
index d4c94a86b3af02938be3cf12b2046c83f9b0f296..e0ff98124dc05efc7fcc015fb1abecfd461c7b3d 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/toolbar/wrench_menu_model.h"
#include "chrome/app/chrome_command_ids.h"
+#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/global_error/global_error.h"
@@ -13,6 +14,9 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/menu_model_test.h"
+#include "chrome/test/base/testing_browser_process.h"
+#include "chrome/test/base/testing_io_thread_state.h"
+#include "chrome/test/base/testing_pref_service_syncable.h"
#include "chrome/test/base/testing_profile.h"
#include "grit/generated_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -77,6 +81,27 @@ class WrenchMenuModelTest : public BrowserWithTestWindowTest,
virtual bool GetAcceleratorForCommandId(
int command_id,
ui::Accelerator* accelerator) OVERRIDE { return false; }
+
+ protected:
+ virtual void SetUp() OVERRIDE {
+ prefs_.reset(new TestingPrefServiceSimple());
+ chrome::RegisterLocalState(prefs_->registry());
+
+ TestingBrowserProcess::GetGlobal()->SetLocalState(prefs_.get());
+ testing_io_thread_state_.reset(new chrome::TestingIOThreadState());
+ BrowserWithTestWindowTest::SetUp();
+ }
+
+ virtual void TearDown() OVERRIDE {
+ BrowserWithTestWindowTest::TearDown();
+ testing_io_thread_state_.reset();
+ TestingBrowserProcess::GetGlobal()->SetLocalState(NULL);
+ DestroyBrowserAndProfile();
+ }
+
+ private:
+ scoped_ptr<TestingPrefServiceSimple> prefs_;
+ scoped_ptr<chrome::TestingIOThreadState> testing_io_thread_state_;
};
// Copies parts of MenuModelTest::Delegate and combines them with the

Powered by Google App Engine
This is Rietveld 408576698