| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/test/ash_test_base.h" | 5 #include "ash/test/ash_test_base.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 site_instance); | 80 site_instance); |
| 81 } | 81 } |
| 82 | 82 |
| 83 ///////////////////////////////////////////////////////////////////////////// | 83 ///////////////////////////////////////////////////////////////////////////// |
| 84 | 84 |
| 85 AshTestBase::AshTestBase() | 85 AshTestBase::AshTestBase() |
| 86 : setup_called_(false), | 86 : setup_called_(false), |
| 87 teardown_called_(false) { | 87 teardown_called_(false) { |
| 88 // Must initialize |ash_test_helper_| here because some tests rely on | 88 // Must initialize |ash_test_helper_| here because some tests rely on |
| 89 // AshTestBase methods before they call AshTestBase::SetUp(). | 89 // AshTestBase methods before they call AshTestBase::SetUp(). |
| 90 ash_test_helper_.reset(new AshTestHelper(&message_loop_)); | 90 ash_test_helper_.reset(new AshTestHelper(base::MessageLoopForUI::current())); |
| 91 } | 91 } |
| 92 | 92 |
| 93 AshTestBase::~AshTestBase() { | 93 AshTestBase::~AshTestBase() { |
| 94 CHECK(setup_called_) | 94 CHECK(setup_called_) |
| 95 << "You have overridden SetUp but never called AshTestBase::SetUp"; | 95 << "You have overridden SetUp but never called AshTestBase::SetUp"; |
| 96 CHECK(teardown_called_) | 96 CHECK(teardown_called_) |
| 97 << "You have overridden TearDown but never called AshTestBase::TearDown"; | 97 << "You have overridden TearDown but never called AshTestBase::TearDown"; |
| 98 } | 98 } |
| 99 | 99 |
| 100 void AshTestBase::SetUp() { | 100 void AshTestBase::SetUp() { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 SetHasActiveUser(user_logged_in); | 284 SetHasActiveUser(user_logged_in); |
| 285 } | 285 } |
| 286 | 286 |
| 287 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { | 287 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { |
| 288 ash_test_helper_->test_shell_delegate()->test_session_state_delegate()-> | 288 ash_test_helper_->test_shell_delegate()->test_session_state_delegate()-> |
| 289 SetCanLockScreen(can_lock_screen); | 289 SetCanLockScreen(can_lock_screen); |
| 290 } | 290 } |
| 291 | 291 |
| 292 } // namespace test | 292 } // namespace test |
| 293 } // namespace ash | 293 } // namespace ash |
| OLD | NEW |