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

Side by Side Diff: ui/base/ime/input_method_auralinux_unittest.cc

Issue 1278973003: Revert of Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « ui/aura/bench/bench_main.cc ('k') | ui/events/devices/x11/touch_factory_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/base/ime/input_method_auralinux.h" 5 #include "ui/base/ime/input_method_auralinux.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "base/strings/string_split.h" 8 #include "base/strings/string_split.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 protected: 82 protected:
83 bool DispatchKeyEvent(const ui::KeyEvent& key_event) override { 83 bool DispatchKeyEvent(const ui::KeyEvent& key_event) override {
84 if (!is_sync_mode_) { 84 if (!is_sync_mode_) {
85 actions_.clear(); 85 actions_.clear();
86 return eat_key_; 86 return eat_key_;
87 } 87 }
88 88
89 for (const auto& action : actions_) { 89 for (const auto& action : actions_) {
90 std::vector<base::string16> parts = base::SplitString( 90 std::vector<base::string16> parts;
91 action, base::string16(1, ':'), base::TRIM_WHITESPACE, 91 base::SplitString(action, L':', &parts);
92 base::SPLIT_WANT_ALL);
93 base::char16 id = parts[0][0]; 92 base::char16 id = parts[0][0];
94 base::string16 param; 93 base::string16 param;
95 if (parts.size() > 1) 94 if (parts.size() > 1)
96 param = parts[1]; 95 param = parts[1];
97 if (id == kActionCommit) { 96 if (id == kActionCommit) {
98 delegate_->OnCommit(param); 97 delegate_->OnCommit(param);
99 } else if (id == kActionCompositionStart) { 98 } else if (id == kActionCompositionStart) {
100 delegate_->OnPreeditStart(); 99 delegate_->OnPreeditStart();
101 } else if (id == kActionCompositionUpdate) { 100 } else if (id == kActionCompositionUpdate) {
102 CompositionText comp; 101 CompositionText comp;
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 input_method_auralinux_->DispatchKeyEvent(&key); 751 input_method_auralinux_->DispatchKeyEvent(&key);
753 752
754 test_result_->ExpectAction("textinput:c"); 753 test_result_->ExpectAction("textinput:c");
755 test_result_->ExpectAction("keydown:65"); 754 test_result_->ExpectAction("keydown:65");
756 test_result_->ExpectAction("keypress:65"); 755 test_result_->ExpectAction("keypress:65");
757 test_result_->Verify(); 756 test_result_->Verify();
758 } 757 }
759 758
760 } // namespace 759 } // namespace
761 } // namespace ui 760 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/bench/bench_main.cc ('k') | ui/events/devices/x11/touch_factory_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698