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 "chrome/browser/chromeos/login/test/oobe_base_test.h" | 5 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); | 86 command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); |
87 if (!needs_background_networking_) | 87 if (!needs_background_networking_) |
88 command_line->AppendSwitch(::switches::kDisableBackgroundNetworking); | 88 command_line->AppendSwitch(::switches::kDisableBackgroundNetworking); |
89 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); | 89 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, "user"); |
90 | 90 |
91 // Create gaia and webstore URL from test server url but using different | 91 // Create gaia and webstore URL from test server url but using different |
92 // host names. This is to avoid gaia response being tagged as from | 92 // host names. This is to avoid gaia response being tagged as from |
93 // webstore in chrome_resource_dispatcher_host_delegate.cc. | 93 // webstore in chrome_resource_dispatcher_host_delegate.cc. |
94 const GURL& server_url = embedded_test_server()->base_url(); | 94 const GURL& server_url = embedded_test_server()->base_url(); |
95 | 95 |
96 std::string gaia_host("gaia"); | |
97 GURL::Replacements replace_gaia_host; | 96 GURL::Replacements replace_gaia_host; |
98 replace_gaia_host.SetHostStr(gaia_host); | 97 replace_gaia_host.SetHostStr("gaia"); |
99 GURL gaia_url = server_url.ReplaceComponents(replace_gaia_host); | 98 GURL gaia_url = server_url.ReplaceComponents(replace_gaia_host); |
100 command_line->AppendSwitchASCII(::switches::kGaiaUrl, gaia_url.spec()); | 99 command_line->AppendSwitchASCII(::switches::kGaiaUrl, gaia_url.spec()); |
101 command_line->AppendSwitchASCII(::switches::kLsoUrl, gaia_url.spec()); | 100 command_line->AppendSwitchASCII(::switches::kLsoUrl, gaia_url.spec()); |
102 command_line->AppendSwitchASCII(::switches::kGoogleApisUrl, | 101 command_line->AppendSwitchASCII(::switches::kGoogleApisUrl, |
103 gaia_url.spec()); | 102 gaia_url.spec()); |
104 fake_gaia_->Initialize(); | 103 fake_gaia_->Initialize(); |
105 } | 104 } |
106 | 105 |
107 void OobeBaseTest::SimulateNetworkOffline() { | 106 void OobeBaseTest::SimulateNetworkOffline() { |
108 NetworkPortalDetector::CaptivePortalState offline_state; | 107 NetworkPortalDetector::CaptivePortalState offline_state; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 162 |
164 WebUILoginDisplay* OobeBaseTest::GetLoginDisplay() { | 163 WebUILoginDisplay* OobeBaseTest::GetLoginDisplay() { |
165 ExistingUserController* controller = | 164 ExistingUserController* controller = |
166 ExistingUserController::current_controller(); | 165 ExistingUserController::current_controller(); |
167 CHECK(controller); | 166 CHECK(controller); |
168 return static_cast<WebUILoginDisplay*>( | 167 return static_cast<WebUILoginDisplay*>( |
169 controller->login_display()); | 168 controller->login_display()); |
170 } | 169 } |
171 | 170 |
172 } // namespace chromeos | 171 } // namespace chromeos |
OLD | NEW |