OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/ozone/platform/test/ozone_platform_test.h" | 5 #include "ui/ozone/platform/test/ozone_platform_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "ui/events/ozone/device/device_manager.h" | |
10 #include "ui/ozone/platform/test/test_cursor_factory.h" | 9 #include "ui/ozone/platform/test/test_cursor_factory.h" |
11 #include "ui/ozone/platform/test/test_event_factory.h" | 10 #include "ui/ozone/platform/test/test_event_factory.h" |
12 #include "ui/ozone/platform/test/test_window.h" | 11 #include "ui/ozone/platform/test/test_window.h" |
13 #include "ui/ozone/platform/test/test_window_manager.h" | 12 #include "ui/ozone/platform/test/test_window_manager.h" |
14 #include "ui/ozone/public/cursor_factory_ozone.h" | 13 #include "ui/ozone/public/cursor_factory_ozone.h" |
15 #include "ui/ozone/public/gpu_platform_support.h" | 14 #include "ui/ozone/public/gpu_platform_support.h" |
16 #include "ui/ozone/public/gpu_platform_support_host.h" | 15 #include "ui/ozone/public/gpu_platform_support_host.h" |
17 #include "ui/ozone/public/ozone_platform.h" | 16 #include "ui/ozone/public/ozone_platform.h" |
18 #include "ui/ozone/public/ozone_switches.h" | 17 #include "ui/ozone/public/ozone_switches.h" |
19 | 18 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone()); | 62 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone()); |
64 } | 63 } |
65 virtual scoped_ptr<TouchscreenDeviceManager> | 64 virtual scoped_ptr<TouchscreenDeviceManager> |
66 CreateTouchscreenDeviceManager() OVERRIDE { | 65 CreateTouchscreenDeviceManager() OVERRIDE { |
67 return scoped_ptr<TouchscreenDeviceManager>( | 66 return scoped_ptr<TouchscreenDeviceManager>( |
68 new TouchscreenDeviceManagerOzone()); | 67 new TouchscreenDeviceManagerOzone()); |
69 } | 68 } |
70 #endif | 69 #endif |
71 | 70 |
72 virtual void InitializeUI() OVERRIDE { | 71 virtual void InitializeUI() OVERRIDE { |
73 device_manager_ = CreateDeviceManager(); | |
74 window_manager_.reset(new TestWindowManager(file_path_)); | 72 window_manager_.reset(new TestWindowManager(file_path_)); |
75 window_manager_->Initialize(); | 73 window_manager_->Initialize(); |
76 event_factory_ozone_.reset(new TestEventFactory()); | 74 event_factory_ozone_.reset(new TestEventFactory()); |
77 cursor_factory_ozone_.reset(new TestCursorFactory()); | 75 cursor_factory_ozone_.reset(new TestCursorFactory()); |
78 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); | 76 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); |
79 } | 77 } |
80 | 78 |
81 virtual void InitializeGPU() OVERRIDE { | 79 virtual void InitializeGPU() OVERRIDE { |
82 gpu_platform_support_.reset(CreateStubGpuPlatformSupport()); | 80 gpu_platform_support_.reset(CreateStubGpuPlatformSupport()); |
83 } | 81 } |
84 | 82 |
85 private: | 83 private: |
86 scoped_ptr<DeviceManager> device_manager_; | |
87 scoped_ptr<TestWindowManager> window_manager_; | 84 scoped_ptr<TestWindowManager> window_manager_; |
88 scoped_ptr<TestEventFactory> event_factory_ozone_; | 85 scoped_ptr<TestEventFactory> event_factory_ozone_; |
89 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; | 86 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; |
90 scoped_ptr<GpuPlatformSupport> gpu_platform_support_; | 87 scoped_ptr<GpuPlatformSupport> gpu_platform_support_; |
91 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; | 88 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; |
92 base::FilePath file_path_; | 89 base::FilePath file_path_; |
93 | 90 |
94 DISALLOW_COPY_AND_ASSIGN(OzonePlatformTest); | 91 DISALLOW_COPY_AND_ASSIGN(OzonePlatformTest); |
95 }; | 92 }; |
96 | 93 |
97 } // namespace | 94 } // namespace |
98 | 95 |
99 OzonePlatform* CreateOzonePlatformTest() { | 96 OzonePlatform* CreateOzonePlatformTest() { |
100 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 97 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
101 base::FilePath location = base::FilePath("/dev/null"); | 98 base::FilePath location; |
102 if (cmd->HasSwitch(switches::kOzoneDumpFile)) | 99 if (cmd->HasSwitch(switches::kOzoneDumpFile)) |
103 location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); | 100 location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); |
104 return new OzonePlatformTest(location); | 101 return new OzonePlatformTest(location); |
105 } | 102 } |
106 | 103 |
107 } // namespace ui | 104 } // namespace ui |
OLD | NEW |