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

Unified Diff: chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc

Issue 2382963002: Views: Add two disabled tests for invoking the CC unmask prompt dialog. (Closed)
Patch Set: Rebase? Created 4 years, 2 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 | « no previous file | ui/base/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc
diff --git a/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc b/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc
index deb01c867569f3050df80917e8a555dadf902b28..2e650b79b7cca62952deaf63caef8efea1645aa4 100644
--- a/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc
+++ b/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc
@@ -22,6 +22,13 @@
#include "content/public/browser/browser_context.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/test_utils.h"
+#include "ui/base/test/user_interactive_test_case.h"
+
+namespace {
+
+enum CreditCardExpiry { EXPIRED, VALID };
Ilya Sherman 2016/10/20 01:13:35 nit: Please use enum class, since that seems to be
Patti Lor 2016/10/20 04:56:02 Oops, thanks for catching these in time! Fixed.
+
+} // namespace
Ilya Sherman 2016/10/20 01:13:35 nit: There's already an anonymous namespace below
Patti Lor 2016/10/20 04:56:02 Done.
namespace autofill {
@@ -95,6 +102,16 @@ class CardUnmaskPromptViewBrowserTest : public InProcessBrowserTest {
delegate_.reset(new TestCardUnmaskDelegate());
}
+ void ShowUI(CreditCardExpiry expired) {
+ CardUnmaskPromptView* dialog =
+ CreateCardUnmaskPromptView(controller(), contents());
+ CreditCard card = (expired == CreditCardExpiry::EXPIRED)
+ ? test::GetMaskedServerCard()
+ : test::GetMaskedServerCardAmex();
+ controller()->ShowPrompt(dialog, card, AutofillClient::UNMASK_FOR_AUTOFILL,
+ delegate()->GetWeakPtr());
+ }
+
void FreeDelegate() { delegate_.reset(); }
content::WebContents* contents() { return contents_; }
@@ -113,11 +130,23 @@ class CardUnmaskPromptViewBrowserTest : public InProcessBrowserTest {
DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViewBrowserTest);
};
+// Permanently disabled test used to invoke the UI for the card unmask prompt
+// with an expired credit card, which shows additional month/year controls.
+IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest,
+ DISABLED_InvokeExpired) {
+ ShowUI(CreditCardExpiry::EXPIRED);
+ ::test::RunTestInteractively();
+}
+
+// Permanently disabled test used to invoke the UI for the card unmask prompt
+// with a valid credit card, which only shows the CCV Textfield.
+IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, DISABLED_InvokeValid) {
+ ShowUI(CreditCardExpiry::VALID);
+ ::test::RunTestInteractively();
+}
+
IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, DisplayUI) {
- controller()->ShowPrompt(CreateCardUnmaskPromptView(controller(), contents()),
- test::GetMaskedServerCard(),
- AutofillClient::UNMASK_FOR_AUTOFILL,
- delegate()->GetWeakPtr());
+ ShowUI(CreditCardExpiry::EXPIRED);
}
// TODO(bondd): bring up on Mac.
@@ -126,10 +155,7 @@ IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, DisplayUI) {
// message is showing.
IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest,
EarlyCloseAfterSuccess) {
- controller()->ShowPrompt(CreateCardUnmaskPromptView(controller(), contents()),
- test::GetMaskedServerCard(),
- AutofillClient::UNMASK_FOR_AUTOFILL,
- delegate()->GetWeakPtr());
+ ShowUI(CreditCardExpiry::EXPIRED);
controller()->OnUnmaskResponse(base::ASCIIToUTF16("123"),
base::ASCIIToUTF16("10"),
base::ASCIIToUTF16("19"), false);
@@ -151,10 +177,7 @@ IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest,
// https://crbug.com/484376
IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest,
CloseTabWhileDialogShowing) {
- controller()->ShowPrompt(CreateCardUnmaskPromptView(controller(), contents()),
- test::GetMaskedServerCard(),
- AutofillClient::UNMASK_FOR_AUTOFILL,
- delegate()->GetWeakPtr());
+ ShowUI(CreditCardExpiry::EXPIRED);
// Simulate AutofillManager (the delegate in production code) being destroyed
// before CardUnmaskPromptViewBridge::OnConstrainedWindowClosed() is called.
FreeDelegate();
« no previous file with comments | « no previous file | ui/base/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698