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

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: Addressing Devlin's comments. 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
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_install_dialog_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3ac2aad73a91ff6b16669548fa43c09893c00b2d 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,23 @@ 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, InstallButtonDelay) {
+ ExtensionInstallDialogView::SetInstallButtonDelayForTesting(0);
+ ExtensionInstallPromptTestHelper helper;
+ views::DialogDelegateView* delegate_view = CreateAndShowPrompt(&helper);
+
+ // Check that dialog is visible.
+ EXPECT_TRUE(delegate_view->visible());
+
+ // 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();
+}
« 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