| 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 "chrome/browser/chromeos/input_method/input_method_manager_impl.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 scoped_ptr<InputMethodDescriptors> methods( | 883 scoped_ptr<InputMethodDescriptors> methods( |
| 884 manager_->GetActiveInputMethods()); | 884 manager_->GetActiveInputMethods()); |
| 885 ASSERT_EQ(2U, methods->size()); | 885 ASSERT_EQ(2U, methods->size()); |
| 886 EXPECT_EQ(std::string(kExtensionImePrefix) + "deadbeef", | 886 EXPECT_EQ(std::string(kExtensionImePrefix) + "deadbeef", |
| 887 // Ext. IMEs should be at the end of the list. | 887 // Ext. IMEs should be at the end of the list. |
| 888 methods->at(1).id()); | 888 methods->at(1).id()); |
| 889 } | 889 } |
| 890 manager_->RemoveObserver(&observer); | 890 manager_->RemoveObserver(&observer); |
| 891 } | 891 } |
| 892 | 892 |
| 893 TEST_F(InputMethodManagerImplTest, TestReset) { |
| 894 manager_->SetState(InputMethodManager::STATE_BROWSER_SCREEN); |
| 895 std::vector<std::string> ids; |
| 896 ids.push_back("xkb:us::eng"); |
| 897 ids.push_back("mozc"); |
| 898 EXPECT_TRUE(manager_->EnableInputMethods(ids)); |
| 899 EXPECT_EQ(2U, manager_->GetNumActiveInputMethods()); |
| 900 EXPECT_EQ(1, controller_->reset_count_); |
| 901 manager_->ChangeInputMethod("mozc"); |
| 902 EXPECT_EQ(1, controller_->reset_count_); |
| 903 manager_->ChangeInputMethod("xkb:us::eng"); |
| 904 EXPECT_EQ(2, controller_->reset_count_); |
| 905 } |
| 906 |
| 893 } // namespace input_method | 907 } // namespace input_method |
| 894 } // namespace chromeos | 908 } // namespace chromeos |
| OLD | NEW |