6428c79286e1676b4717c7ae69a293d54685b518
[platform/framework/web/crosswalk.git] / src / ui / ozone / platform / test / ozone_platform_test.cc
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
3 // found in the LICENSE file.
4
5 #include "ui/ozone/platform/test/ozone_platform_test.h"
6
7 #include "base/command_line.h"
8 #include "base/files/file_path.h"
9 #include "ui/ozone/ozone_platform.h"
10 #include "ui/ozone/ozone_switches.h"
11
12 namespace ui {
13
14 OzonePlatformTest::OzonePlatformTest(const base::FilePath& dump_file)
15     : surface_factory_ozone_(dump_file) {}
16
17 OzonePlatformTest::~OzonePlatformTest() {}
18
19 gfx::SurfaceFactoryOzone* OzonePlatformTest::GetSurfaceFactoryOzone() {
20   return &surface_factory_ozone_;
21 }
22
23 ui::EventFactoryOzone* OzonePlatformTest::GetEventFactoryOzone() {
24   return &event_factory_ozone_;
25 }
26
27 ui::InputMethodContextFactoryOzone*
28 OzonePlatformTest::GetInputMethodContextFactoryOzone() {
29   return &input_method_context_factory_ozone_;
30 }
31
32 ui::CursorFactoryOzone* OzonePlatformTest::GetCursorFactoryOzone() {
33   return &cursor_factory_ozone_;
34 }
35
36 OzonePlatform* CreateOzonePlatformTest() {
37   CommandLine* cmd = CommandLine::ForCurrentProcess();
38   base::FilePath location = base::FilePath("/dev/null");
39   if (cmd->HasSwitch(switches::kOzoneDumpFile))
40     location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile);
41   return new OzonePlatformTest(location);
42 }
43
44 }  // namespace ui