OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/bind_helpers.h" | 5 #include "base/bind_helpers.h" |
| 6 #include "base/strings/utf_string_conversions.h" |
6 #include "chrome/browser/extensions/extension_browsertest.h" | 7 #include "chrome/browser/extensions/extension_browsertest.h" |
7 #include "chrome/browser/extensions/extension_test_message_listener.h" | 8 #include "chrome/browser/extensions/extension_test_message_listener.h" |
8 #include "chromeos/ime/component_extension_ime_manager.h" | 9 #include "chromeos/ime/component_extension_ime_manager.h" |
9 #include "chromeos/ime/composition_text.h" | 10 #include "chromeos/ime/composition_text.h" |
10 #include "chromeos/ime/input_method_descriptor.h" | 11 #include "chromeos/ime/input_method_descriptor.h" |
11 #include "chromeos/ime/input_method_manager.h" | 12 #include "chromeos/ime/input_method_manager.h" |
12 #include "content/public/test/browser_test_utils.h" | 13 #include "content/public/test/browser_test_utils.h" |
13 #include "content/public/test/test_utils.h" | 14 #include "content/public/test/test_utils.h" |
14 #include "extensions/common/manifest_handlers/background_info.h" | 15 #include "extensions/common/manifest_handlers/background_info.h" |
15 #include "ui/base/ime/chromeos/ime_bridge.h" | 16 #include "ui/base/ime/chromeos/ime_bridge.h" |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 EXPECT_TRUE(table.is_cursor_visible()); | 696 EXPECT_TRUE(table.is_cursor_visible()); |
696 | 697 |
697 // oritantation is kept as before. | 698 // oritantation is kept as before. |
698 EXPECT_EQ(ui::CandidateWindow::VERTICAL, table.orientation()); | 699 EXPECT_EQ(ui::CandidateWindow::VERTICAL, table.orientation()); |
699 | 700 |
700 // page size is kept as before. | 701 // page size is kept as before. |
701 EXPECT_EQ(7U, table.page_size()); | 702 EXPECT_EQ(7U, table.page_size()); |
702 | 703 |
703 ASSERT_EQ(4U, table.candidates().size()); | 704 ASSERT_EQ(4U, table.candidates().size()); |
704 | 705 |
705 EXPECT_EQ("CANDIDATE_1", table.candidates().at(0).value); | 706 EXPECT_EQ(base::UTF8ToUTF16("CANDIDATE_1"), |
| 707 table.candidates().at(0).value); |
706 | 708 |
707 EXPECT_EQ("CANDIDATE_2", table.candidates().at(1).value); | 709 EXPECT_EQ(base::UTF8ToUTF16("CANDIDATE_2"), |
708 EXPECT_EQ("LABEL_2", table.candidates().at(1).label); | 710 table.candidates().at(1).value); |
| 711 EXPECT_EQ(base::UTF8ToUTF16("LABEL_2"), table.candidates().at(1).label); |
709 | 712 |
710 EXPECT_EQ("CANDIDATE_3", table.candidates().at(2).value); | 713 EXPECT_EQ(base::UTF8ToUTF16("CANDIDATE_3"), |
711 EXPECT_EQ("LABEL_3", table.candidates().at(2).label); | 714 table.candidates().at(2).value); |
712 EXPECT_EQ("ANNOTACTION_3", table.candidates().at(2).annotation); | 715 EXPECT_EQ(base::UTF8ToUTF16("LABEL_3"), table.candidates().at(2).label); |
| 716 EXPECT_EQ(base::UTF8ToUTF16("ANNOTACTION_3"), |
| 717 table.candidates().at(2).annotation); |
713 | 718 |
714 EXPECT_EQ("CANDIDATE_4", table.candidates().at(3).value); | 719 EXPECT_EQ(base::UTF8ToUTF16("CANDIDATE_4"), |
715 EXPECT_EQ("LABEL_4", table.candidates().at(3).label); | 720 table.candidates().at(3).value); |
716 EXPECT_EQ("ANNOTACTION_4", table.candidates().at(3).annotation); | 721 EXPECT_EQ(base::UTF8ToUTF16("LABEL_4"), table.candidates().at(3).label); |
717 EXPECT_EQ("TITLE_4", table.candidates().at(3).description_title); | 722 EXPECT_EQ(base::UTF8ToUTF16("ANNOTACTION_4"), |
718 EXPECT_EQ("BODY_4", table.candidates().at(3).description_body); | 723 table.candidates().at(3).annotation); |
| 724 EXPECT_EQ(base::UTF8ToUTF16("TITLE_4"), |
| 725 table.candidates().at(3).description_title); |
| 726 EXPECT_EQ(base::UTF8ToUTF16("BODY_4"), |
| 727 table.candidates().at(3).description_body); |
719 } | 728 } |
720 { | 729 { |
721 SCOPED_TRACE("setCursorPosition test"); | 730 SCOPED_TRACE("setCursorPosition test"); |
722 mock_input_context->Reset(); | 731 mock_input_context->Reset(); |
723 mock_candidate_window->Reset(); | 732 mock_candidate_window->Reset(); |
724 | 733 |
725 const char set_cursor_position_test_script[] = | 734 const char set_cursor_position_test_script[] = |
726 "chrome.input.ime.setCursorPosition({" | 735 "chrome.input.ime.setCursorPosition({" |
727 " contextID: engineBridge.getFocusedContextID().contextID," | 736 " contextID: engineBridge.getFocusedContextID().contextID," |
728 " candidateID: 2" | 737 " candidateID: 2" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 } | 891 } |
883 } | 892 } |
884 | 893 |
885 IMEBridge::Get()->SetInputContextHandler(NULL); | 894 IMEBridge::Get()->SetInputContextHandler(NULL); |
886 IMEBridge::Get()->SetCandidateWindowHandler(NULL); | 895 IMEBridge::Get()->SetCandidateWindowHandler(NULL); |
887 } | 896 } |
888 | 897 |
889 } // namespace | 898 } // namespace |
890 } // namespace input_method | 899 } // namespace input_method |
891 } // namespace chromeos | 900 } // namespace chromeos |
OLD | NEW |