OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/login_manager_test.h" | 5 #include "chrome/browser/chromeos/login/login_manager_test.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 command_line->AppendSwitchASCII(::switches::kGaiaUrl, gaia_url.spec()); | 109 command_line->AppendSwitchASCII(::switches::kGaiaUrl, gaia_url.spec()); |
110 command_line->AppendSwitchASCII(::switches::kLsoUrl, gaia_url.spec()); | 110 command_line->AppendSwitchASCII(::switches::kLsoUrl, gaia_url.spec()); |
111 command_line->AppendSwitchASCII(::switches::kGoogleApisUrl, gaia_url.spec()); | 111 command_line->AppendSwitchASCII(::switches::kGoogleApisUrl, gaia_url.spec()); |
112 | 112 |
113 fake_gaia_.Initialize(); | 113 fake_gaia_.Initialize(); |
114 fake_gaia_.set_issue_oauth_code_cookie(true); | 114 fake_gaia_.set_issue_oauth_code_cookie(true); |
115 | 115 |
116 MixinBasedBrowserTest::SetUpCommandLine(command_line); | 116 MixinBasedBrowserTest::SetUpCommandLine(command_line); |
117 } | 117 } |
118 | 118 |
119 void LoginManagerTest::SetUpInProcessBrowserTestFixture() { | |
120 host_resolver()->AddRule("*", "127.0.0.1"); | |
121 MixinBasedBrowserTest::SetUpInProcessBrowserTestFixture(); | |
122 } | |
123 | |
124 void LoginManagerTest::SetUpOnMainThread() { | 119 void LoginManagerTest::SetUpOnMainThread() { |
125 LoginDisplayHostImpl::DisableRestrictiveProxyCheckForTest(); | 120 LoginDisplayHostImpl::DisableRestrictiveProxyCheckForTest(); |
126 | 121 |
127 // Start the accept thread as the sandbox host process has already been | 122 // Start the accept thread as the sandbox host process has already been |
128 // spawned. | 123 // spawned. |
| 124 host_resolver()->AddRule("*", "127.0.0.1"); |
129 embedded_test_server()->StartAcceptingConnections(); | 125 embedded_test_server()->StartAcceptingConnections(); |
130 | 126 |
131 FakeGaia::AccessTokenInfo token_info; | 127 FakeGaia::AccessTokenInfo token_info; |
132 token_info.scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth); | 128 token_info.scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth); |
133 token_info.scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope); | 129 token_info.scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope); |
134 token_info.audience = GaiaUrls::GetInstance()->oauth2_chrome_client_id(); | 130 token_info.audience = GaiaUrls::GetInstance()->oauth2_chrome_client_id(); |
135 | 131 |
136 token_info.token = kTestUserinfoToken1; | 132 token_info.token = kTestUserinfoToken1; |
137 token_info.email = kEnterpriseUser1; | 133 token_info.email = kEnterpriseUser1; |
138 fake_gaia_.IssueOAuthToken(kTestRefreshToken1, token_info); | 134 fake_gaia_.IssueOAuthToken(kTestRefreshToken1, token_info); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 EXPECT_TRUE(host != NULL); | 219 EXPECT_TRUE(host != NULL); |
224 | 220 |
225 content::WebContents* web_contents = | 221 content::WebContents* web_contents = |
226 host->GetWebUILoginView()->GetWebContents(); | 222 host->GetWebUILoginView()->GetWebContents(); |
227 EXPECT_TRUE(web_contents != NULL); | 223 EXPECT_TRUE(web_contents != NULL); |
228 set_web_contents(web_contents); | 224 set_web_contents(web_contents); |
229 js_checker_.set_web_contents(web_contents); | 225 js_checker_.set_web_contents(web_contents); |
230 } | 226 } |
231 | 227 |
232 } // namespace chromeos | 228 } // namespace chromeos |
OLD | NEW |