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

Side by Side Diff: chromeos/dbus/ibus/ibus_input_context_client_unittest.cc

Issue 11783053: Clean Up: Remove ibus namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chromeos/dbus/ibus/ibus_input_context_client.cc ('k') | chromeos/dbus/ibus/ibus_lookup_table.h » ('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 (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 "chromeos/dbus/ibus/ibus_input_context_client.h" 5 #include "chromeos/dbus/ibus/ibus_input_context_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chromeos/dbus/ibus/ibus_constants.h" 10 #include "chromeos/dbus/ibus/ibus_constants.h"
11 #include "chromeos/dbus/ibus/ibus_text.h" 11 #include "chromeos/dbus/ibus/ibus_text.h"
12 #include "dbus/message.h" 12 #include "dbus/message.h"
13 #include "dbus/mock_bus.h" 13 #include "dbus/mock_bus.h"
14 #include "dbus/mock_object_proxy.h" 14 #include "dbus/mock_object_proxy.h"
15 #include "testing/gmock/include/gmock/gmock.h" 15 #include "testing/gmock/include/gmock/gmock.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 17
18 using ::testing::Invoke; 18 using ::testing::Invoke;
19 using ::testing::Return; 19 using ::testing::Return;
20 using ::testing::_; 20 using ::testing::_;
21 21
22 namespace chromeos { 22 namespace chromeos {
23 23
24 // TODO(nona): Remove after complete libibus removal. 24 // TODO(nona): Remove after complete libibus removal.
25 using chromeos::ibus::IBusText; 25 using chromeos::IBusText;
26 26
27 namespace { 27 namespace {
28 const char kObjectPath[] = "/org/freedesktop/IBus/InputContext_1010"; 28 const char kObjectPath[] = "/org/freedesktop/IBus/InputContext_1010";
29 29
30 // Following variables are used in callback expectations. 30 // Following variables are used in callback expectations.
31 const uint32 kCapabilities = 12345; 31 const uint32 kCapabilities = 12345;
32 const int32 kCursorX = 30; 32 const int32 kCursorX = 30;
33 const int32 kCursorY = 31; 33 const int32 kCursorY = 31;
34 const int32 kCursorWidth = 32; 34 const int32 kCursorWidth = 32;
35 const int32 kCursorHeight = 33; 35 const int32 kCursorHeight = 33;
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 const dbus::ObjectProxy::ErrorCallback& error_callback) { 258 const dbus::ObjectProxy::ErrorCallback& error_callback) {
259 EXPECT_EQ(ibus::input_context::kServiceInterface, 259 EXPECT_EQ(ibus::input_context::kServiceInterface,
260 method_call->GetInterface()); 260 method_call->GetInterface());
261 EXPECT_EQ(ibus::input_context::kSetSurroundingTextMethod, 261 EXPECT_EQ(ibus::input_context::kSetSurroundingTextMethod,
262 method_call->GetMember()); 262 method_call->GetMember());
263 dbus::MessageReader reader(method_call); 263 dbus::MessageReader reader(method_call);
264 std::string text; 264 std::string text;
265 uint32 cursor_pos = 0; 265 uint32 cursor_pos = 0;
266 uint32 anchor_pos = 0; 266 uint32 anchor_pos = 0;
267 267
268 EXPECT_TRUE(ibus::PopStringFromIBusText(&reader, &text)); 268 EXPECT_TRUE(PopStringFromIBusText(&reader, &text));
269 EXPECT_TRUE(reader.PopUint32(&cursor_pos)); 269 EXPECT_TRUE(reader.PopUint32(&cursor_pos));
270 EXPECT_TRUE(reader.PopUint32(&anchor_pos)); 270 EXPECT_TRUE(reader.PopUint32(&anchor_pos));
271 EXPECT_FALSE(reader.HasMoreData()); 271 EXPECT_FALSE(reader.HasMoreData());
272 272
273 EXPECT_EQ(kSurroundingText, text); 273 EXPECT_EQ(kSurroundingText, text);
274 EXPECT_EQ(kCursorPos, cursor_pos); 274 EXPECT_EQ(kCursorPos, cursor_pos);
275 EXPECT_EQ(kAnchorPos, anchor_pos); 275 EXPECT_EQ(kAnchorPos, anchor_pos);
276 276
277 message_loop_.PostTask(FROM_HERE, base::Bind(callback, response_)); 277 message_loop_.PostTask(FROM_HERE, base::Bind(callback, response_));
278 } 278 }
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 // Create response. 616 // Create response.
617 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); 617 scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty());
618 response_ = response.get(); 618 response_ = response.get();
619 619
620 // Call SetCursorLocation. 620 // Call SetCursorLocation.
621 client_->PropertyActivate(kPropertyKey, kPropertyState); 621 client_->PropertyActivate(kPropertyKey, kPropertyState);
622 // Run the message loop. 622 // Run the message loop.
623 message_loop_.RunUntilIdle(); 623 message_loop_.RunUntilIdle();
624 } 624 }
625 } // namespace chromeos 625 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/ibus/ibus_input_context_client.cc ('k') | chromeos/dbus/ibus/ibus_lookup_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698