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

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: Initial approach for invoking UI tests. 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/base/invoke_ui_browser_test.h » ('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..07050fe84ae0bb2a69ee82bdc763c0ebc2f5d0a8 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"
#include "base/guid.h"
#include "base/location.h"
#include "base/macros.h"
@@ -15,6 +16,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/invoke_ui_browser_test.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/card_unmask_delegate.h"
#include "components/autofill/core/browser/ui/card_unmask_prompt_controller_impl.h"
@@ -95,6 +97,13 @@ class CardUnmaskPromptViewBrowserTest : public InProcessBrowserTest {
delegate_.reset(new TestCardUnmaskDelegate());
}
+ void ShowUI() {
+ controller()->ShowPrompt(
+ CreateCardUnmaskPromptView(controller(), contents()),
+ test::GetMaskedServerCard(), AutofillClient::UNMASK_FOR_AUTOFILL,
+ delegate()->GetWeakPtr());
+ }
+
void FreeDelegate() { delegate_.reset(); }
content::WebContents* contents() { return contents_; }
@@ -113,11 +122,37 @@ class CardUnmaskPromptViewBrowserTest : public InProcessBrowserTest {
DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViewBrowserTest);
};
+class InvokeCardUnmaskPromptViewBrowserTest
+ : public CardUnmaskPromptViewBrowserTest,
+ public InvokeUIBrowserTest {
+ public:
+ InvokeCardUnmaskPromptViewBrowserTest()
+ : CardUnmaskPromptViewBrowserTest(), InvokeUIBrowserTest() {}
+
+ void SetUpCommandLine(base::CommandLine* command_line) override {
+ SetCommandLineFlags(command_line);
+ }
+
+ void SetUp() override {
+ BeforeSetUp();
+ CardUnmaskPromptViewBrowserTest::SetUp();
+ }
+
+ void TearDownOnMainThread() override {
+ BeforeTearDownOnMainThread();
+ CardUnmaskPromptViewBrowserTest::TearDownOnMainThread();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(InvokeCardUnmaskPromptViewBrowserTest);
+};
+
+IN_PROC_BROWSER_TEST_F(InvokeCardUnmaskPromptViewBrowserTest, DISABLED_Invoke) {
+ ShowUI();
+}
+
IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, DisplayUI) {
- controller()->ShowPrompt(CreateCardUnmaskPromptView(controller(), contents()),
- test::GetMaskedServerCard(),
- AutofillClient::UNMASK_FOR_AUTOFILL,
- delegate()->GetWeakPtr());
+ ShowUI();
}
// TODO(bondd): bring up on Mac.
@@ -126,10 +161,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();
controller()->OnUnmaskResponse(base::ASCIIToUTF16("123"),
base::ASCIIToUTF16("10"),
base::ASCIIToUTF16("19"), false);
@@ -151,10 +183,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();
// 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/base/invoke_ui_browser_test.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698