| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_TEST_ASH_TEST_ENVIRONMENT_H_ | |
| 6 #define ASH_TEST_ASH_TEST_ENVIRONMENT_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 namespace base { | |
| 11 class SequencedWorkerPool; | |
| 12 } | |
| 13 | |
| 14 namespace views { | |
| 15 class ViewsDelegate; | |
| 16 } | |
| 17 | |
| 18 namespace ash { | |
| 19 namespace test { | |
| 20 | |
| 21 // AshTestEnvironment creates objects specific to an environment. Two | |
| 22 // environments are provided, one for content (AshTestEnvironmentContent) | |
| 23 // and one without content (AshTestEnvironmentDefault). | |
| 24 // | |
| 25 // AshTestBase creates an AshTestEnvironment by way of | |
| 26 // AshTestEnvironment::Create(). The implementation of Create() depends upon | |
| 27 // the ash target that was linked against: //ash:test_support_with_content | |
| 28 // includes AshTestEnvironmentContent and //ash:test_support_without_content | |
| 29 // includes AshTestEnvironmentDefault. | |
| 30 class AshTestEnvironment { | |
| 31 public: | |
| 32 virtual ~AshTestEnvironment() {} | |
| 33 | |
| 34 // Creates the object appropriate to the current environment. | |
| 35 static std::unique_ptr<AshTestEnvironment> Create(); | |
| 36 | |
| 37 // Called from AshTestHelper::SetUp()/TearDown(). | |
| 38 virtual void SetUp() {} | |
| 39 virtual void TearDown() {} | |
| 40 | |
| 41 virtual base::SequencedWorkerPool* GetBlockingPool() = 0; | |
| 42 | |
| 43 virtual std::unique_ptr<views::ViewsDelegate> CreateViewsDelegate() = 0; | |
| 44 | |
| 45 protected: | |
| 46 AshTestEnvironment() {} | |
| 47 }; | |
| 48 | |
| 49 } // namespace test | |
| 50 } // namespace ash | |
| 51 | |
| 52 #endif // ASH_TEST_ASH_TEST_ENVIRONMENT_H_ | |
| OLD | NEW |