| 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/base/cursor/ozone/bitmap_cursor_factory_ozone.h" | 9 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" |
| 10 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" | 10 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 scoped_ptr<SystemInputInjector> CreateSystemInputInjector() override { | 52 scoped_ptr<SystemInputInjector> CreateSystemInputInjector() override { |
| 53 return nullptr; // no input injection support. | 53 return nullptr; // no input injection support. |
| 54 } | 54 } |
| 55 scoped_ptr<PlatformWindow> CreatePlatformWindow( | 55 scoped_ptr<PlatformWindow> CreatePlatformWindow( |
| 56 PlatformWindowDelegate* delegate, | 56 PlatformWindowDelegate* delegate, |
| 57 const gfx::Rect& bounds) override { | 57 const gfx::Rect& bounds) override { |
| 58 return make_scoped_ptr<PlatformWindow>( | 58 return make_scoped_ptr<PlatformWindow>( |
| 59 new TestWindow(delegate, window_manager_.get(), bounds)); | 59 new TestWindow(delegate, window_manager_.get(), bounds)); |
| 60 } | 60 } |
| 61 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { | 61 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { |
| 62 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone()); | 62 return make_scoped_ptr(new NativeDisplayDelegateOzone()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void InitializeUI() override { | 65 void InitializeUI() override { |
| 66 window_manager_.reset(new TestWindowManager(file_path_)); | 66 window_manager_.reset(new TestWindowManager(file_path_)); |
| 67 window_manager_->Initialize(); | 67 window_manager_->Initialize(); |
| 68 // This unbreaks tests that create their own. | 68 // This unbreaks tests that create their own. |
| 69 if (!PlatformEventSource::GetInstance()) | 69 if (!PlatformEventSource::GetInstance()) |
| 70 platform_event_source_ = PlatformEventSource::CreateDefault(); | 70 platform_event_source_ = PlatformEventSource::CreateDefault(); |
| 71 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( | 71 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( |
| 72 make_scoped_ptr(new StubKeyboardLayoutEngine())); | 72 make_scoped_ptr(new StubKeyboardLayoutEngine())); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 96 | 96 |
| 97 OzonePlatform* CreateOzonePlatformTest() { | 97 OzonePlatform* CreateOzonePlatformTest() { |
| 98 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 98 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
| 99 base::FilePath location; | 99 base::FilePath location; |
| 100 if (cmd->HasSwitch(switches::kOzoneDumpFile)) | 100 if (cmd->HasSwitch(switches::kOzoneDumpFile)) |
| 101 location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); | 101 location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); |
| 102 return new OzonePlatformTest(location); | 102 return new OzonePlatformTest(location); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace ui | 105 } // namespace ui |
| OLD | NEW |