summaryrefslogtreecommitdiffstats
path: root/views/focus
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-07 18:25:51 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-07 18:25:51 +0000
commit445873cae45fd143a1f1fd936a578b576b6118ec (patch)
tree40fc63a337afcac36dfce98fabfdd184c26bddb7 /views/focus
parenta3f3079c3fa68dc79831183af4aa7ef79854f2ec (diff)
downloadchromium_src-445873cae45fd143a1f1fd936a578b576b6118ec.zip
chromium_src-445873cae45fd143a1f1fd936a578b576b6118ec.tar.gz
chromium_src-445873cae45fd143a1f1fd936a578b576b6118ec.tar.bz2
Fixes two related focus bugs on views/gtk:
. Focus was inadvertently getting cleared when a window was shown because the focus-in event is received asynchronously. . In some situations we get multiple focus-out events in a row, this caused us to clear out who we thought would have focus. BUG=31140, 31130 TEST=see bugs Review URL: http://codereview.chromium.org/521045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35714 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/focus')
-rw-r--r--views/focus/focus_manager_unittest.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/views/focus/focus_manager_unittest.cc b/views/focus/focus_manager_unittest.cc
index bab3cf1..548989a 100644
--- a/views/focus/focus_manager_unittest.cc
+++ b/views/focus/focus_manager_unittest.cc
@@ -839,6 +839,9 @@ TEST_F(FocusManagerTest, FocusNativeControls) {
// Test that when activating/deactivating the top window, the focus is stored/
// restored properly.
TEST_F(FocusManagerTest, FocusStoreRestore) {
+ // Simulate an activate, otherwise the deactivate isn't going to do anything.
+ SimulateActivateWindow();
+
NativeButton* button = new NativeButton(NULL, L"Press me");
View* view = new View();
view->SetFocusable(true);