| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "chrome/browser/chromeos/login/screens/mock_error_screen.h" | 7 #include "chrome/browser/chromeos/login/screens/mock_error_screen.h" |
| 8 #include "chrome/browser/chromeos/login/screens/mock_screen_observer.h" | 8 #include "chrome/browser/chromeos/login/screens/mock_screen_observer.h" |
| 9 #include "chrome/browser/chromeos/login/screens/update_screen.h" | 9 #include "chrome/browser/chromeos/login/screens/update_screen.h" |
| 10 #include "chrome/browser/chromeos/login/wizard_controller.h" | 10 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 44 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 45 FakeDBusThreadManager* fake_dbus_thread_manager = | 45 FakeDBusThreadManager* fake_dbus_thread_manager = |
| 46 new FakeDBusThreadManager; | 46 new FakeDBusThreadManager; |
| 47 fake_dbus_thread_manager->SetFakeClients(); | 47 fake_dbus_thread_manager->SetFakeClients(); |
| 48 fake_update_engine_client_ = new FakeUpdateEngineClient; | 48 fake_update_engine_client_ = new FakeUpdateEngineClient; |
| 49 fake_dbus_thread_manager->SetUpdateEngineClient( | 49 fake_dbus_thread_manager->SetUpdateEngineClient( |
| 50 scoped_ptr<UpdateEngineClient>(fake_update_engine_client_)); | 50 scoped_ptr<UpdateEngineClient>(fake_update_engine_client_)); |
| 51 | 51 |
| 52 DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager); | 52 DBusThreadManager::SetInstanceForTesting(fake_dbus_thread_manager); |
| 53 WizardInProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | 53 WizardInProcessBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 54 | 54 |
| 55 // Setup network portal detector to return online state for both | 55 // Setup network portal detector to return online state for both |
| 56 // ethernet and wifi networks. Ethernet is an active network by | 56 // ethernet and wifi networks. Ethernet is an active network by |
| 57 // default. | 57 // default. |
| 58 network_portal_detector_ = new NetworkPortalDetectorTestImpl(); | 58 network_portal_detector_ = new NetworkPortalDetectorTestImpl(); |
| 59 NetworkPortalDetector::InitializeForTesting(network_portal_detector_); | 59 NetworkPortalDetector::InitializeForTesting(network_portal_detector_); |
| 60 NetworkPortalDetector::CaptivePortalState online_state; | 60 NetworkPortalDetector::CaptivePortalState online_state; |
| 61 online_state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; | 61 online_state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; |
| 62 online_state.response_code = 204; | 62 online_state.response_code = 204; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 83 update_screen_ = WizardController::default_controller()->GetUpdateScreen(); | 83 update_screen_ = WizardController::default_controller()->GetUpdateScreen(); |
| 84 ASSERT_TRUE(update_screen_ != NULL); | 84 ASSERT_TRUE(update_screen_ != NULL); |
| 85 ASSERT_EQ(WizardController::default_controller()->current_screen(), | 85 ASSERT_EQ(WizardController::default_controller()->current_screen(), |
| 86 update_screen_); | 86 update_screen_); |
| 87 update_screen_->screen_observer_ = mock_screen_observer_.get(); | 87 update_screen_->screen_observer_ = mock_screen_observer_.get(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { | 90 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { |
| 91 NetworkPortalDetector::Shutdown(); | 91 NetworkPortalDetector::Shutdown(); |
| 92 WizardInProcessBrowserTest::TearDownInProcessBrowserTestFixture(); | 92 WizardInProcessBrowserTest::TearDownInProcessBrowserTestFixture(); |
| 93 DBusThreadManager::Shutdown(); | |
| 94 } | 93 } |
| 95 | 94 |
| 96 void SetDefaultNetworkPath(const std::string& service_path) { | 95 void SetDefaultNetworkPath(const std::string& service_path) { |
| 97 DCHECK(network_portal_detector_); | 96 DCHECK(network_portal_detector_); |
| 98 network_portal_detector_->SetDefaultNetworkPathForTesting( | 97 network_portal_detector_->SetDefaultNetworkPathForTesting( |
| 99 service_path); | 98 service_path); |
| 100 } | 99 } |
| 101 | 100 |
| 102 void SetDetectionResults( | 101 void SetDetectionResults( |
| 103 const std::string& service_path, | 102 const std::string& service_path, |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 chromeos::UpdateEngineClient::UPDATE_RESULT_FAILED); | 383 chromeos::UpdateEngineClient::UPDATE_RESULT_FAILED); |
| 385 EXPECT_CALL(*mock_screen_observer_, | 384 EXPECT_CALL(*mock_screen_observer_, |
| 386 OnExit(ScreenObserver::UPDATE_ERROR_CHECKING_FOR_UPDATE)) | 385 OnExit(ScreenObserver::UPDATE_ERROR_CHECKING_FOR_UPDATE)) |
| 387 .Times(1); | 386 .Times(1); |
| 388 | 387 |
| 389 update_screen_->OnConnectToNetworkRequested(kStubEthernetServicePath); | 388 update_screen_->OnConnectToNetworkRequested(kStubEthernetServicePath); |
| 390 base::MessageLoop::current()->RunUntilIdle(); | 389 base::MessageLoop::current()->RunUntilIdle(); |
| 391 } | 390 } |
| 392 | 391 |
| 393 } // namespace chromeos | 392 } // namespace chromeos |
| OLD | NEW |