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 // TODO(nona): Add more tests. | 4 // TODO(nona): Add more tests. |
5 | 5 |
6 #include "chromeos/dbus/ibus/ibus_lookup_table.h" | 6 #include "chromeos/dbus/ibus/ibus_lookup_table.h" |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "chromeos/dbus/ibus/ibus_object.h" | 13 #include "chromeos/dbus/ibus/ibus_object.h" |
14 #include "chromeos/dbus/ibus/ibus_text.h" | 14 #include "chromeos/dbus/ibus/ibus_text.h" |
15 #include "dbus/message.h" | 15 #include "dbus/message.h" |
16 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 namespace chromeos { | 19 namespace chromeos { |
20 // TODO(nona): Remove ibus namespace after complete libibus removal. | |
21 namespace ibus { | |
22 | 20 |
23 TEST(IBusLookupTable, WriteReadTest) { | 21 TEST(IBusLookupTable, WriteReadTest) { |
24 const char kSampleText1[] = "Sample Text 1"; | 22 const char kSampleText1[] = "Sample Text 1"; |
25 const char kSampleText2[] = "Sample Text 2"; | 23 const char kSampleText2[] = "Sample Text 2"; |
26 const char kSampleLabel1[] = "Sample Label 1"; | 24 const char kSampleLabel1[] = "Sample Label 1"; |
27 const char kSampleLabel2[] = "Sample Label 2"; | 25 const char kSampleLabel2[] = "Sample Label 2"; |
28 const uint32 kPageSize = 11; | 26 const uint32 kPageSize = 11; |
29 const uint32 kCursorPosition = 12; | 27 const uint32 kCursorPosition = 12; |
30 const bool kIsCursorVisible = true; | 28 const bool kIsCursorVisible = true; |
31 const IBusLookupTable::Orientation kOrientation = | 29 const IBusLookupTable::Orientation kOrientation = |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 entry.value = kSampleString; | 312 entry.value = kSampleString; |
315 entry.label = kSampleString; | 313 entry.label = kSampleString; |
316 entry.annotation = kSampleString; | 314 entry.annotation = kSampleString; |
317 entry.description_title = kSampleString; | 315 entry.description_title = kSampleString; |
318 entry.description_body = kSampleString; | 316 entry.description_body = kSampleString; |
319 table1.mutable_candidates()->push_back(entry); | 317 table1.mutable_candidates()->push_back(entry); |
320 | 318 |
321 table2.CopyFrom(table1); | 319 table2.CopyFrom(table1); |
322 EXPECT_TRUE(table1.IsEqual(table2)); | 320 EXPECT_TRUE(table1.IsEqual(table2)); |
323 } | 321 } |
324 } // namespace ibus | |
325 } // namespace chromeos | 322 } // namespace chromeos |
OLD | NEW |