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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Start https wrapper here so that the URLs can be pointed at it in | 87 // Start https wrapper here so that the URLs can be pointed at it in |
88 // SetUpCommandLine(). | 88 // SetUpCommandLine(). |
89 ASSERT_TRUE(gaia_https_forwarder_.Initialize( | 89 ASSERT_TRUE(gaia_https_forwarder_.Initialize( |
90 kGAIAHost, embedded_test_server()->base_url())); | 90 kGAIAHost, embedded_test_server()->base_url())); |
91 | 91 |
92 MixinBasedBrowserTest::SetUp(); | 92 MixinBasedBrowserTest::SetUp(); |
93 } | 93 } |
94 | 94 |
95 void LoginManagerTest::TearDownOnMainThread() { | 95 void LoginManagerTest::TearDownOnMainThread() { |
96 MixinBasedBrowserTest::TearDownOnMainThread(); | 96 MixinBasedBrowserTest::TearDownOnMainThread(); |
97 if (LoginDisplayHostImpl::default_host()) | 97 if (LoginDisplayHost::default_host()) |
98 LoginDisplayHostImpl::default_host()->Finalize(); | 98 LoginDisplayHost::default_host()->Finalize(); |
99 base::MessageLoop::current()->RunUntilIdle(); | 99 base::MessageLoop::current()->RunUntilIdle(); |
100 EXPECT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete()); | 100 EXPECT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete()); |
101 } | 101 } |
102 | 102 |
103 void LoginManagerTest::SetUpCommandLine(base::CommandLine* command_line) { | 103 void LoginManagerTest::SetUpCommandLine(base::CommandLine* command_line) { |
104 command_line->AppendSwitch(chromeos::switches::kLoginManager); | 104 command_line->AppendSwitch(chromeos::switches::kLoginManager); |
105 command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); | 105 command_line->AppendSwitch(chromeos::switches::kForceLoginManagerInTests); |
106 | 106 |
107 const GURL gaia_url = gaia_https_forwarder_.GetURLForSSLHost(std::string()); | 107 const GURL gaia_url = gaia_https_forwarder_.GetURLForSSLHost(std::string()); |
108 command_line->AppendSwitchASCII(::switches::kGaiaUrl, gaia_url.spec()); | 108 command_line->AppendSwitchASCII(::switches::kGaiaUrl, gaia_url.spec()); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // static | 211 // static |
212 std::string LoginManagerTest::GetGaiaIDForUserID(const std::string& user_id) { | 212 std::string LoginManagerTest::GetGaiaIDForUserID(const std::string& user_id) { |
213 return "gaia-id-" + user_id; | 213 return "gaia-id-" + user_id; |
214 } | 214 } |
215 | 215 |
216 void LoginManagerTest::JSExpect(const std::string& expression) { | 216 void LoginManagerTest::JSExpect(const std::string& expression) { |
217 js_checker_.ExpectTrue(expression); | 217 js_checker_.ExpectTrue(expression); |
218 } | 218 } |
219 | 219 |
220 void LoginManagerTest::InitializeWebContents() { | 220 void LoginManagerTest::InitializeWebContents() { |
221 LoginDisplayHost* host = LoginDisplayHostImpl::default_host(); | 221 LoginDisplayHost* host = LoginDisplayHost::default_host(); |
222 EXPECT_TRUE(host != NULL); | 222 EXPECT_TRUE(host != NULL); |
223 | 223 |
224 content::WebContents* web_contents = | 224 content::WebContents* web_contents = |
225 host->GetWebUILoginView()->GetWebContents(); | 225 host->GetWebUILoginView()->GetWebContents(); |
226 EXPECT_TRUE(web_contents != NULL); | 226 EXPECT_TRUE(web_contents != NULL); |
227 set_web_contents(web_contents); | 227 set_web_contents(web_contents); |
228 js_checker_.set_web_contents(web_contents); | 228 js_checker_.set_web_contents(web_contents); |
229 } | 229 } |
230 | 230 |
231 } // namespace chromeos | 231 } // namespace chromeos |
OLD | NEW |