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_CONTENT_H_ |
| 6 #define ASH_TEST_ASH_TEST_ENVIRONMENT_CONTENT_H_ |
| 7 |
| 8 #include "ash/test/ash_test_environment.h" |
| 9 #include "base/macros.h" |
| 10 |
| 11 namespace content { |
| 12 class TestBrowserThreadBundle; |
| 13 } |
| 14 |
| 15 namespace ash { |
| 16 |
| 17 class ShellContentState; |
| 18 |
| 19 namespace test { |
| 20 |
| 21 class TestShellContentState; |
| 22 |
| 23 // AshTestEnvironment implementation for tests that use content. |
| 24 class AshTestEnvironmentContent : public AshTestEnvironment { |
| 25 public: |
| 26 AshTestEnvironmentContent(); |
| 27 ~AshTestEnvironmentContent() override; |
| 28 |
| 29 TestShellContentState* test_shell_content_state() { |
| 30 return test_shell_content_state_; |
| 31 } |
| 32 void set_content_state(ShellContentState* content_state) { |
| 33 content_state_ = content_state; |
| 34 } |
| 35 |
| 36 // AshTestEnvironment: |
| 37 void SetUp() override; |
| 38 void TearDown() override; |
| 39 base::SequencedWorkerPool* GetBlockingPool() override; |
| 40 std::unique_ptr<views::ViewsDelegate> CreateViewsDelegate() override; |
| 41 |
| 42 private: |
| 43 std::unique_ptr<content::TestBrowserThreadBundle> thread_bundle_; |
| 44 |
| 45 // An implementation of ShellContentState supplied by the user prior to |
| 46 // SetUp(). |
| 47 ShellContentState* content_state_ = nullptr; |
| 48 |
| 49 // If |content_state_| is not set prior to SetUp(), this value will be |
| 50 // set to an instance of TestShellContentState created by this class. If |
| 51 // |content_state_| is non-null, this will be nullptr. |
| 52 TestShellContentState* test_shell_content_state_ = nullptr; |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(AshTestEnvironmentContent); |
| 55 }; |
| 56 |
| 57 } // namespace test |
| 58 } // namespace ash |
| 59 |
| 60 #endif // ASH_TEST_ASH_TEST_ENVIRONMENT_CONTENT_H_ |
OLD | NEW |