| 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "chrome/browser/chromeos/login/helper.h" | 6 #include "chrome/browser/chromeos/login/helper.h" |
| 7 #include "chrome/browser/chromeos/login/screens/mock_screen_observer.h" | 7 #include "chrome/browser/chromeos/login/screens/mock_screen_observer.h" |
| 8 #include "chrome/browser/chromeos/login/screens/network_screen.h" | 8 #include "chrome/browser/chromeos/login/screens/network_screen.h" |
| 9 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" | 9 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" |
| 10 #include "chrome/browser/chromeos/login/wizard_controller.h" | 10 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 class NetworkScreenTest : public WizardInProcessBrowserTest { | 46 class NetworkScreenTest : public WizardInProcessBrowserTest { |
| 47 public: | 47 public: |
| 48 NetworkScreenTest(): WizardInProcessBrowserTest("network"), | 48 NetworkScreenTest(): WizardInProcessBrowserTest("network"), |
| 49 fake_session_manager_client_(NULL) { | 49 fake_session_manager_client_(NULL) { |
| 50 } | 50 } |
| 51 | 51 |
| 52 protected: | 52 protected: |
| 53 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 53 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 54 WizardInProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | 54 WizardInProcessBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 55 | 55 |
| 56 FakeDBusThreadManager* fake_dbus_thread_manager = | 56 FakeDBusThreadManager* fake_dbus_thread_manager = new FakeDBusThreadManager; |
| 57 new FakeDBusThreadManager; | 57 fake_session_manager_client_ = new FakeSessionManagerClient; |
| 58 fake_dbus_thread_manager->SetSessionManagerClient( |
| 59 scoped_ptr<SessionManagerClient>(fake_session_manager_client_)); |
| 58 DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager); | 60 DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager); |
| 59 fake_session_manager_client_ = | |
| 60 fake_dbus_thread_manager->fake_session_manager_client(); | |
| 61 } | 61 } |
| 62 | 62 |
| 63 virtual void SetUpOnMainThread() OVERRIDE { | 63 virtual void SetUpOnMainThread() OVERRIDE { |
| 64 WizardInProcessBrowserTest::SetUpOnMainThread(); | 64 WizardInProcessBrowserTest::SetUpOnMainThread(); |
| 65 mock_screen_observer_.reset(new MockScreenObserver()); | 65 mock_screen_observer_.reset(new MockScreenObserver()); |
| 66 ASSERT_TRUE(WizardController::default_controller() != NULL); | 66 ASSERT_TRUE(WizardController::default_controller() != NULL); |
| 67 network_screen_ = | 67 network_screen_ = |
| 68 WizardController::default_controller()->GetNetworkScreen(); | 68 WizardController::default_controller()->GetNetworkScreen(); |
| 69 ASSERT_TRUE(network_screen_ != NULL); | 69 ASSERT_TRUE(network_screen_ != NULL); |
| 70 ASSERT_EQ(WizardController::default_controller()->current_screen(), | 70 ASSERT_EQ(WizardController::default_controller()->current_screen(), |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 // Close infobubble with error message - it makes the test stable. | 150 // Close infobubble with error message - it makes the test stable. |
| 151 // EXPECT_FALSE(actor_->IsContinueEnabled()); | 151 // EXPECT_FALSE(actor_->IsContinueEnabled()); |
| 152 // EXPECT_FALSE(actor_->IsConnecting()); | 152 // EXPECT_FALSE(actor_->IsConnecting()); |
| 153 // actor_->ClearErrors(); | 153 // actor_->ClearErrors(); |
| 154 EXPECT_EQ( | 154 EXPECT_EQ( |
| 155 1, fake_session_manager_client_->emit_login_prompt_ready_call_count()); | 155 1, fake_session_manager_client_->emit_login_prompt_ready_call_count()); |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace chromeos | 158 } // namespace chromeos |
| OLD | NEW |