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

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: Review comments. 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 | chrome/test/BUILD.gn » ('j') | chrome/test/BUILD.gn » ('J')
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..c1c752c95f3430fa2c48d5c23aaf26d101a36613 100644
--- a/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc
+++ b/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/bind.h"
+#include "base/command_line.h"
tapted 2016/10/17 23:44:50 nit: unused
Patti Lor 2016/10/18 03:44:25 Done.
#include "base/guid.h"
#include "base/location.h"
#include "base/macros.h"
@@ -22,6 +23,7 @@
#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/use_interactive_test_case.h"
namespace autofill {
@@ -95,6 +97,15 @@ class CardUnmaskPromptViewBrowserTest : public InProcessBrowserTest {
delegate_.reset(new TestCardUnmaskDelegate());
}
+ void ShowUI(bool expired) {
+ CardUnmaskPromptView* dialog =
+ CreateCardUnmaskPromptView(controller(), contents());
+ CreditCard cc =
+ expired ? test::GetMaskedServerCard() : test::GetMaskedServerCardAmex();
+ controller()->ShowPrompt(dialog, cc, AutofillClient::UNMASK_FOR_AUTOFILL,
+ delegate()->GetWeakPtr());
+ }
+
void FreeDelegate() { delegate_.reset(); }
content::WebContents* contents() { return contents_; }
@@ -113,11 +124,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(true);
+ ::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(false);
+ ::test::RunTestInteractively();
+}
+
IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, DisplayUI) {
- controller()->ShowPrompt(CreateCardUnmaskPromptView(controller(), contents()),
- test::GetMaskedServerCard(),
- AutofillClient::UNMASK_FOR_AUTOFILL,
- delegate()->GetWeakPtr());
+ ShowUI(true);
}
// TODO(bondd): bring up on Mac.
@@ -126,10 +149,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(true);
controller()->OnUnmaskResponse(base::ASCIIToUTF16("123"),
base::ASCIIToUTF16("10"),
base::ASCIIToUTF16("19"), false);
@@ -151,10 +171,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(true);
// Simulate AutofillManager (the delegate in production code) being destroyed
// before CardUnmaskPromptViewBridge::OnConstrainedWindowClosed() is called.
FreeDelegate();
« no previous file with comments | « no previous file | chrome/test/BUILD.gn » ('j') | chrome/test/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698