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

Unified Diff: views/focus/focus_manager_unittest.cc

Issue 151002: Fixing focus problems with the combobox (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 6 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 | « views/controls/tree/tree_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/focus/focus_manager_unittest.cc
===================================================================
--- views/focus/focus_manager_unittest.cc (revision 19470)
+++ views/focus/focus_manager_unittest.cc (working copy)
@@ -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 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 @@
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 @@
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 @@
::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());
« no previous file with comments | « views/controls/tree/tree_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698