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

Unified Diff: chrome/browser/chromeos/login/mixin_based_browser_test.cc

Issue 574703002: Creating mixin-supporting InProcessBrowserTests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: style fixed Created 6 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 | « chrome/browser/chromeos/login/mixin_based_browser_test.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/mixin_based_browser_test.cc
diff --git a/chrome/browser/chromeos/login/mixin_based_browser_test.cc b/chrome/browser/chromeos/login/mixin_based_browser_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..765f8ab5a2989b0dfb8b08720936fd83f15fcb47
--- /dev/null
+++ b/chrome/browser/chromeos/login/mixin_based_browser_test.cc
@@ -0,0 +1,65 @@
+// 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.
+
+#include "chrome/browser/chromeos/login/mixin_based_browser_test.h"
+
+namespace chromeos {
+
+MixinBasedBrowserTest::MixinBasedBrowserTest() : setup_was_launched_(false) {
+}
+
+MixinBasedBrowserTest::~MixinBasedBrowserTest() {
+}
+
+void MixinBasedBrowserTest::SetUpCommandLine(base::CommandLine* command_line) {
+ setup_was_launched_ = true;
+ for (ScopedVector<Mixin>::iterator it = mixins_.begin(); it != mixins_.end();
+ ++it) {
+ (*it)->SetUpCommandLine(command_line);
+ }
+ InProcessBrowserTest::SetUpCommandLine(command_line);
+}
+
+void MixinBasedBrowserTest::SetUpInProcessBrowserTestFixture() {
+ setup_was_launched_ = true;
+ for (ScopedVector<Mixin>::iterator it = mixins_.begin(); it != mixins_.end();
+ ++it) {
+ (*it)->SetUpInProcessBrowserTestFixture();
+ }
+ InProcessBrowserTest::SetUpInProcessBrowserTestFixture();
+}
+
+void MixinBasedBrowserTest::SetUpOnMainThread() {
+ setup_was_launched_ = true;
+ for (ScopedVector<Mixin>::iterator it = mixins_.begin(); it != mixins_.end();
+ ++it) {
+ (*it)->SetUpOnMainThread();
+ }
+ InProcessBrowserTest::SetUpOnMainThread();
+}
+
+void MixinBasedBrowserTest::TearDownOnMainThread() {
+ InProcessBrowserTest::TearDownOnMainThread();
+ for (ScopedVector<Mixin>::reverse_iterator it = mixins_.rbegin();
+ it != mixins_.rend();
+ ++it) {
+ (*it)->TearDownInProcessBrowserTestFixture();
+ }
+}
+void MixinBasedBrowserTest::TearDownInProcessBrowserTestFixture() {
+ InProcessBrowserTest::TearDownInProcessBrowserTestFixture();
+ for (ScopedVector<Mixin>::reverse_iterator it = mixins_.rbegin();
+ it != mixins_.rend();
+ ++it) {
+ (*it)->TearDownInProcessBrowserTestFixture();
+ }
+}
+
+void MixinBasedBrowserTest::AddMixin(MixinBasedBrowserTest::Mixin* mixin) {
+ CHECK(!setup_was_launched_)
+ << "You are trying to add a mixin after setting up has already started.";
Denis Kuznetsov (DE-MUC) 2014/09/17 19:27:58 Nit : it could be as simple as "Can't add mixin :
+ mixins_.push_back(mixin);
+}
+
+} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/login/mixin_based_browser_test.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698