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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/location.h" | 6 #include "base/location.h" |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" |
9 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chromeos/input_method/input_method_persistence.h" | 11 #include "chrome/browser/chromeos/input_method/input_method_persistence.h" |
11 #include "chrome/browser/chromeos/language_preferences.h" | 12 #include "chrome/browser/chromeos/language_preferences.h" |
12 #include "chrome/browser/chromeos/login/login_manager_test.h" | 13 #include "chrome/browser/chromeos/login/login_manager_test.h" |
13 #include "chrome/browser/chromeos/login/startup_utils.h" | 14 #include "chrome/browser/chromeos/login/startup_utils.h" |
14 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" | 15 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" |
15 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 16 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
16 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 17 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
17 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
18 #include "chromeos/chromeos_switches.h" | 19 #include "chromeos/chromeos_switches.h" |
(...skipping 28 matching lines...) Expand all Loading... |
47 ->SetFocusPODCallbackForTesting( | 48 ->SetFocusPODCallbackForTesting( |
48 base::Bind(&FocusPODWaiter::OnFocusPOD, base::Unretained(this))); | 49 base::Bind(&FocusPODWaiter::OnFocusPOD, base::Unretained(this))); |
49 } | 50 } |
50 ~FocusPODWaiter() { | 51 ~FocusPODWaiter() { |
51 GetOobeUI() | 52 GetOobeUI() |
52 ->signin_screen_handler_for_test() | 53 ->signin_screen_handler_for_test() |
53 ->SetFocusPODCallbackForTesting(base::Closure()); | 54 ->SetFocusPODCallbackForTesting(base::Closure()); |
54 } | 55 } |
55 | 56 |
56 void OnFocusPOD() { | 57 void OnFocusPOD() { |
| 58 ASSERT_TRUE(base::MessageLoopForUI::IsCurrent()); |
57 focused_ = true; | 59 focused_ = true; |
58 if (runner_.get()) | 60 if (runner_.get()) { |
59 base::MessageLoopForUI::current()->task_runner()->PostTask( | 61 base::ThreadTaskRunnerHandle::Get()->PostTask( |
60 FROM_HERE, | 62 FROM_HERE, |
61 base::Bind(&FocusPODWaiter::ExitMessageLoop, base::Unretained(this))); | 63 base::Bind(&FocusPODWaiter::ExitMessageLoop, base::Unretained(this))); |
| 64 } |
62 } | 65 } |
63 | 66 |
64 void ExitMessageLoop() { runner_->Quit(); } | 67 void ExitMessageLoop() { runner_->Quit(); } |
65 | 68 |
66 void Wait() { | 69 void Wait() { |
67 if (focused_) | 70 if (focused_) |
68 return; | 71 return; |
69 runner_->Run(); | 72 runner_->Run(); |
70 GetOobeUI() | 73 GetOobeUI() |
71 ->signin_screen_handler_for_test() | 74 ->signin_screen_handler_for_test() |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 // Switch back. | 277 // Switch back. |
275 js_checker().Evaluate("$('gaia-signin').cancel()"); | 278 js_checker().Evaluate("$('gaia-signin').cancel()"); |
276 OobeScreenWaiter(OobeScreen::SCREEN_ACCOUNT_PICKER).Wait(); | 279 OobeScreenWaiter(OobeScreen::SCREEN_ACCOUNT_PICKER).Wait(); |
277 | 280 |
278 EXPECT_EQ(expected_input_methods, | 281 EXPECT_EQ(expected_input_methods, |
279 input_method::InputMethodManager::Get() | 282 input_method::InputMethodManager::Get() |
280 ->GetActiveIMEState() | 283 ->GetActiveIMEState() |
281 ->GetActiveInputMethodIds()); | 284 ->GetActiveInputMethodIds()); |
282 } | 285 } |
283 } // namespace chromeos | 286 } // namespace chromeos |
OLD | NEW |