Commit fb00da1f authored by Reid Kleckner's avatar Reid Kleckner Committed by Commit Bot

Revert "Add integration test for butter credit card save dialog"

This reverts commit 0bfee16c.

Reason for revert:
New test times out on Linux official builds and clang ToT builds:
https://uberchromegw.corp.google.com/i/official.desktop.continuous/builders/linux64%20trunk/builds/15834
https://ci.chromium.org/p/chromium/builders/ci/ToTLinux/5415

Original change's description:
> Add integration test for butter credit card save dialog
> 
> Tests upload scenario and local save because payments rejected the card.
> 
> Bug: 876301,915216
> Change-Id: I8c73ea867872dc99fee3f2dcbb10bb0a6f123472
> Reviewed-on: https://chromium-review.googlesource.com/c/1486336
> Commit-Queue: Florian Uunk <feuunk@chromium.org>
> Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
> Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#635529}

TBR=vasilii@chromium.org,sebsg@chromium.org,feuunk@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 876301, 915216
Change-Id: I49b54f21b0286b946be2b72fd26d3b98fac08067
Reviewed-on: https://chromium-review.googlesource.com/c/1497185Reviewed-by: default avatarReid Kleckner <rnk@chromium.org>
Commit-Queue: Reid Kleckner <rnk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636928}
parent f6184848
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
#include "chrome/browser/sync/test/integration/secondary_account_helper.h"
#include "chrome/browser/sync/test/integration/sync_test.h" #include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/browser/ui/autofill/chrome_autofill_client.h" #include "chrome/browser/ui/autofill/chrome_autofill_client.h"
#include "chrome/browser/ui/autofill/popup_constants.h" #include "chrome/browser/ui/autofill/popup_constants.h"
...@@ -46,7 +45,6 @@ ...@@ -46,7 +45,6 @@
#include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/network_session_configurator/common/network_switches.h" #include "components/network_session_configurator/common/network_switches.h"
#include "components/signin/core/browser/signin_buildflags.h" #include "components/signin/core/browser/signin_buildflags.h"
#include "components/sync/driver/sync_driver_switches.h"
#include "components/sync/test/fake_server/fake_server.h" #include "components/sync/test/fake_server/fake_server.h"
#include "components/sync/test/fake_server/fake_server_network_resources.h" #include "components/sync/test/fake_server/fake_server_network_resources.h"
#include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_observer.h"
...@@ -1264,119 +1262,6 @@ IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest, ...@@ -1264,119 +1262,6 @@ IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest,
AutofillMetrics::SAVE_CARD_PROMPT_END_ACCEPTED, 1); AutofillMetrics::SAVE_CARD_PROMPT_END_ACCEPTED, 1);
} }
// On ChromeOS, the test profile starts with a primary account already set, so
// sync-the-transport tests don't apply.
#if !defined(OS_CHROMEOS)
// Sets up Chrome with Sync-the-transport mode enabled, with the Wallet datatype
// as enabled type.
class SaveCardBubbleViewsSyncTransportFullFormBrowserTest
: public SaveCardBubbleViewsFullFormBrowserTest {
protected:
SaveCardBubbleViewsSyncTransportFullFormBrowserTest() = default;
void SetUpInProcessBrowserTestFixture() override {
// Set up Sync the transport mode, so that sync starts on content-area
// signins. Also add wallet data type to the list of enabled types.
scoped_feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kAutofillUpstream,
features::kAutofillEnableAccountWalletStorage,
switches::kSyncSupportSecondaryAccount},
/*disabled_features=*/{});
test_signin_client_factory_ =
secondary_account_helper::SetUpSigninClient(test_url_loader_factory());
SaveCardBubbleViewsFullFormBrowserTest::SetUpInProcessBrowserTestFixture();
}
private:
secondary_account_helper::ScopedSigninClientFactory
test_signin_client_factory_;
DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleViewsSyncTransportFullFormBrowserTest);
};
// Tests the upload save bubble. Ensures that clicking the [Save] button
// successfully causes the bubble to go away and sends an UploadCardRequest RPC
// to Google Payments.
IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsSyncTransportFullFormBrowserTest,
Upload_TransportMode_ClickingSaveClosesBubble) {
// Signing in (without making the account Chrome's primary one or explicitly
// setting up Sync) causes the Sync machinery to start up in standalone
// transport mode.
secondary_account_helper::SignInSecondaryAccount(
browser()->profile(), test_url_loader_factory(), "user@gmail.com");
ASSERT_NE(syncer::SyncService::TransportState::DISABLED,
harness_->service()->GetTransportState());
ASSERT_TRUE(harness_->AwaitSyncTransportActive());
ASSERT_EQ(syncer::SyncService::TransportState::ACTIVE,
harness_->service()->GetTransportState());
ASSERT_FALSE(harness_->service()->IsSyncFeatureEnabled());
// Set up the Payments RPC.
SetUploadDetailsRpcPaymentsAccepts();
// Submitting the form should show the upload save bubble and legal footer.
// (Must wait for response from Payments before accessing the controller.)
ResetEventWaiterForSequence(
{DialogEvent::REQUESTED_UPLOAD_SAVE,
DialogEvent::RECEIVED_GET_UPLOAD_DETAILS_RESPONSE});
NavigateTo(kCreditCardUploadForm);
FillAndSubmitForm();
WaitForObservedEvent();
EXPECT_TRUE(
FindViewInBubbleById(DialogViewId::MAIN_CONTENT_VIEW_UPLOAD)->visible());
EXPECT_TRUE(FindViewInBubbleById(DialogViewId::FOOTNOTE_VIEW)->visible());
// Clicking [Save] should accept and close it, then send an UploadCardRequest
// to Google Payments.
ResetEventWaiterForSequence({DialogEvent::SENT_UPLOAD_CARD_REQUEST});
base::HistogramTester histogram_tester;
ClickOnDialogViewWithIdAndWait(DialogViewId::OK_BUTTON);
// UMA should have recorded bubble acceptance.
histogram_tester.ExpectUniqueSample(
"Autofill.SaveCreditCardPrompt.Upload.FirstShow",
AutofillMetrics::SAVE_CARD_PROMPT_END_ACCEPTED, 1);
}
// Tests the upload save logic in Butter mode. Ensures that Chrome offers a
// local save when the data is complete, even if Payments rejects the data.
IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsSyncTransportFullFormBrowserTest,
Logic_ShouldOfferLocalSaveIfPaymentsDeclines) {
// Signing in (without making the account Chrome's primary one or explicitly
// setting up Sync) causes the Sync machinery to start up in standalone
// transport mode.
secondary_account_helper::SignInSecondaryAccount(
browser()->profile(), test_url_loader_factory(), "user@gmail.com");
ASSERT_NE(syncer::SyncService::TransportState::DISABLED,
harness_->service()->GetTransportState());
ASSERT_TRUE(harness_->AwaitSyncTransportActive());
ASSERT_EQ(syncer::SyncService::TransportState::ACTIVE,
harness_->service()->GetTransportState());
ASSERT_FALSE(harness_->service()->IsSyncFeatureEnabled());
// Set up the Payments RPC.
SetUploadDetailsRpcPaymentsDeclines();
// Submitting the form and having Payments decline offering to save should
// show the local save bubble.
// (Must wait for response from Payments before accessing the controller.)
ResetEventWaiterForSequence(
{DialogEvent::REQUESTED_UPLOAD_SAVE,
DialogEvent::RECEIVED_GET_UPLOAD_DETAILS_RESPONSE,
DialogEvent::OFFERED_LOCAL_SAVE});
NavigateTo(kCreditCardUploadForm);
FillAndSubmitForm();
WaitForObservedEvent();
EXPECT_TRUE(
FindViewInBubbleById(DialogViewId::MAIN_CONTENT_VIEW_LOCAL)->visible());
}
#endif // !OS_CHROMEOS
// Tests the upload save bubble. Ensures that clicking the [No thanks] button // Tests the upload save bubble. Ensures that clicking the [No thanks] button
// successfully causes the bubble to go away. // successfully causes the bubble to go away.
IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest, IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment