Index: ash/test/ash_test_environment_content.h |
diff --git a/ash/test/ash_test_environment_content.h b/ash/test/ash_test_environment_content.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..eb6596fbca1bc2aae977c16146a1856423da5415 |
--- /dev/null |
+++ b/ash/test/ash_test_environment_content.h |
@@ -0,0 +1,60 @@ |
+// Copyright 2016 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. |
+ |
+#ifndef ASH_TEST_ASH_TEST_ENVIRONMENT_CONTENT_H_ |
+#define ASH_TEST_ASH_TEST_ENVIRONMENT_CONTENT_H_ |
+ |
+#include "ash/test/ash_test_environment.h" |
+#include "base/macros.h" |
+ |
+namespace content { |
+class TestBrowserThreadBundle; |
+} |
+ |
+namespace ash { |
+ |
+class ShellContentState; |
+ |
+namespace test { |
+ |
+class TestShellContentState; |
+ |
+// AshTestEnvironment implementation for tests that use content. |
+class AshTestEnvironmentContent : public AshTestEnvironment { |
+ public: |
+ AshTestEnvironmentContent(); |
+ ~AshTestEnvironmentContent() override; |
+ |
+ TestShellContentState* test_shell_content_state() { |
+ return test_shell_content_state_; |
+ } |
+ void set_content_state(ShellContentState* content_state) { |
+ content_state_ = content_state; |
+ } |
+ |
+ // AshTestEnvironment: |
+ void SetUp() override; |
+ void TearDown() override; |
+ base::SequencedWorkerPool* GetBlockingPool() override; |
+ std::unique_ptr<views::ViewsDelegate> CreateViewsDelegate() override; |
+ |
+ private: |
+ std::unique_ptr<content::TestBrowserThreadBundle> thread_bundle_; |
+ |
+ // An implementation of ShellContentState supplied by the user prior to |
+ // SetUp(). |
+ ShellContentState* content_state_ = nullptr; |
+ |
+ // If |content_state_| is not set prior to SetUp(), this value will be |
+ // set to an instance of TestShellContentState created by this class. If |
+ // |content_state_| is non-null, this will be nullptr. |
+ TestShellContentState* test_shell_content_state_ = nullptr; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(AshTestEnvironmentContent); |
+}; |
+ |
+} // namespace test |
+} // namespace ash |
+ |
+#endif // ASH_TEST_ASH_TEST_ENVIRONMENT_CONTENT_H_ |