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 "ash/shell.h" | 5 #include "ash/shell.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "chrome/browser/chrome_browser_main.h" | 7 #include "chrome/browser/chrome_browser_main.h" |
8 #include "chrome/browser/chrome_browser_main_extra_parts.h" | 8 #include "chrome/browser/chrome_browser_main_extra_parts.h" |
9 #include "chrome/browser/chrome_content_browser_client.h" | 9 #include "chrome/browser/chrome_content_browser_client.h" |
10 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" | 10 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 149 |
150 class LoginSigninTest : public CrosInProcessBrowserTest { | 150 class LoginSigninTest : public CrosInProcessBrowserTest { |
151 protected: | 151 protected: |
152 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 152 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
153 command_line->AppendSwitch(switches::kLoginManager); | 153 command_line->AppendSwitch(switches::kLoginManager); |
154 command_line->AppendSwitch(switches::kForceLoginManagerInTests); | 154 command_line->AppendSwitch(switches::kForceLoginManagerInTests); |
155 } | 155 } |
156 | 156 |
157 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 157 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
158 content_browser_client_.reset(new TestContentBrowserClient()); | 158 content_browser_client_.reset(new TestContentBrowserClient()); |
159 original_content_browser_client_ = content::GetContentClient()->browser(); | 159 original_content_browser_client_ = content::SetBrowserClientForTesting( |
160 content::GetContentClient()->set_browser_for_testing( | |
161 content_browser_client_.get()); | 160 content_browser_client_.get()); |
162 } | 161 } |
163 | 162 |
164 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { | 163 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { |
165 content::GetContentClient()->set_browser_for_testing( | 164 content::SetBrowserClientForTesting(original_content_browser_client_); |
166 original_content_browser_client_); | |
167 } | 165 } |
168 | 166 |
169 scoped_ptr<TestContentBrowserClient> content_browser_client_; | 167 scoped_ptr<TestContentBrowserClient> content_browser_client_; |
170 content::ContentBrowserClient* original_content_browser_client_; | 168 content::ContentBrowserClient* original_content_browser_client_; |
171 }; | 169 }; |
172 | 170 |
173 // After a chrome crash, the session manager will restart chrome with | 171 // After a chrome crash, the session manager will restart chrome with |
174 // the -login-user flag indicating that the user is already logged in. | 172 // the -login-user flag indicating that the user is already logged in. |
175 // This profile should NOT be an OTR profile. | 173 // This profile should NOT be an OTR profile. |
176 IN_PROC_BROWSER_TEST_F(LoginUserTest, UserPassed) { | 174 IN_PROC_BROWSER_TEST_F(LoginUserTest, UserPassed) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 // Verifies that the webui for login comes up successfully. | 215 // Verifies that the webui for login comes up successfully. |
218 IN_PROC_BROWSER_TEST_F(LoginSigninTest, WebUIVisible) { | 216 IN_PROC_BROWSER_TEST_F(LoginSigninTest, WebUIVisible) { |
219 scoped_refptr<content::MessageLoopRunner> runner = | 217 scoped_refptr<content::MessageLoopRunner> runner = |
220 new content::MessageLoopRunner; | 218 new content::MessageLoopRunner; |
221 content_browser_client_->browser_main_extra_parts_->set_quit_task( | 219 content_browser_client_->browser_main_extra_parts_->set_quit_task( |
222 runner->QuitClosure()); | 220 runner->QuitClosure()); |
223 runner->Run(); | 221 runner->Run(); |
224 } | 222 } |
225 | 223 |
226 } // namespace chromeos | 224 } // namespace chromeos |
OLD | NEW |