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

Unified Diff: chrome/test/base/view_event_test_platform_part_ash.cc

Issue 443553003: MacViews: Split ViewEventTestBase into platform-specific files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: self-review: fix class comment, remove dead gyp cruft Created 6 years, 4 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: chrome/test/base/view_event_test_platform_part_ash.cc
diff --git a/chrome/test/base/view_event_test_platform_part_ash.cc b/chrome/test/base/view_event_test_platform_part_ash.cc
new file mode 100644
index 0000000000000000000000000000000000000000..51ed1c42ca9cbd6b156cecc8f1f24ac0deca91ef
--- /dev/null
+++ b/chrome/test/base/view_event_test_platform_part_ash.cc
@@ -0,0 +1,52 @@
+// Copyright 2014 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 "chrome/test/base/view_event_test_platform_part.h"
+
+#include "ui/aura/env.h"
+#include "ui/gfx/screen.h"
+#include "ui/views/widget/desktop_aura/desktop_screen.h"
+#include "ui/wm/core/wm_state.h"
+
+namespace {
+
+// ChromeViewsTestHelper implementation for non-ChromeOS environments, where the
+// Ash desktop environment is available (use_ash=1, chromeos=0).
+class ViewEventTestPlatformPartAsh : public ViewEventTestPlatformPart {
+ public:
+ explicit ViewEventTestPlatformPartAsh(ui::ContextFactory* context_factory);
+ virtual ~ViewEventTestPlatformPartAsh();
+
+ // Overridden from ViewEventTestPlatformPart:
+ virtual gfx::NativeWindow GetContext() OVERRIDE {
+ return NULL; // No context, so that desktop tree hosts are used by default.
+ }
+
+ private:
+ wm::WMState wm_state_;
+
+ DISALLOW_COPY_AND_ASSIGN(ViewEventTestPlatformPartAsh);
+};
+
+ViewEventTestPlatformPartAsh::ViewEventTestPlatformPartAsh(
+ ui::ContextFactory* context_factory) {
+ // http://crbug.com/154081 use ash::Shell code path below on win_ash bots when
+ // interactive_ui_tests is brought up on that platform.
+ gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE,
+ views::CreateDesktopScreen());
+ aura::Env::CreateInstance(true);
+ aura::Env::GetInstance()->set_context_factory(context_factory);
+}
+
+ViewEventTestPlatformPartAsh::~ViewEventTestPlatformPartAsh() {
+ aura::Env::DeleteInstance();
+}
+
+} // namespace
+
+// static
+ViewEventTestPlatformPart* ViewEventTestPlatformPart::Create(
+ ui::ContextFactory* context_factory) {
+ return new ViewEventTestPlatformPartAsh(context_factory);
+}
« no previous file with comments | « chrome/test/base/view_event_test_platform_part.h ('k') | chrome/test/base/view_event_test_platform_part_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698