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

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

Issue 443553003: MacViews: Split ViewEventTestBase into platform-specific files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/chrome_views_test_helper_ash.cc
diff --git a/chrome/test/base/chrome_views_test_helper_ash.cc b/chrome/test/base/chrome_views_test_helper_ash.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a65a924e851140f79d452a7cae950cb61470f734
--- /dev/null
+++ b/chrome/test/base/chrome_views_test_helper_ash.cc
@@ -0,0 +1,51 @@
+// 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/chrome_views_test_helper.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 ChromeViewsTestHelperAsh : public ChromeViewsTestHelper {
+ public:
+ ChromeViewsTestHelperAsh() {}
+
+ // Overridden from ChromeViewsTestHelper:
+ virtual gfx::NativeWindow PlatformSetUp(
+ ui::ContextFactory* context_factory) OVERRIDE;
+ virtual void PlatformTearDown() OVERRIDE;
+
+ private:
+ wm::WMState wm_state_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeViewsTestHelperAsh);
+};
+
+gfx::NativeWindow ChromeViewsTestHelperAsh::PlatformSetUp(
+ 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);
+ return NULL; // No context, so that desktop tree hosts are used by default.
+}
+
+void ChromeViewsTestHelperAsh::PlatformTearDown() {
+ aura::Env::DeleteInstance();
+}
+
+} // namespace
+
+// static
+ChromeViewsTestHelper* ChromeViewsTestHelper::Create() {
+ return new ChromeViewsTestHelperAsh();
+}

Powered by Google App Engine
This is Rietveld 408576698