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

Unified Diff: ui/ozone/platform/headless/ozone_platform_headless.cc

Issue 1410123003: Rename "test" ozone platform to "headless" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: ui/ozone/platform/headless/ozone_platform_headless.cc
diff --git a/ui/ozone/platform/test/ozone_platform_test.cc b/ui/ozone/platform/headless/ozone_platform_headless.cc
similarity index 70%
copy from ui/ozone/platform/test/ozone_platform_test.cc
copy to ui/ozone/platform/headless/ozone_platform_headless.cc
index ed6938866f41d8de0d856ec5bc21c2fb425dba84..018ba2a2238fe62b917ea5dac12648e99b03ca37 100644
--- a/ui/ozone/platform/test/ozone_platform_test.cc
+++ b/ui/ozone/platform/headless/ozone_platform_headless.cc
@@ -2,7 +2,7 @@
// 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 "ui/ozone/platform/headless/ozone_platform_headless.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
@@ -12,9 +12,9 @@
#include "ui/events/platform/platform_event_source.h"
#include "ui/ozone/common/native_display_delegate_ozone.h"
#include "ui/ozone/common/stub_overlay_manager.h"
-#include "ui/ozone/platform/test/test_surface_factory.h"
-#include "ui/ozone/platform/test/test_window.h"
-#include "ui/ozone/platform/test/test_window_manager.h"
+#include "ui/ozone/platform/headless/headless_surface_factory.h"
+#include "ui/ozone/platform/headless/headless_window.h"
+#include "ui/ozone/platform/headless/headless_window_manager.h"
#include "ui/ozone/public/cursor_factory_ozone.h"
#include "ui/ozone/public/gpu_platform_support.h"
#include "ui/ozone/public/gpu_platform_support_host.h"
@@ -27,24 +27,26 @@ namespace ui {
namespace {
-// A test implementation of PlatformEventSource that we can instantiate to make
-// sure that the PlatformEventSource has an instance while in unit tests.
-class TestPlatformEventSource : public ui::PlatformEventSource {
+// A headless implementation of PlatformEventSource that we can instantiate to
+// make
+// sure that the PlatformEventSource has an instance while in unit headlesss.
Sami 2015/10/26 16:47:07 Unit tests are still unit tests :)
altimin 2015/10/26 17:24:21 My headles-s-s! Done. :)
+class HeadlessPlatformEventSource : public ui::PlatformEventSource {
public:
- TestPlatformEventSource() {}
- ~TestPlatformEventSource() override {}
+ HeadlessPlatformEventSource() {}
+ ~HeadlessPlatformEventSource() override {}
private:
- DISALLOW_COPY_AND_ASSIGN(TestPlatformEventSource);
+ DISALLOW_COPY_AND_ASSIGN(HeadlessPlatformEventSource);
};
-// OzonePlatform for testing
+// OzonePlatform for headlessing
Sami 2015/10/26 16:47:07 Hmm :)
altimin 2015/10/26 17:24:21 Done.
//
-// This platform dumps images to a file for testing purposes.
-class OzonePlatformTest : public OzonePlatform {
+// This platform dumps images to a file for headlessing purposes.
Sami 2015/10/26 16:47:07 Ditto.
altimin 2015/10/26 17:24:21 Done.
+class OzonePlatformHeadless : public OzonePlatform {
public:
- OzonePlatformTest(const base::FilePath& dump_file) : file_path_(dump_file) {}
- ~OzonePlatformTest() override {}
+ OzonePlatformHeadless(const base::FilePath& dump_file)
+ : file_path_(dump_file) {}
+ ~OzonePlatformHeadless() override {}
// OzonePlatform:
ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override {
@@ -72,7 +74,7 @@ class OzonePlatformTest : public OzonePlatform {
PlatformWindowDelegate* delegate,
const gfx::Rect& bounds) override {
return make_scoped_ptr<PlatformWindow>(
- new TestWindow(delegate, window_manager_.get(), bounds));
+ new HeadlessWindow(delegate, window_manager_.get(), bounds));
}
scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override {
return make_scoped_ptr(new NativeDisplayDelegateOzone());
@@ -82,12 +84,12 @@ class OzonePlatformTest : public OzonePlatform {
}
void InitializeUI() override {
- window_manager_.reset(new TestWindowManager(file_path_));
+ window_manager_.reset(new HeadlessWindowManager(file_path_));
window_manager_->Initialize();
- surface_factory_.reset(new TestSurfaceFactory(window_manager_.get()));
- // This unbreaks tests that create their own.
+ surface_factory_.reset(new HeadlessSurfaceFactory(window_manager_.get()));
+ // This unbreaks headlesss that create their own.
Sami 2015/10/26 16:47:07 Ditto.
altimin 2015/10/26 17:24:21 Done.
if (!PlatformEventSource::GetInstance())
- platform_event_source_.reset(new TestPlatformEventSource);
+ platform_event_source_.reset(new HeadlessPlatformEventSource);
KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(
make_scoped_ptr(new StubKeyboardLayoutEngine()));
@@ -99,13 +101,13 @@ class OzonePlatformTest : public OzonePlatform {
void InitializeGPU() override {
if (!surface_factory_)
- surface_factory_.reset(new TestSurfaceFactory());
+ surface_factory_.reset(new HeadlessSurfaceFactory());
gpu_platform_support_.reset(CreateStubGpuPlatformSupport());
}
private:
- scoped_ptr<TestWindowManager> window_manager_;
- scoped_ptr<TestSurfaceFactory> surface_factory_;
+ scoped_ptr<HeadlessWindowManager> window_manager_;
+ scoped_ptr<HeadlessSurfaceFactory> surface_factory_;
scoped_ptr<PlatformEventSource> platform_event_source_;
scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_;
scoped_ptr<InputController> input_controller_;
@@ -114,17 +116,17 @@ class OzonePlatformTest : public OzonePlatform {
scoped_ptr<OverlayManagerOzone> overlay_manager_;
base::FilePath file_path_;
- DISALLOW_COPY_AND_ASSIGN(OzonePlatformTest);
+ DISALLOW_COPY_AND_ASSIGN(OzonePlatformHeadless);
};
} // namespace
-OzonePlatform* CreateOzonePlatformTest() {
+OzonePlatform* CreateOzonePlatformHeadless() {
base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
base::FilePath location;
if (cmd->HasSwitch(switches::kOzoneDumpFile))
location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile);
- return new OzonePlatformTest(location);
+ return new OzonePlatformHeadless(location);
}
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698