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