OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 GetCurrentScreenName(web_contents)); | 196 GetCurrentScreenName(web_contents)); |
197 | 197 |
198 // Disconnect from the fake Ethernet network. | 198 // Disconnect from the fake Ethernet network. |
199 OobeUI* const oobe_ui = host->GetOobeUI(); | 199 OobeUI* const oobe_ui = host->GetOobeUI(); |
200 ASSERT_TRUE(oobe_ui); | 200 ASSERT_TRUE(oobe_ui); |
201 const scoped_refptr<NetworkStateInformer> network_state_informer = | 201 const scoped_refptr<NetworkStateInformer> network_state_informer = |
202 oobe_ui->network_state_informer_for_test(); | 202 oobe_ui->network_state_informer_for_test(); |
203 ASSERT_TRUE(network_state_informer); | 203 ASSERT_TRUE(network_state_informer); |
204 network_state_informer->AddObserver(this); | 204 network_state_informer->AddObserver(this); |
205 SigninScreenHandler* const signin_screen_handler = | 205 SigninScreenHandler* const signin_screen_handler = |
206 oobe_ui->signin_screen_handler_for_test(); | 206 oobe_ui->signin_screen_handler(); |
207 ASSERT_TRUE(signin_screen_handler); | 207 ASSERT_TRUE(signin_screen_handler); |
208 signin_screen_handler->ZeroOfflineTimeoutForTesting(); | 208 signin_screen_handler->ZeroOfflineTimeoutForTesting(); |
209 SimulateNetworkOffline(); | 209 SimulateNetworkOffline(); |
210 network_state_change_wait_run_loop_->Run(); | 210 network_state_change_wait_run_loop_->Run(); |
211 network_state_informer->RemoveObserver(this); | 211 network_state_informer->RemoveObserver(this); |
212 base::RunLoop().RunUntilIdle(); | 212 base::RunLoop().RunUntilIdle(); |
213 | 213 |
214 // Verify that the offline error screen was not shown and the device disabled | 214 // Verify that the offline error screen was not shown and the device disabled |
215 // screen is still being shown instead. | 215 // screen is still being shown instead. |
216 EXPECT_EQ(GetOobeScreenName(OobeScreen::SCREEN_DEVICE_DISABLED), | 216 EXPECT_EQ(GetOobeScreenName(OobeScreen::SCREEN_DEVICE_DISABLED), |
217 GetCurrentScreenName(web_contents)); | 217 GetCurrentScreenName(web_contents)); |
218 } | 218 } |
219 | 219 |
220 } // namespace system | 220 } // namespace system |
221 } // namespace chromeos | 221 } // namespace chromeos |
OLD | NEW |