summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2014-03-21 17:00:06 +0100
committerZeno Albisser <zeno.albisser@digia.com>2014-03-22 11:41:50 +0100
commit6eb5ee5b462ab3962f16c0b250551d0a9e88d23d (patch)
tree1f4db2a8e98d901c5ffeffe2ad8c307464d7c7a9
parent3f0f86b0caed75241fa71c95a5d73bc0164348c5 (diff)
downloadqtwebengine-chromium-6eb5ee5b462ab3962f16c0b250551d0a9e88d23d.tar.gz
Add missing files for ozone
These files are needed by the ozone.gyp file and were excluded from the snapshot. Change-Id: I91a8e9ca88b9aa7ce307d434300de8bcf88fe3c4 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
-rw-r--r--chromium/ui/ozone/platform/test/ozone_platform_test.cc35
-rw-r--r--chromium/ui/ozone/platform/test/ozone_platform_test.h38
2 files changed, 73 insertions, 0 deletions
diff --git a/chromium/ui/ozone/platform/test/ozone_platform_test.cc b/chromium/ui/ozone/platform/test/ozone_platform_test.cc
new file mode 100644
index 00000000000..860837e998a
--- /dev/null
+++ b/chromium/ui/ozone/platform/test/ozone_platform_test.cc
@@ -0,0 +1,35 @@
+// Copyright 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* CreateOzonePlatformTest() {
+ 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
diff --git a/chromium/ui/ozone/platform/test/ozone_platform_test.h b/chromium/ui/ozone/platform/test/ozone_platform_test.h
new file mode 100644
index 00000000000..bb199a3be67
--- /dev/null
+++ b/chromium/ui/ozone/platform/test/ozone_platform_test.h
@@ -0,0 +1,38 @@
+// Copyright 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.
+
+#ifndef UI_OZONE_PLATFORM_TEST_OZONE_PLATFORM_TEST_H_
+#define UI_OZONE_PLATFORM_TEST_OZONE_PLATFORM_TEST_H_
+
+#include "base/files/file_path.h"
+#include "ui/events/ozone/evdev/event_factory.h"
+#include "ui/gfx/ozone/impl/file_surface_factory.h"
+#include "ui/ozone/ozone_platform.h"
+
+namespace ui {
+
+// OzonePlatform for testing
+//
+// This platform dumps images to a file for testing purposes.
+class OzonePlatformTest : public OzonePlatform {
+ public:
+ OzonePlatformTest(const base::FilePath& dump_file);
+ virtual ~OzonePlatformTest();
+
+ virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE;
+ virtual ui::EventFactoryOzone* GetEventFactoryOzone() OVERRIDE;
+
+ private:
+ gfx::FileSurfaceFactory surface_factory_ozone_;
+ ui::EventFactoryEvdev event_factory_ozone_;
+
+ DISALLOW_COPY_AND_ASSIGN(OzonePlatformTest);
+};
+
+// Constructor hook for use in ozone_platform_list.cc
+OzonePlatform* CreateOzonePlatformTest();
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_TEST_OZONE_PLATFORM_TEST_H_