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

Unified Diff: chrome/browser/extensions/test_extension_environment.h

Issue 1175783003: Split out Ash dependency in app info dialog unittests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ViewEventTestBase will not play nice Created 5 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/extensions/test_extension_environment.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/test_extension_environment.h
diff --git a/chrome/browser/extensions/test_extension_environment.h b/chrome/browser/extensions/test_extension_environment.h
index bea77e1d4e96290f959ab27761abbc867032f240..ad026785b1989f58ba8ce881a1c77f32fb70c25d 100644
--- a/chrome/browser/extensions/test_extension_environment.h
+++ b/chrome/browser/extensions/test_extension_environment.h
@@ -7,7 +7,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
-#include "content/public/test/test_browser_thread_bundle.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
@@ -28,6 +27,7 @@ class Value;
namespace content {
class WebContents;
+class TestBrowserThreadBundle;
}
namespace extensions {
@@ -40,7 +40,18 @@ class TestExtensionSystem;
// extensions and tabs for extension-related unittests.
class TestExtensionEnvironment {
public:
+ // Fetches the TestExtensionSystem in |profile| and creates a default
+ // ExtensionService there,
+ static ExtensionService* CreateExtensionServiceForProfile(
+ TestingProfile* profile);
+
TestExtensionEnvironment();
+
+ // Allows a test harness to pass its own message loop (typically
+ // base::MessageLoopForUI::current()), rather than have
+ // TestExtensionEnvironment create and own a TestBrowserThreadBundle.
+ explicit TestExtensionEnvironment(base::MessageLoopForUI* message_loop);
tapted 2015/06/11 23:52:00 this is so something inheriting from AshTestBase c
+
~TestExtensionEnvironment();
TestingProfile* profile() const;
@@ -67,11 +78,18 @@ class TestExtensionEnvironment {
const Extension* MakeExtension(const base::Value& manifest_extra,
const std::string& id);
+ // Generates a valid packaged app manifest with the given ID. If |install|
+ // it gets added to the ExtensionService in |profile|.
+ scoped_refptr<Extension> MakePackagedApp(const std::string& id, bool install);
+
// Returns a test web contents that has a tab id.
scoped_ptr<content::WebContents> MakeTab() const;
+ // Deletes the testing profile to test profile teardown.
+ void DeleteProfile();
+
private:
- content::TestBrowserThreadBundle thread_bundle_;
+ scoped_ptr<content::TestBrowserThreadBundle> thread_bundle_;
#if defined(OS_CHROMEOS)
chromeos::ScopedTestDeviceSettingsService test_device_settings_service_;
@@ -84,7 +102,8 @@ class TestExtensionEnvironment {
#endif
scoped_ptr<TestingProfile> profile_;
ExtensionService* extension_service_;
- ExtensionPrefs* extension_prefs_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestExtensionEnvironment);
};
} // namespace extensions
« no previous file with comments | « no previous file | chrome/browser/extensions/test_extension_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698