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

Unified Diff: ui/ozone/platform/test/ozone_platform_test.cc

Issue 291473002: ozone: Initialize a subsystem only if necessary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r270817 Created 6 years, 7 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: ui/ozone/platform/test/ozone_platform_test.cc
diff --git a/ui/ozone/platform/test/ozone_platform_test.cc b/ui/ozone/platform/test/ozone_platform_test.cc
index 3976eb5562cd417cfee9322bb60af25e96034363..8dcbde7932641c15401faff742b1158759a9c451 100644
--- a/ui/ozone/platform/test/ozone_platform_test.cc
+++ b/ui/ozone/platform/test/ozone_platform_test.cc
@@ -27,41 +27,51 @@ namespace {
// This platform dumps images to a file for testing purposes.
class OzonePlatformTest : public OzonePlatform {
public:
- OzonePlatformTest(const base::FilePath& dump_file)
- : device_manager_(CreateDeviceManager()),
- surface_factory_ozone_(dump_file),
- event_factory_ozone_(NULL, device_manager_.get()) {}
+ OzonePlatformTest(const base::FilePath& dump_file) : file_path_(dump_file) {}
virtual ~OzonePlatformTest() {}
// OzonePlatform:
virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE {
- return &surface_factory_ozone_;
+ return surface_factory_ozone_.get();
}
- virtual ui::EventFactoryOzone* GetEventFactoryOzone() OVERRIDE {
- return &event_factory_ozone_;
+ virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE {
+ return event_factory_ozone_.get();
}
- virtual ui::InputMethodContextFactoryOzone*
- GetInputMethodContextFactoryOzone() OVERRIDE {
- return &input_method_context_factory_ozone_;
+ virtual InputMethodContextFactoryOzone* GetInputMethodContextFactoryOzone()
+ OVERRIDE {
+ return input_method_context_factory_ozone_.get();
}
- virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
- return &cursor_factory_ozone_;
+ virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
+ return cursor_factory_ozone_.get();
}
#if defined(OS_CHROMEOS)
- virtual scoped_ptr<ui::NativeDisplayDelegate> CreateNativeDisplayDelegate()
+ virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
OVERRIDE {
- return scoped_ptr<ui::NativeDisplayDelegate>(
- new NativeDisplayDelegateOzone());
+ return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone());
}
#endif
+ virtual void InitializeUI() OVERRIDE {
+ device_manager_ = CreateDeviceManager();
+ surface_factory_ozone_.reset(new gfx::FileSurfaceFactory(file_path_));
+ event_factory_ozone_.reset(
+ new EventFactoryEvdev(NULL, device_manager_.get()));
+ input_method_context_factory_ozone_.reset(
+ new InputMethodContextFactoryOzone());
+ cursor_factory_ozone_.reset(new CursorFactoryOzone());
+ }
+
+ virtual void InitializeGPU() OVERRIDE {}
+
private:
scoped_ptr<DeviceManager> device_manager_;
- gfx::FileSurfaceFactory surface_factory_ozone_;
- ui::EventFactoryEvdev event_factory_ozone_;
- ui::InputMethodContextFactoryOzone input_method_context_factory_ozone_;
- ui::CursorFactoryOzone cursor_factory_ozone_;
+ scoped_ptr<gfx::FileSurfaceFactory> surface_factory_ozone_;
+ scoped_ptr<EventFactoryEvdev> event_factory_ozone_;
+ scoped_ptr<InputMethodContextFactoryOzone>
+ input_method_context_factory_ozone_;
+ scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_;
+ base::FilePath file_path_;
DISALLOW_COPY_AND_ASSIGN(OzonePlatformTest);
};
« no previous file with comments | « ui/ozone/platform/egltest/ozone_platform_egltest.cc ('k') | ui/views/widget/desktop_aura/desktop_screen_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698