Chromium Code Reviews| 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()); |
| 75 if (file_path_.empty()) | |
|
alexst (slow to review)
2014/07/31 02:27:24
Is there a particular reason you chose to skip the
dnicoara
2014/07/31 02:51:31
From personal experience, the following factories
varkha
2014/08/07 00:17:10
Acknowledged.
varkha
2014/08/07 00:17:10
Done.
| |
| 76 return; | |
| 77 cursor_factory_ozone_.reset(new TestCursorFactory()); | 77 cursor_factory_ozone_.reset(new TestCursorFactory()); |
| 78 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); | 78 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); |
| 79 } | 79 } |
| 80 | 80 |
| 81 virtual void InitializeGPU() OVERRIDE { | 81 virtual void InitializeGPU() OVERRIDE { |
| 82 if (file_path_.empty()) | |
| 83 return; | |
| 82 gpu_platform_support_.reset(CreateStubGpuPlatformSupport()); | 84 gpu_platform_support_.reset(CreateStubGpuPlatformSupport()); |
| 83 } | 85 } |
| 84 | 86 |
| 85 private: | 87 private: |
| 86 scoped_ptr<DeviceManager> device_manager_; | |
| 87 scoped_ptr<TestWindowManager> window_manager_; | 88 scoped_ptr<TestWindowManager> window_manager_; |
| 88 scoped_ptr<TestEventFactory> event_factory_ozone_; | 89 scoped_ptr<TestEventFactory> event_factory_ozone_; |
| 89 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; | 90 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; |
| 90 scoped_ptr<GpuPlatformSupport> gpu_platform_support_; | 91 scoped_ptr<GpuPlatformSupport> gpu_platform_support_; |
| 91 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; | 92 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; |
| 92 base::FilePath file_path_; | 93 base::FilePath file_path_; |
| 93 | 94 |
| 94 DISALLOW_COPY_AND_ASSIGN(OzonePlatformTest); | 95 DISALLOW_COPY_AND_ASSIGN(OzonePlatformTest); |
| 95 }; | 96 }; |
| 96 | 97 |
| 97 } // namespace | 98 } // namespace |
| 98 | 99 |
| 99 OzonePlatform* CreateOzonePlatformTest() { | 100 OzonePlatform* CreateOzonePlatformTest() { |
| 100 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 101 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 101 base::FilePath location = base::FilePath("/dev/null"); | 102 base::FilePath location; |
| 102 if (cmd->HasSwitch(switches::kOzoneDumpFile)) | 103 if (cmd->HasSwitch(switches::kOzoneDumpFile)) |
| 103 location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); | 104 location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); |
| 104 return new OzonePlatformTest(location); | 105 return new OzonePlatformTest(location); |
| 105 } | 106 } |
| 106 | 107 |
| 107 } // namespace ui | 108 } // namespace ui |
| OLD | NEW |