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

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: Created 3 years, 8 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
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_install_dialog_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 IN_PROC_BROWSER_TEST_F(ExtensionInstallDialogViewTest, InstallButtonDelay) { 209 IN_PROC_BROWSER_TEST_F(ExtensionInstallDialogViewTest, InstallButtonDelay) {
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));
Devlin 2017/04/07 18:13:04 Let's add that focus check here, too (the cancel b
Ackerman 2017/04/12 18:45:28 Done.
220 220
221 // Check OK button state after timeout to verify that it is re-enabled. 221 // Check OK button state after timeout to verify that it is re-enabled.
222 base::RunLoop().RunUntilIdle(); 222 base::RunLoop().RunUntilIdle();
223 EXPECT_TRUE(delegate_view->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); 223 EXPECT_TRUE(delegate_view->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK));
224
225 // Ensure default button (cancel) has focus.
226 EXPECT_TRUE(delegate_view->GetInitiallyFocusedView()->HasFocus());
224 delegate_view->Close(); 227 delegate_view->Close();
225 } 228 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_install_dialog_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698