diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 15:06:10 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 15:06:10 +0000 |
commit | a4ac1b744e4c0caef3e2a4aec035fb5ed61d245a (patch) | |
tree | 4d3e1647258d553a2eda5b46265c5ebe5944c597 /views/focus | |
parent | 59a5d6da97c776fb6c25b88eeb9d853283bc5f13 (diff) | |
download | chromium_src-a4ac1b744e4c0caef3e2a4aec035fb5ed61d245a.zip chromium_src-a4ac1b744e4c0caef3e2a4aec035fb5ed61d245a.tar.gz chromium_src-a4ac1b744e4c0caef3e2a4aec035fb5ed61d245a.tar.bz2 |
Review URL: http://codereview.chromium.org/150051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19582 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/focus')
-rw-r--r-- | views/focus/focus_manager_unittest.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/views/focus/focus_manager_unittest.cc b/views/focus/focus_manager_unittest.cc index cc56271..4f50527 100644 --- a/views/focus/focus_manager_unittest.cc +++ b/views/focus/focus_manager_unittest.cc @@ -18,6 +18,7 @@ #include "views/controls/button/native_button.h" #include "views/controls/button/radio_button.h" #include "views/controls/combobox/combobox.h" +#include "views/controls/combobox/native_combobox_wrapper.h" #include "views/controls/label.h" #include "views/controls/link.h" #include "views/controls/scroll_view.h" @@ -725,6 +726,20 @@ class TestTextfield : public Textfield { } }; +class TestCombobox : public Combobox, public Combobox::Model { + public: + TestCombobox() : Combobox(this) { } + virtual HWND TestGetNativeComponent() { + return native_wrapper_->GetTestingHandle(); + } + virtual int GetItemCount(Combobox* source) { + return 10; + } + virtual std::wstring GetItemAt(Combobox* source, int index) { + return L"Hello combo"; + } +}; + class TestTabbedPane : public TabbedPane { public: TestTabbedPane() { } @@ -740,6 +755,7 @@ TEST_F(FocusManagerTest, FocusNativeControls) { TestCheckbox* checkbox = new TestCheckbox(L"Checkbox"); TestRadioButton* radio_button = new TestRadioButton(L"RadioButton"); TestTextfield* textfield = new TestTextfield(); + TestCombobox* combobox = new TestCombobox(); TestTabbedPane* tabbed_pane = new TestTabbedPane(); TestNativeButton* tab_button = new TestNativeButton(L"tab button"); @@ -747,6 +763,7 @@ TEST_F(FocusManagerTest, FocusNativeControls) { content_view_->AddChildView(checkbox); content_view_->AddChildView(radio_button); content_view_->AddChildView(textfield); + content_view_->AddChildView(combobox); content_view_->AddChildView(tabbed_pane); tabbed_pane->AddTab(L"Awesome tab", tab_button); @@ -764,6 +781,9 @@ TEST_F(FocusManagerTest, FocusNativeControls) { ::SendMessage(textfield->TestGetNativeComponent(), WM_SETFOCUS, NULL, NULL); EXPECT_EQ(textfield, GetFocusManager()->GetFocusedView()); + ::SendMessage(combobox->TestGetNativeComponent(), WM_SETFOCUS, NULL, NULL); + EXPECT_EQ(combobox, GetFocusManager()->GetFocusedView()); + ::SendMessage(tabbed_pane->TestGetNativeControlHWND(), WM_SETFOCUS, NULL, NULL); EXPECT_EQ(tabbed_pane, GetFocusManager()->GetFocusedView()); |