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/file_descriptor_posix.h" |
8 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
9 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" | 10 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" |
10 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" | 11 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" |
11 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h" | 12 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h" |
12 #include "ui/events/platform/platform_event_source.h" | 13 #include "ui/events/platform/platform_event_source.h" |
13 #include "ui/ozone/common/native_display_delegate_ozone.h" | 14 #include "ui/ozone/common/native_display_delegate_ozone.h" |
14 #include "ui/ozone/common/stub_overlay_manager.h" | 15 #include "ui/ozone/common/stub_overlay_manager.h" |
15 #include "ui/ozone/platform/test/test_window.h" | 16 #include "ui/ozone/platform/test/test_window.h" |
16 #include "ui/ozone/platform/test/test_window_manager.h" | 17 #include "ui/ozone/platform/test/test_window_manager.h" |
17 #include "ui/ozone/public/cursor_factory_ozone.h" | 18 #include "ui/ozone/public/cursor_factory_ozone.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 70 } |
70 scoped_ptr<PlatformWindow> CreatePlatformWindow( | 71 scoped_ptr<PlatformWindow> CreatePlatformWindow( |
71 PlatformWindowDelegate* delegate, | 72 PlatformWindowDelegate* delegate, |
72 const gfx::Rect& bounds) override { | 73 const gfx::Rect& bounds) override { |
73 return make_scoped_ptr<PlatformWindow>( | 74 return make_scoped_ptr<PlatformWindow>( |
74 new TestWindow(delegate, window_manager_.get(), bounds)); | 75 new TestWindow(delegate, window_manager_.get(), bounds)); |
75 } | 76 } |
76 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { | 77 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { |
77 return make_scoped_ptr(new NativeDisplayDelegateOzone()); | 78 return make_scoped_ptr(new NativeDisplayDelegateOzone()); |
78 } | 79 } |
| 80 base::FileDescriptor GetVirtualDeviceFd() override { |
| 81 return base::FileDescriptor(); |
| 82 } |
79 | 83 |
80 void InitializeUI() override { | 84 void InitializeUI() override { |
81 window_manager_.reset(new TestWindowManager(file_path_)); | 85 window_manager_.reset(new TestWindowManager(file_path_)); |
82 window_manager_->Initialize(); | 86 window_manager_->Initialize(); |
83 // This unbreaks tests that create their own. | 87 // This unbreaks tests that create their own. |
84 if (!PlatformEventSource::GetInstance()) | 88 if (!PlatformEventSource::GetInstance()) |
85 platform_event_source_.reset(new TestPlatformEventSource); | 89 platform_event_source_.reset(new TestPlatformEventSource); |
86 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( | 90 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( |
87 make_scoped_ptr(new StubKeyboardLayoutEngine())); | 91 make_scoped_ptr(new StubKeyboardLayoutEngine())); |
88 | 92 |
(...skipping 24 matching lines...) Expand all Loading... |
113 | 117 |
114 OzonePlatform* CreateOzonePlatformTest() { | 118 OzonePlatform* CreateOzonePlatformTest() { |
115 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 119 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
116 base::FilePath location; | 120 base::FilePath location; |
117 if (cmd->HasSwitch(switches::kOzoneDumpFile)) | 121 if (cmd->HasSwitch(switches::kOzoneDumpFile)) |
118 location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); | 122 location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); |
119 return new OzonePlatformTest(location); | 123 return new OzonePlatformTest(location); |
120 } | 124 } |
121 | 125 |
122 } // namespace ui | 126 } // namespace ui |
OLD | NEW |