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

Side by Side Diff: ui/views/controls/combobox/combobox_unittest.cc

Issue 376703002: MacViews: Tweak ComboboxTest.GetTextForRowTest to get it to pass. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/views/controls/combobox/combobox.h" 5 #include "ui/views/controls/combobox/combobox.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 EXPECT_EQ(6, combobox_->selected_index()); 424 EXPECT_EQ(6, combobox_->selected_index());
425 SendKeyEvent(ui::VKEY_PRIOR); 425 SendKeyEvent(ui::VKEY_PRIOR);
426 EXPECT_EQ(0, combobox_->selected_index()); 426 EXPECT_EQ(0, combobox_->selected_index());
427 SendKeyEvent(ui::VKEY_END); 427 SendKeyEvent(ui::VKEY_END);
428 EXPECT_EQ(6, combobox_->selected_index()); 428 EXPECT_EQ(6, combobox_->selected_index());
429 } 429 }
430 430
431 TEST_F(ComboboxTest, GetTextForRowTest) { 431 TEST_F(ComboboxTest, GetTextForRowTest) {
432 InitCombobox(); 432 InitCombobox();
433 std::set<int> separators; 433 std::set<int> separators;
434 separators.insert(0);
msw 2014/07/07 23:37:22 I think it was our intention here to ensure that a
435 separators.insert(1); 434 separators.insert(1);
435 separators.insert(2);
436 separators.insert(9); 436 separators.insert(9);
437 model_->SetSeparators(separators); 437 model_->SetSeparators(separators);
438 for (int i = 0; i < combobox_->GetRowCount(); ++i) { 438 for (int i = 0; i < combobox_->GetRowCount(); ++i) {
439 if (separators.count(i) != 0) { 439 if (separators.count(i) != 0) {
440 EXPECT_TRUE(combobox_->GetTextForRow(i).empty()) << i; 440 EXPECT_TRUE(combobox_->GetTextForRow(i).empty()) << i;
441 } else { 441 } else {
442 EXPECT_EQ(ASCIIToUTF16(i % 2 == 0 ? "PEANUT BUTTER" : "JELLY"), 442 EXPECT_EQ(ASCIIToUTF16(i % 2 == 0 ? "PEANUT BUTTER" : "JELLY"),
443 combobox_->GetTextForRow(i)) << i; 443 combobox_->GetTextForRow(i)) << i;
444 } 444 }
445 } 445 }
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 combobox_->OnBlur(); 684 combobox_->OnBlur();
685 685
686 // Type the first character of "PEANUT BUTTER", which should change the 686 // Type the first character of "PEANUT BUTTER", which should change the
687 // selected index and perform an action. 687 // selected index and perform an action.
688 combobox_->GetTextInputClient()->InsertChar('P', ui::EF_NONE); 688 combobox_->GetTextInputClient()->InsertChar('P', ui::EF_NONE);
689 EXPECT_EQ(2, listener.actions_performed()); 689 EXPECT_EQ(2, listener.actions_performed());
690 EXPECT_EQ(2, listener.perform_action_index()); 690 EXPECT_EQ(2, listener.perform_action_index());
691 } 691 }
692 692
693 } // namespace views 693 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698