| 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/ozone/ozone_platform.h" | 9 #include "ui/ozone/ozone_platform.h" |
| 10 #include "ui/ozone/ozone_switches.h" | 10 #include "ui/ozone/ozone_switches.h" |
| 11 | 11 |
| 12 #if defined(OS_CHROMEOS) |
| 13 #include "ui/ozone/common/chromeos/native_display_delegate_ozone.h" |
| 14 #endif |
| 15 |
| 12 namespace ui { | 16 namespace ui { |
| 13 | 17 |
| 14 OzonePlatformTest::OzonePlatformTest(const base::FilePath& dump_file) | 18 OzonePlatformTest::OzonePlatformTest(const base::FilePath& dump_file) |
| 15 : surface_factory_ozone_(dump_file) {} | 19 : surface_factory_ozone_(dump_file) {} |
| 16 | 20 |
| 17 OzonePlatformTest::~OzonePlatformTest() {} | 21 OzonePlatformTest::~OzonePlatformTest() {} |
| 18 | 22 |
| 19 gfx::SurfaceFactoryOzone* OzonePlatformTest::GetSurfaceFactoryOzone() { | 23 gfx::SurfaceFactoryOzone* OzonePlatformTest::GetSurfaceFactoryOzone() { |
| 20 return &surface_factory_ozone_; | 24 return &surface_factory_ozone_; |
| 21 } | 25 } |
| 22 | 26 |
| 23 ui::EventFactoryOzone* OzonePlatformTest::GetEventFactoryOzone() { | 27 ui::EventFactoryOzone* OzonePlatformTest::GetEventFactoryOzone() { |
| 24 return &event_factory_ozone_; | 28 return &event_factory_ozone_; |
| 25 } | 29 } |
| 26 | 30 |
| 27 ui::InputMethodContextFactoryOzone* | 31 ui::InputMethodContextFactoryOzone* |
| 28 OzonePlatformTest::GetInputMethodContextFactoryOzone() { | 32 OzonePlatformTest::GetInputMethodContextFactoryOzone() { |
| 29 return &input_method_context_factory_ozone_; | 33 return &input_method_context_factory_ozone_; |
| 30 } | 34 } |
| 31 | 35 |
| 32 ui::CursorFactoryOzone* OzonePlatformTest::GetCursorFactoryOzone() { | 36 ui::CursorFactoryOzone* OzonePlatformTest::GetCursorFactoryOzone() { |
| 33 return &cursor_factory_ozone_; | 37 return &cursor_factory_ozone_; |
| 34 } | 38 } |
| 35 | 39 |
| 40 ui::NativeDisplayDelegate* OzonePlatformTest::CreateNativeDisplayDelegate() { |
| 41 #if defined(OS_CHROMEOS) |
| 42 return new NativeDisplayDelegateOzone(); |
| 43 #else |
| 44 return NULL; |
| 45 #endif |
| 46 } |
| 47 |
| 36 OzonePlatform* CreateOzonePlatformTest() { | 48 OzonePlatform* CreateOzonePlatformTest() { |
| 37 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 49 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 38 base::FilePath location = base::FilePath("/dev/null"); | 50 base::FilePath location = base::FilePath("/dev/null"); |
| 39 if (cmd->HasSwitch(switches::kOzoneDumpFile)) | 51 if (cmd->HasSwitch(switches::kOzoneDumpFile)) |
| 40 location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); | 52 location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); |
| 41 return new OzonePlatformTest(location); | 53 return new OzonePlatformTest(location); |
| 42 } | 54 } |
| 43 | 55 |
| 44 } // namespace ui | 56 } // namespace ui |
| OLD | NEW |