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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc

Issue 2807653002: Ensure default dialog button focus remains after a dialog update. (Closed)
Patch Set: Showing widget for only the focus tests. Created 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/ui/views/extensions/extension_install_dialog_view.h" 5 #include "chrome/browser/ui/views/extensions/extension_install_dialog_view.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 ExtensionInstallDialogView::SetInstallButtonDelayForTesting(0); 210 ExtensionInstallDialogView::SetInstallButtonDelayForTesting(0);
211 ExtensionInstallPromptTestHelper helper; 211 ExtensionInstallPromptTestHelper helper;
212 views::DialogDelegateView* delegate_view = CreateAndShowPrompt(&helper); 212 views::DialogDelegateView* delegate_view = CreateAndShowPrompt(&helper);
213 213
214 // Check that dialog is visible. 214 // Check that dialog is visible.
215 EXPECT_TRUE(delegate_view->visible()); 215 EXPECT_TRUE(delegate_view->visible());
216 216
217 // Check initial button states. 217 // Check initial button states.
218 EXPECT_FALSE(delegate_view->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); 218 EXPECT_FALSE(delegate_view->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK));
219 EXPECT_TRUE(delegate_view->IsDialogButtonEnabled(ui::DIALOG_BUTTON_CANCEL)); 219 EXPECT_TRUE(delegate_view->IsDialogButtonEnabled(ui::DIALOG_BUTTON_CANCEL));
220 EXPECT_TRUE(delegate_view->GetInitiallyFocusedView()->HasFocus());
220 221
221 // Check OK button state after timeout to verify that it is re-enabled. 222 // Check OK button state after timeout to verify that it is re-enabled.
222 base::RunLoop().RunUntilIdle(); 223 base::RunLoop().RunUntilIdle();
223 EXPECT_TRUE(delegate_view->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); 224 EXPECT_TRUE(delegate_view->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK));
225
226 // Ensure default button (cancel) has focus.
227 EXPECT_TRUE(delegate_view->GetInitiallyFocusedView()->HasFocus());
224 delegate_view->Close(); 228 delegate_view->Close();
225 } 229 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_install_dialog_view.cc ('k') | ui/views/window/dialog_client_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698