Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / chromeos / login / mixin_based_browser_test.cc
blob765f8ab5a2989b0dfb8b08720936fd83f15fcb47
1 // Copyright (c) 2014 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.
5 #include "chrome/browser/chromeos/login/mixin_based_browser_test.h"
7 namespace chromeos {
9 MixinBasedBrowserTest::MixinBasedBrowserTest() : setup_was_launched_(false) {
12 MixinBasedBrowserTest::~MixinBasedBrowserTest() {
15 void MixinBasedBrowserTest::SetUpCommandLine(base::CommandLine* command_line) {
16 setup_was_launched_ = true;
17 for (ScopedVector<Mixin>::iterator it = mixins_.begin(); it != mixins_.end();
18 ++it) {
19 (*it)->SetUpCommandLine(command_line);
21 InProcessBrowserTest::SetUpCommandLine(command_line);
24 void MixinBasedBrowserTest::SetUpInProcessBrowserTestFixture() {
25 setup_was_launched_ = true;
26 for (ScopedVector<Mixin>::iterator it = mixins_.begin(); it != mixins_.end();
27 ++it) {
28 (*it)->SetUpInProcessBrowserTestFixture();
30 InProcessBrowserTest::SetUpInProcessBrowserTestFixture();
33 void MixinBasedBrowserTest::SetUpOnMainThread() {
34 setup_was_launched_ = true;
35 for (ScopedVector<Mixin>::iterator it = mixins_.begin(); it != mixins_.end();
36 ++it) {
37 (*it)->SetUpOnMainThread();
39 InProcessBrowserTest::SetUpOnMainThread();
42 void MixinBasedBrowserTest::TearDownOnMainThread() {
43 InProcessBrowserTest::TearDownOnMainThread();
44 for (ScopedVector<Mixin>::reverse_iterator it = mixins_.rbegin();
45 it != mixins_.rend();
46 ++it) {
47 (*it)->TearDownInProcessBrowserTestFixture();
50 void MixinBasedBrowserTest::TearDownInProcessBrowserTestFixture() {
51 InProcessBrowserTest::TearDownInProcessBrowserTestFixture();
52 for (ScopedVector<Mixin>::reverse_iterator it = mixins_.rbegin();
53 it != mixins_.rend();
54 ++it) {
55 (*it)->TearDownInProcessBrowserTestFixture();
59 void MixinBasedBrowserTest::AddMixin(MixinBasedBrowserTest::Mixin* mixin) {
60 CHECK(!setup_was_launched_)
61 << "You are trying to add a mixin after setting up has already started.";
62 mixins_.push_back(mixin);
65 } // namespace chromeos