Chromium Code Reviews| Index: chrome/test/base/chrome_views_test_helper_aura.cc |
| diff --git a/chrome/test/base/chrome_views_test_helper_aura.cc b/chrome/test/base/chrome_views_test_helper_aura.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..004985c9207e5f667644bbb502aa1e495f401cab |
| --- /dev/null |
| +++ b/chrome/test/base/chrome_views_test_helper_aura.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/test/aura_test_helper.h" |
| +#include "ui/wm/core/default_activation_client.h" |
| +#include "ui/wm/core/wm_state.h" |
| + |
| +namespace { |
| + |
| +// ChromeViewsTestHelper implementation for non-Ash Aura environments. |
| +// (use_ash=0, use_aura=1). |
| +class ChromeViewsTestHelperAura : public ChromeViewsTestHelper { |
|
tapted
2014/08/05 14:00:26
This is the black sheep of the family.. I don't th
sky
2014/08/06 17:37:44
Maybe check the ozone build? If that doesn't use i
tapted
2014/08/11 12:04:17
Nuked. I think the ozone bot we most care about (l
|
| + public: |
| + ChromeViewsTestHelperAura() {} |
| + |
| + // Overridden from ChromeViewsTestHelper: |
| + virtual gfx::NativeWindow PlatformSetUp( |
| + ui::ContextFactory* context_factory) OVERRIDE; |
| + virtual void PlatformTearDown() OVERRIDE; |
| + |
| + private: |
| + scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; |
| + wm::WMState wm_state_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ChromeViewsTestHelperAura); |
| +}; |
| + |
| +gfx::NativeWindow ChromeViewsTestHelperAura::PlatformSetUp( |
| + ui::ContextFactory* context_factory) { |
| + // Instead of using the ash shell, use an AuraTestHelper to create and manage |
| + // the test screen. |
| + aura_test_helper_.reset( |
| + new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); |
| + aura_test_helper_->SetUp(context_factory); |
| + new wm::DefaultActivationClient(aura_test_helper_->root_window()); |
| + return aura_test_helper_->root_window(); |
| +} |
| + |
| +void ChromeViewsTestHelperAura::PlatformTearDown() { |
| + aura_test_helper_->TearDown(); |
| +} |
| + |
| +} // namespace |
| + |
| +// static |
| +ChromeViewsTestHelper* ChromeViewsTestHelper::Create() { |
| + return new ChromeViewsTestHelperAura(); |
| +} |