| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/exo/test/exo_test_base.h" | 5 #include "components/exo/test/exo_test_base.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/ptr_util.h" |
| 8 #include "components/exo/test/exo_test_helper.h" | 9 #include "components/exo/test/exo_test_helper.h" |
| 10 #include "components/exo/wm_helper_ash.h" |
| 9 #include "ui/wm/core/wm_core_switches.h" | 11 #include "ui/wm/core/wm_core_switches.h" |
| 10 | 12 |
| 11 namespace exo { | 13 namespace exo { |
| 12 namespace test { | 14 namespace test { |
| 13 | 15 |
| 14 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
| 15 // ExoTestBase, public: | 17 // ExoTestBase, public: |
| 16 | 18 |
| 17 ExoTestBase::ExoTestBase() : exo_test_helper_(new ExoTestHelper) {} | 19 ExoTestBase::ExoTestBase() : exo_test_helper_(new ExoTestHelper) {} |
| 18 | 20 |
| 19 ExoTestBase::~ExoTestBase() {} | 21 ExoTestBase::~ExoTestBase() {} |
| 20 | 22 |
| 21 void ExoTestBase::SetUp() { | 23 void ExoTestBase::SetUp() { |
| 22 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 24 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 23 // Disable window animation when running tests. | 25 // Disable window animation when running tests. |
| 24 command_line->AppendSwitch(wm::switches::kWindowAnimationsDisabled); | 26 command_line->AppendSwitch(wm::switches::kWindowAnimationsDisabled); |
| 25 AshTestBase::SetUp(); | 27 AshTestBase::SetUp(); |
| 28 wm_helper_ = base::MakeUnique<WMHelperAsh>(); |
| 29 WMHelper::SetInstance(wm_helper_.get()); |
| 26 } | 30 } |
| 27 | 31 |
| 28 void ExoTestBase::TearDown() { | 32 void ExoTestBase::TearDown() { |
| 33 WMHelper::SetInstance(nullptr); |
| 34 wm_helper_.reset(); |
| 29 AshTestBase::TearDown(); | 35 AshTestBase::TearDown(); |
| 30 } | 36 } |
| 31 | 37 |
| 32 } // namespace test | 38 } // namespace test |
| 33 } // namespace exo | 39 } // namespace exo |
| OLD | NEW |