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

Unified Diff: chrome/browser/chromeos/input_method/candidate_window_view_unittest.cc

Issue 10872011: Support label field in ExtensinoIME API. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/input_method/candidate_window.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/input_method/candidate_window_view_unittest.cc
diff --git a/chrome/browser/chromeos/input_method/candidate_window_view_unittest.cc b/chrome/browser/chromeos/input_method/candidate_window_view_unittest.cc
index c6b74839d8eb01a4997a4d41ad755c7d14fb6f4b..45539d155c6f0abcb21caa2e5a95f1e494919a97 100644
--- a/chrome/browser/chromeos/input_method/candidate_window_view_unittest.cc
+++ b/chrome/browser/chromeos/input_method/candidate_window_view_unittest.cc
@@ -287,6 +287,8 @@ TEST_F(CandidateWindowViewTest, ShortcutSettingTest) {
const char* kEmptyLabel = "";
const char* kDefaultVerticalLabel[] = { "1", "2", "3" };
const char* kDefaultHorizontalLabel[] = { "1.", "2.", "3." };
+ const char* kCustomizedLabel[] = { "a", "s", "d" };
+ const char* kExpectedHorizontalCustomizedLabel[] = { "a.", "s.", "d." };
views::Widget* widget = new views::Widget;
views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
@@ -397,6 +399,54 @@ TEST_F(CandidateWindowViewTest, ShortcutSettingTest) {
candidate_window_view.candidate_views_[i]);
}
}
+ {
+ SCOPED_TRACE("Vertical customized label case");
+ const size_t kPageSize = 3;
+ InputMethodLookupTable table;
+ ClearInputMethodLookupTable(kPageSize, &table);
+
+ table.orientation = InputMethodLookupTable::kVertical;
+ for (size_t i = 0; i < kPageSize; ++i) {
+ table.candidates.push_back(kSampleCandidate[i]);
+ table.annotations.push_back(kSampleAnnotation[i]);
+ table.labels.push_back(kCustomizedLabel[i]);
+ }
+
+ candidate_window_view.UpdateCandidates(table);
+
+ ASSERT_EQ(kPageSize, candidate_window_view.candidate_views_.size());
+ // Confirm actual labels not containing ".".
+ for (size_t i = 0; i < kPageSize; ++i) {
+ ExpectLabels(kCustomizedLabel[i],
+ kSampleCandidate[i],
+ kSampleAnnotation[i],
+ candidate_window_view.candidate_views_[i]);
+ }
+ }
+ {
+ SCOPED_TRACE("Horizontal customized label case");
+ const size_t kPageSize = 3;
+ InputMethodLookupTable table;
+ ClearInputMethodLookupTable(kPageSize, &table);
+
+ table.orientation = InputMethodLookupTable::kHorizontal;
+ for (size_t i = 0; i < kPageSize; ++i) {
+ table.candidates.push_back(kSampleCandidate[i]);
+ table.annotations.push_back(kSampleAnnotation[i]);
+ table.labels.push_back(kCustomizedLabel[i]);
+ }
+
+ candidate_window_view.UpdateCandidates(table);
+
+ ASSERT_EQ(kPageSize, candidate_window_view.candidate_views_.size());
+ // Confirm actual labels not containing ".".
+ for (size_t i = 0; i < kPageSize; ++i) {
+ ExpectLabels(kExpectedHorizontalCustomizedLabel[i],
+ kSampleCandidate[i],
+ kSampleAnnotation[i],
+ candidate_window_view.candidate_views_[i]);
+ }
+ }
// We should call CloseNow method, otherwise this test will leak memory.
widget->CloseNow();
@@ -530,7 +580,7 @@ TEST_F(CandidateWindowViewTest, DoNotChangeRowHeightWithLabelSwitchTest) {
const char kSampleShortcut3[] = "C";
const char kSampleAnnotation1[] = "Sample Annotation 1";
- const char kSampleAnnotation2[] = "\xE3\x81\x82"; // multi byte string.
+ const char kSampleAnnotation2[] = "\xE3\x81\x82"; // multi byte string.
const char kSampleAnnotation3[] = "......";
// For testing, we have to prepare empty widget.
« no previous file with comments | « chrome/browser/chromeos/input_method/candidate_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698