Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: ui/ozone/platform/test/ozone_platform_test.cc

Issue 44933002: Implement OzonePlatform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/test/ozone_platform_test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/test/ozone_platform_test.cc
diff --git a/ui/ozone/platform/test/ozone_platform_test.cc b/ui/ozone/platform/test/ozone_platform_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cff0130fae66f5ac1862ee02843f3f3eb6fff8f0
--- /dev/null
+++ b/ui/ozone/platform/test/ozone_platform_test.cc
@@ -0,0 +1,35 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/test/ozone_platform_test.h"
+
+#include "base/command_line.h"
+#include "base/files/file_path.h"
+#include "ui/ozone/ozone_platform.h"
+#include "ui/ozone/ozone_switches.h"
+
+namespace ui {
+
+OzonePlatformTest::OzonePlatformTest(const base::FilePath& dump_file)
+ : surface_factory_ozone_(dump_file) {}
+
+OzonePlatformTest::~OzonePlatformTest() {}
+
+gfx::SurfaceFactoryOzone* OzonePlatformTest::GetSurfaceFactoryOzone() {
+ return &surface_factory_ozone_;
+}
+
+ui::EventFactoryOzone* OzonePlatformTest::GetEventFactoryOzone() {
+ return &event_factory_ozone_;
+}
+
+OzonePlatform* CreateDefaultOzonePlatform() {
+ CommandLine* cmd = CommandLine::ForCurrentProcess();
+ base::FilePath location = base::FilePath("/dev/null");
+ if (cmd->HasSwitch(switches::kOzoneDumpFile))
+ location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile);
+ return new OzonePlatformTest(location);
+}
+
+} // namespace ui
« no previous file with comments | « ui/ozone/platform/test/ozone_platform_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698