Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1531)

Unified Diff: ash/test/ash_test_environment.h

Issue 2296973002: Moves ash content specific tests into ash_content_unittests (Closed)
Patch Set: add dep to base test suport Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/test/ash_test_base.cc ('k') | ash/test/ash_test_environment_content.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/ash_test_environment.h
diff --git a/ash/test/ash_test_environment.h b/ash/test/ash_test_environment.h
new file mode 100644
index 0000000000000000000000000000000000000000..a763936066dc2f60d89538fcafb8addad5cfa057
--- /dev/null
+++ b/ash/test/ash_test_environment.h
@@ -0,0 +1,52 @@
+// 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_H_
+#define ASH_TEST_ASH_TEST_ENVIRONMENT_H_
+
+#include <memory>
+
+namespace base {
+class SequencedWorkerPool;
+}
+
+namespace views {
+class ViewsDelegate;
+}
+
+namespace ash {
+namespace test {
+
+// AshTestEnvironment creates objects specific to an environment. Two
+// environments are provided, one for content (AshTestEnvironmentContent)
+// and one without content (AshTestEnvironmentDefault).
+//
+// AshTestBase creates an AshTestEnvironment by way of
+// AshTestEnvironment::Create(). The implementation of Create() depends upon
+// the ash target that was linked against: //ash:test_support_with_content
+// includes AshTestEnvironmentContent and //ash:test_support_without_content
+// includes AshTestEnvironmentDefault.
+class AshTestEnvironment {
+ public:
+ virtual ~AshTestEnvironment() {}
+
+ // Creates the object appropriate to the current environment.
+ static std::unique_ptr<AshTestEnvironment> Create();
+
+ // Called from AshTestHelper::SetUp()/TearDown().
+ virtual void SetUp() {}
+ virtual void TearDown() {}
+
+ virtual base::SequencedWorkerPool* GetBlockingPool() = 0;
+
+ virtual std::unique_ptr<views::ViewsDelegate> CreateViewsDelegate() = 0;
+
+ protected:
+ AshTestEnvironment() {}
+};
+
+} // namespace test
+} // namespace ash
+
+#endif // ASH_TEST_ASH_TEST_ENVIRONMENT_H_
« no previous file with comments | « ash/test/ash_test_base.cc ('k') | ash/test/ash_test_environment_content.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698