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

Unified Diff: chrome/browser/extensions/extension_ui_unittest.cc

Issue 10784035: Refactored SettingsFrontend and forwarding of calls to the backends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comment Created 8 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/extensions/extension_ui_unittest.cc
diff --git a/chrome/browser/extensions/extension_ui_unittest.cc b/chrome/browser/extensions/extension_ui_unittest.cc
index 465fe45923ef1992b10436713611aa34631bb72b..03bb89af1eaf1594d293c9e5c2672e116fb6015b 100644
--- a/chrome/browser/extensions/extension_ui_unittest.cc
+++ b/chrome/browser/extensions/extension_ui_unittest.cc
@@ -21,16 +21,18 @@ using extensions::Extension;
class ExtensionUITest : public testing::Test {
public:
- ExtensionUITest() : ui_thread_(content::BrowserThread::UI, &message_loop_) {
- }
+ ExtensionUITest()
+ : ui_thread_(content::BrowserThread::UI, &message_loop_),
+ file_thread_(content::BrowserThread::FILE, &message_loop_) {}
protected:
- void SetUp() {
+ virtual void SetUp() OVERRIDE {
// Create an ExtensionService and ManagementPolicy to inject into the
// ExtensionSettingsHandler.
+ profile_.reset(new TestingProfile());
extensions::TestExtensionSystem* system =
static_cast<extensions::TestExtensionSystem*>(
- extensions::ExtensionSystem::Get(&profile_));
+ extensions::ExtensionSystem::Get(profile_.get()));
extension_service_ = system->CreateExtensionService(
CommandLine::ForCurrentProcess(), FilePath(), false);
management_policy_ = system->CreateManagementPolicy();
@@ -39,6 +41,13 @@ class ExtensionUITest : public testing::Test {
management_policy_));
}
+ virtual void TearDown() OVERRIDE {
+ handler_.reset();
+ profile_.reset();
+ // Execute any pending deletion tasks.
+ message_loop_.RunAllPending();
+ }
+
static DictionaryValue* DeserializeJSONTestData(const FilePath& path,
std::string *error) {
Value* value;
@@ -110,7 +119,8 @@ class ExtensionUITest : public testing::Test {
MessageLoop message_loop_;
content::TestBrowserThread ui_thread_;
- TestingProfile profile_;
+ content::TestBrowserThread file_thread_;
+ scoped_ptr<TestingProfile> profile_;
ExtensionService* extension_service_;
extensions::ManagementPolicy* management_policy_;
scoped_ptr<ExtensionSettingsHandler> handler_;
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/browser/extensions/page_action_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698