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