Chromium Code Reviews| Index: chromeos/dbus/ibus/ibus_text_unittest.cc |
| diff --git a/chromeos/dbus/ibus/ibus_text_unittest.cc b/chromeos/dbus/ibus/ibus_text_unittest.cc |
| index b3df566b4fa49311fd1140360cd95861effd396b..6ae44cbe9a734171a91439828a6f72084572616e 100644 |
| --- a/chromeos/dbus/ibus/ibus_text_unittest.cc |
| +++ b/chromeos/dbus/ibus/ibus_text_unittest.cc |
| @@ -146,7 +146,8 @@ TEST(IBusTextTest, ReadAnnotationFieldTest) { |
| TEST(IBusTextTest, ReadDescriptionFieldTest) { |
| const char kSampleText[] = "Sample Text"; |
| - const char kSampleDescriptionText[] = "Sample Description"; |
| + const char kSampleDescriptionTitleText[] = "Sample Description Title"; |
| + const char kSampleDescriptionBodyText[] = "Sample Description Body"; |
| // Create IBusLookupTable. |
| scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); |
| @@ -160,19 +161,34 @@ TEST(IBusTextTest, ReadDescriptionFieldTest) { |
| // Write attachment field. |
|
satorux1
2012/11/08 08:39:30
Maybe
// Write attachment fields.
because we ha
Seigo Nonaka
2012/11/12 06:13:11
Sure will do.
On 2012/11/08 08:39:30, satorux1 wro
|
| dbus::MessageWriter attachment_array_writer(NULL); |
| contents_writer.OpenArray("{sv}", &attachment_array_writer); |
| - dbus::MessageWriter entry_writer(NULL); |
| - attachment_array_writer.OpenDictEntry(&entry_writer); |
| - entry_writer.AppendString("description"); |
| - dbus::MessageWriter variant_writer(NULL); |
| - entry_writer.OpenVariant("v", &variant_writer); |
| - dbus::MessageWriter sub_variant_writer(NULL); |
| - variant_writer.OpenVariant("s", &sub_variant_writer); |
| - sub_variant_writer.AppendString(kSampleDescriptionText); |
| + |
| + // Write description title field. |
| + dbus::MessageWriter title_entry_writer(NULL); |
| + attachment_array_writer.OpenDictEntry(&title_entry_writer); |
| + title_entry_writer.AppendString("description_title"); |
| + dbus::MessageWriter title_variant_writer(NULL); |
| + title_entry_writer.OpenVariant("v", &title_variant_writer); |
| + dbus::MessageWriter title_sub_variant_writer(NULL); |
| + title_variant_writer.OpenVariant("s", &title_sub_variant_writer); |
| + title_sub_variant_writer.AppendString(kSampleDescriptionTitleText); |
| + title_variant_writer.CloseContainer(&title_sub_variant_writer); |
| + title_entry_writer.CloseContainer(&title_variant_writer); |
| + attachment_array_writer.CloseContainer(&title_entry_writer); |
| + |
| + // Write description body field. |
| + dbus::MessageWriter body_entry_writer(NULL); |
| + attachment_array_writer.OpenDictEntry(&body_entry_writer); |
| + body_entry_writer.AppendString("description_body"); |
| + dbus::MessageWriter body_variant_writer(NULL); |
| + body_entry_writer.OpenVariant("v", &body_variant_writer); |
| + dbus::MessageWriter body_sub_variant_writer(NULL); |
| + body_variant_writer.OpenVariant("s", &body_sub_variant_writer); |
| + body_sub_variant_writer.AppendString(kSampleDescriptionBodyText); |
| + body_variant_writer.CloseContainer(&body_sub_variant_writer); |
| + body_entry_writer.CloseContainer(&body_variant_writer); |
| + attachment_array_writer.CloseContainer(&body_entry_writer); |
|
satorux1
2012/11/08 08:39:30
Hmm, adding an attachment field seems to be a lot
Seigo Nonaka
2012/11/12 06:13:11
Sure, and I found that we need supporting writing
|
| // Close attachment field container. |
| - variant_writer.CloseContainer(&sub_variant_writer); |
| - entry_writer.CloseContainer(&variant_writer); |
| - attachment_array_writer.CloseContainer(&entry_writer); |
| contents_writer.CloseContainer(&attachment_array_writer); |
| // Write IBusText contents. |
| @@ -195,7 +211,8 @@ TEST(IBusTextTest, ReadDescriptionFieldTest) { |
| // Check values. |
| EXPECT_EQ(kSampleText, ibus_text.text()); |
| - EXPECT_EQ(kSampleDescriptionText, ibus_text.description()); |
| + EXPECT_EQ(kSampleDescriptionTitleText, ibus_text.description_title()); |
| + EXPECT_EQ(kSampleDescriptionBodyText, ibus_text.description_body()); |
| } |
| } // namespace ibus |