| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef UI_AURA_TEST_AURA_MUS_TEST_BASE_H_ | 5 #ifndef UI_AURA_TEST_AURA_MUS_TEST_BASE_H_ |
| 6 #define UI_AURA_TEST_AURA_MUS_TEST_BASE_H_ | 6 #define UI_AURA_TEST_AURA_MUS_TEST_BASE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/aura/test/aura_test_base.h" | 9 #include "ui/aura/test/aura_test_base.h" |
| 10 #include "ui/compositor/test/fake_context_factory.h" |
| 10 | 11 |
| 11 namespace aura { | 12 namespace aura { |
| 12 namespace test { | 13 namespace test { |
| 13 | 14 |
| 14 // A base class for aura unit tests that use mus. You can also use AuraTestBase | 15 // A base class for aura unit tests that use mus. You can also use AuraTestBase |
| 15 // directly and call EnableMusWithTestWindowTree() before SetUp(). Prefer this | 16 // directly and call EnableMusWithTestWindowTree() before SetUp(). Prefer this |
| 16 // if you don't need to subclass and want to target mus. | 17 // if you don't need to subclass and want to target mus. |
| 17 // | 18 // |
| 18 // This test class sets up the connection to mus as the window manager. | 19 // This test class sets up the connection to mus as the window manager. |
| 19 class AuraMusWmTestBase : public AuraTestBase { | 20 class AuraMusWmTestBase : public AuraTestBase { |
| 20 public: | 21 public: |
| 21 AuraMusWmTestBase(); | 22 AuraMusWmTestBase(); |
| 22 ~AuraMusWmTestBase() override; | 23 ~AuraMusWmTestBase() override; |
| 23 | 24 |
| 24 // AuraTestBase: | 25 // AuraTestBase: |
| 25 void SetUp() override; | 26 void SetUp() override; |
| 27 void TearDown() override; |
| 26 | 28 |
| 27 private: | 29 private: |
| 30 ui::FakeContextFactory context_factory_; |
| 31 ui::ContextFactory* context_factory_to_restore_ = nullptr; |
| 32 |
| 28 DISALLOW_COPY_AND_ASSIGN(AuraMusWmTestBase); | 33 DISALLOW_COPY_AND_ASSIGN(AuraMusWmTestBase); |
| 29 }; | 34 }; |
| 30 | 35 |
| 31 // A base class for aura unit tests that use mus. You can also use AuraTestBase | 36 // A base class for aura unit tests that use mus. You can also use AuraTestBase |
| 32 // directly and call EnableMusWithTestWindowTree() before SetUp(). Prefer this | 37 // directly and call EnableMusWithTestWindowTree() before SetUp(). Prefer this |
| 33 // if you don't need to subclass and want to target mus. | 38 // if you don't need to subclass and want to target mus. |
| 34 // | 39 // |
| 35 // This test class sets up the connection to mus as a normal client (not the | 40 // This test class sets up the connection to mus as a normal client (not the |
| 36 // window manager). | 41 // window manager). |
| 37 class AuraMusClientTestBase : public AuraTestBase { | 42 class AuraMusClientTestBase : public AuraTestBase { |
| 38 public: | 43 public: |
| 39 AuraMusClientTestBase(); | 44 AuraMusClientTestBase(); |
| 40 ~AuraMusClientTestBase() override; | 45 ~AuraMusClientTestBase() override; |
| 41 | 46 |
| 42 // AuraTestBase: | 47 // AuraTestBase: |
| 43 void SetUp() override; | 48 void SetUp() override; |
| 49 void TearDown() override; |
| 44 | 50 |
| 45 private: | 51 private: |
| 52 ui::FakeContextFactory context_factory_; |
| 53 ui::ContextFactory* context_factory_to_restore_ = nullptr; |
| 54 |
| 46 DISALLOW_COPY_AND_ASSIGN(AuraMusClientTestBase); | 55 DISALLOW_COPY_AND_ASSIGN(AuraMusClientTestBase); |
| 47 }; | 56 }; |
| 48 | 57 |
| 49 } // namespace test | 58 } // namespace test |
| 50 } // namespace aura | 59 } // namespace aura |
| 51 | 60 |
| 52 #endif // UI_AURA_TEST_AURA_MUS_TEST_BASE_H_ | 61 #endif // UI_AURA_TEST_AURA_MUS_TEST_BASE_H_ |
| OLD | NEW |