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

Unified Diff: chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc

Issue 2716353003: [Extensions UI] Initially disabled OK button for extension install prompts. (Closed)
Patch Set: Removing cocoa changes, which will be done using a separate change. Created 3 years, 9 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
Index: chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc
index 0ac3d9395ca43204acb70a7187590c9c9f47ed6b..b2bbe4c1979ddc7622fa20df26cf71400a7ac367 100644
--- a/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc
+++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/macros.h"
+#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_icon_manager.h"
@@ -202,3 +203,20 @@ IN_PROC_BROWSER_TEST_F(ExtensionInstallDialogViewTest, NotifyDelegate) {
EXPECT_EQ(ExtensionInstallPrompt::Result::USER_CANCELED, helper.result());
}
}
+
+// Verifies that the "Add extension" button is disabled initally, but re-enabled
+// after a short time delay.
+IN_PROC_BROWSER_TEST_F(ExtensionInstallDialogViewTest, DelayInstalls) {
+ ExtensionInstallDialogView::SetInstallDelayForTesting(0);
+ ExtensionInstallPromptTestHelper helper;
+ views::DialogDelegateView* delegate_view = CreateAndShowPrompt(&helper);
Devlin 2017/03/31 22:21:41 Can we check that the dialog was, in fact, visible
Ackerman 2017/04/01 01:48:37 Done.
+
+ // Check initial button states.
+ EXPECT_FALSE(delegate_view->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK));
+ EXPECT_TRUE(delegate_view->IsDialogButtonEnabled(ui::DIALOG_BUTTON_CANCEL));
+
+ // Check OK button state after timeout to verify that it is re-enabled.
+ base::RunLoop().RunUntilIdle();
+ EXPECT_TRUE(delegate_view->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK));
+ delegate_view->Close();
+}

Powered by Google App Engine
This is Rietveld 408576698