Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Side by Side Diff: chrome/browser/chromeos/preferences_unittest.cc

Issue 2605843002: Add MockInputMethodManager under ui/base/ime/chromeos/ (Closed)
Patch Set: Addressed comments. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/preferences.h" 5 #include "chrome/browser/chromeos/preferences.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/json/json_string_value_serializer.h" 9 #include "base/json/json_string_value_serializer.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/strings/string_split.h" 11 #include "base/strings/string_split.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" 13 #include "chrome/browser/chromeos/input_method/input_method_configuration.h"
14 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h" 14 #include "chrome/browser/chromeos/input_method/mock_input_method_manager_impl.h"
15 #include "chrome/browser/chromeos/login/session/user_session_manager.h" 15 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
16 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" 16 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
17 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" 17 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
18 #include "chrome/common/chrome_constants.h" 18 #include "chrome/common/chrome_constants.h"
19 #include "chrome/common/pref_names.h" 19 #include "chrome/common/pref_names.h"
20 #include "chrome/test/base/testing_browser_process.h" 20 #include "chrome/test/base/testing_browser_process.h"
21 #include "chrome/test/base/testing_profile.h" 21 #include "chrome/test/base/testing_profile.h"
22 #include "chrome/test/base/testing_profile_manager.h" 22 #include "chrome/test/base/testing_profile_manager.h"
23 #include "components/prefs/pref_member.h" 23 #include "components/prefs/pref_member.h"
24 #include "components/sync/model/attachments/attachment_id.h" 24 #include "components/sync/model/attachments/attachment_id.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 base::Time(), 67 base::Time(),
68 syncer::AttachmentIdList(), 68 syncer::AttachmentIdList(),
69 syncer::AttachmentServiceProxyForTest::Create()); 69 syncer::AttachmentServiceProxyForTest::Create());
70 } 70 }
71 71
72 } // anonymous namespace 72 } // anonymous namespace
73 73
74 namespace input_method { 74 namespace input_method {
75 namespace { 75 namespace {
76 76
77 class MyMockInputMethodManager : public MockInputMethodManager { 77 class MyMockInputMethodManager : public MockInputMethodManagerImpl {
78 public: 78 public:
79 class State : public MockInputMethodManager::State { 79 class State : public MockInputMethodManagerImpl::State {
80 public: 80 public:
81 explicit State(MyMockInputMethodManager* manager) 81 explicit State(MyMockInputMethodManager* manager)
82 : MockInputMethodManager::State(manager), manager_(manager) { 82 : MockInputMethodManagerImpl::State(manager), manager_(manager) {
83 input_method_extensions_.reset(new InputMethodDescriptors); 83 input_method_extensions_.reset(new InputMethodDescriptors);
84 } 84 }
85 85
86 void ChangeInputMethod(const std::string& input_method_id, 86 void ChangeInputMethod(const std::string& input_method_id,
87 bool show_message) override { 87 bool show_message) override {
88 manager_->last_input_method_id_ = input_method_id; 88 manager_->last_input_method_id_ = input_method_id;
89 // Do the same thing as BrowserStateMonitor::UpdateUserPreferences. 89 // Do the same thing as BrowserStateMonitor::UpdateUserPreferences.
90 const std::string current_input_method_on_pref = 90 const std::string current_input_method_on_pref =
91 manager_->current_->GetValue(); 91 manager_->current_->GetValue();
92 if (current_input_method_on_pref == input_method_id) 92 if (current_input_method_on_pref == input_method_id)
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 "Syncable values should have added local values on initialization."); 689 "Syncable values should have added local values on initialization.");
690 ExpectGlobalValues( 690 ExpectGlobalValues(
691 "es,en-US", 691 "es,en-US",
692 "xkb:es::spa,xkb:us::eng,xkb:ru::rus,xkb:xy::xyz," + 692 "xkb:es::spa,xkb:us::eng,xkb:ru::rus,xkb:xy::xyz," +
693 ToInputMethodIds("xkb:jp::jpn"), 693 ToInputMethodIds("xkb:jp::jpn"),
694 std::string(kIdentityIMEID) + "," + kUnknownIMEID); 694 std::string(kIdentityIMEID) + "," + kUnknownIMEID);
695 } 695 }
696 } 696 }
697 697
698 } // namespace chromeos 698 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698