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

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

Issue 250943008: Move enum MenuAnchorPosition to reduce deps on menu_item_view.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win Created 6 years, 7 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
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 20 matching lines...) Expand all
31 // shown or not. 31 // shown or not.
32 class TestMenuRunnerHandler : public MenuRunnerHandler { 32 class TestMenuRunnerHandler : public MenuRunnerHandler {
33 public: 33 public:
34 TestMenuRunnerHandler() : executed_(false) {} 34 TestMenuRunnerHandler() : executed_(false) {}
35 35
36 bool executed() const { return executed_; } 36 bool executed() const { return executed_; }
37 37
38 virtual MenuRunner::RunResult RunMenuAt(Widget* parent, 38 virtual MenuRunner::RunResult RunMenuAt(Widget* parent,
39 MenuButton* button, 39 MenuButton* button,
40 const gfx::Rect& bounds, 40 const gfx::Rect& bounds,
41 MenuItemView::AnchorPosition anchor, 41 ui::MenuAnchorPosition anchor,
42 ui::MenuSourceType source_type, 42 ui::MenuSourceType source_type,
43 int32 types) OVERRIDE { 43 int32 types) OVERRIDE {
44 executed_ = true; 44 executed_ = true;
45 return MenuRunner::NORMAL_EXIT; 45 return MenuRunner::NORMAL_EXIT;
46 } 46 }
47 47
48 private: 48 private:
49 bool executed_; 49 bool executed_;
50 50
51 DISALLOW_COPY_AND_ASSIGN(TestMenuRunnerHandler); 51 DISALLOW_COPY_AND_ASSIGN(TestMenuRunnerHandler);
(...skipping 632 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

Powered by Google App Engine
This is Rietveld 408576698