Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 } |
| OLD | NEW |