Index: chrome/browser/chromeos/login/mixin_in_process_browser_test.h |
diff --git a/chrome/browser/chromeos/login/mixin_in_process_browser_test.h b/chrome/browser/chromeos/login/mixin_in_process_browser_test.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..05930da9f110618ca7ef92695afee176d28b1f21 |
--- /dev/null |
+++ b/chrome/browser/chromeos/login/mixin_in_process_browser_test.h |
@@ -0,0 +1,58 @@ |
+// Copyright (c) 2014 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 CHROME_BROWSER_CHROMEOS_LOGIN_MIXIN_IN_PROCESS_BROWSER_TEST_H_ |
+#define CHROME_BROWSER_CHROMEOS_LOGIN_MIXIN_IN_PROCESS_BROWSER_TEST_H_ |
+ |
+#include "base/memory/scoped_vector.h" |
+#include "chrome/test/base/in_process_browser_test.h" |
+ |
+namespace chromeos { |
+ |
+class MixinInProcessBrowserTest : public InProcessBrowserTest { |
Denis Kuznetsov (DE-MUC)
2014/09/16 14:08:34
I would think on better name - no need to include
Lisa Ignatyeva
2014/09/17 10:39:37
Done.
|
+ public: |
+ // Class that can be used to add some features not related directly |
+ // to the testing process and do set ups needed for them in proper time. |
+ // To do this you need to derive Mixin, implement |
+ // all the methods you need there and (if needed) reload set ups and tear |
+ // downs |
+ // for things that you would usually do in those of the test, but which are |
+ // connected |
+ // to the mixin, not to the test itself. |
+ // Finally, AddMixin() should be called in the test's constructor for each |
+ // mixin. |
+ class Mixin { |
+ public: |
+ Mixin() {} |
+ virtual ~Mixin() {} |
+ virtual void SetUpCommandLine(base::CommandLine* command_line) {} |
+ virtual void SetUpOnMainThread() {} |
+ virtual void SetUpInProcessBrowserTestFixture() {} |
Denis Kuznetsov (DE-MUC)
2014/09/16 14:08:34
Some comments for these methods (maybe copied from
Lisa Ignatyeva
2014/09/17 10:39:37
Done.
|
+ virtual void TearDownOnMainThread() {} |
+ virtual void TearDownInProcessBrowserTestFixture() {} |
+ }; |
+ |
+ MixinInProcessBrowserTest(); |
+ virtual ~MixinInProcessBrowserTest(); |
+ virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; |
+ virtual void SetUpOnMainThread() OVERRIDE; |
+ virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; |
+ virtual void TearDownOnMainThread() OVERRIDE; |
+ virtual void TearDownInProcessBrowserTestFixture() OVERRIDE; |
+ |
+ protected: |
+ // Adds |mixin| as an mixin for this test, passing ownership |
+ // for it to MixinInProcessBrowserTest. |
+ // Should be called in constructor of the test (should be already completed |
+ // before running set ups). |
+ void AddMixin(Mixin* mixin); |
+ |
+ private: |
+ // Keeps all the mixins for this test, |
+ ScopedVector<Mixin> mixins_; |
+}; |
+ |
+} // namespace chromeos |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_LOGIN_MIXIN_IN_PROCESS_BROWSER_TEST_H_ |