| 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 26 matching lines...) Expand all Loading... |
| 37 public: | 37 public: |
| 38 UpdateScreenTest() : WizardInProcessBrowserTest("update"), | 38 UpdateScreenTest() : WizardInProcessBrowserTest("update"), |
| 39 fake_update_engine_client_(NULL), | 39 fake_update_engine_client_(NULL), |
| 40 network_portal_detector_(NULL) { | 40 network_portal_detector_(NULL) { |
| 41 } | 41 } |
| 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_update_engine_client_ = new FakeUpdateEngineClient; |
| 48 fake_dbus_thread_manager->SetUpdateEngineClient( |
| 49 scoped_ptr<UpdateEngineClient>(fake_update_engine_client_)); |
| 50 |
| 47 DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager); | 51 DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager); |
| 48 WizardInProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | 52 WizardInProcessBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 49 | 53 |
| 50 fake_update_engine_client_ | |
| 51 = fake_dbus_thread_manager->fake_update_engine_client(); | |
| 52 | |
| 53 // Setup network portal detector to return online state for both | 54 // Setup network portal detector to return online state for both |
| 54 // ethernet and wifi networks. Ethernet is an active network by | 55 // ethernet and wifi networks. Ethernet is an active network by |
| 55 // default. | 56 // default. |
| 56 network_portal_detector_ = new NetworkPortalDetectorTestImpl(); | 57 network_portal_detector_ = new NetworkPortalDetectorTestImpl(); |
| 57 NetworkPortalDetector::InitializeForTesting(network_portal_detector_); | 58 NetworkPortalDetector::InitializeForTesting(network_portal_detector_); |
| 58 NetworkPortalDetector::CaptivePortalState online_state; | 59 NetworkPortalDetector::CaptivePortalState online_state; |
| 59 online_state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; | 60 online_state.status = NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE; |
| 60 online_state.response_code = 204; | 61 online_state.response_code = 204; |
| 61 SetDefaultNetworkPath(kStubEthernetServicePath); | 62 SetDefaultNetworkPath(kStubEthernetServicePath); |
| 62 SetDetectionResults(kStubEthernetServicePath, online_state); | 63 SetDetectionResults(kStubEthernetServicePath, online_state); |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 chromeos::UpdateEngineClient::UPDATE_RESULT_FAILED); | 383 chromeos::UpdateEngineClient::UPDATE_RESULT_FAILED); |
| 383 EXPECT_CALL(*mock_screen_observer_, | 384 EXPECT_CALL(*mock_screen_observer_, |
| 384 OnExit(ScreenObserver::UPDATE_ERROR_CHECKING_FOR_UPDATE)) | 385 OnExit(ScreenObserver::UPDATE_ERROR_CHECKING_FOR_UPDATE)) |
| 385 .Times(1); | 386 .Times(1); |
| 386 | 387 |
| 387 update_screen_->OnConnectToNetworkRequested(kStubEthernetServicePath); | 388 update_screen_->OnConnectToNetworkRequested(kStubEthernetServicePath); |
| 388 base::MessageLoop::current()->RunUntilIdle(); | 389 base::MessageLoop::current()->RunUntilIdle(); |
| 389 } | 390 } |
| 390 | 391 |
| 391 } // namespace chromeos | 392 } // namespace chromeos |
| OLD | NEW |