Commit 58ff1ecf authored by Siyu An's avatar Siyu An Committed by Commit Bot

[Autofill] Add fieldtrial testing config for feature

AutofillEnableStickyBubbleAndUpdatedLogging.

For more details about the feature please refer to
go/sticky-payments-bubble-dd.

This feature is currently running 50% in Canary/Dev.
So added this to fieldtrial_testing_config and get ready for Beta.

Also fixed some tests that will be obsolete when this feature is
launched.

Bug: 1070799
Change-Id: I3061a5de8c94e5a7e453e84615d9807fc0baa6b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424078Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Commit-Queue: Siyu An <siyua@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811449}
parent 28d9de39
...@@ -1985,75 +1985,6 @@ IN_PROC_BROWSER_TEST_F( ...@@ -1985,75 +1985,6 @@ IN_PROC_BROWSER_TEST_F(
// TODO(crbug.com/884817): Investigate combining local vs. upload tests using a // TODO(crbug.com/884817): Investigate combining local vs. upload tests using a
// boolean to branch local vs. upload logic. // boolean to branch local vs. upload logic.
// Tests StrikeDatabase interaction with the local save bubble. Ensures that a
// strike is added if the bubble is ignored.
IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest,
StrikeDatabase_Local_AddStrikeIfBubbleIgnored) {
TestAutofillClock test_clock;
test_clock.SetNow(base::Time::Now());
// Set up the Payments RPC.
SetUploadDetailsRpcPaymentsDeclines();
FillForm();
SubmitFormAndWaitForCardLocalSaveBubble();
// Clicking the [X] close button should dismiss the bubble.
ClickOnCloseButton();
// Add an event observer to the controller to detect strike changes.
AddEventObserverToController();
base::HistogramTester histogram_tester;
// Wait long enough to avoid bubble stickiness, then navigate away from the
// page.
test_clock.Advance(kCardBubbleSurviveNavigationTime);
ResetEventWaiterForSequence({DialogEvent::STRIKE_CHANGE_COMPLETE});
NavigateTo(kCreditCardAndAddressUploadForm);
WaitForObservedEvent();
// Ensure that a strike was added due to the bubble being ignored.
histogram_tester.ExpectUniqueSample(
"Autofill.StrikeDatabase.NthStrikeAdded.CreditCardSave",
/*sample=*/1, /*count=*/1);
}
// Tests StrikeDatabase interaction with the upload save bubble. Ensures that a
// strike is added if the bubble is ignored.
IN_PROC_BROWSER_TEST_F(
SaveCardBubbleViewsFullFormBrowserTestWithAutofillUpstream,
StrikeDatabase_Upload_AddStrikeIfBubbleIgnored) {
TestAutofillClock test_clock;
test_clock.SetNow(base::Time::Now());
// Start sync.
harness_->SetupSync();
FillForm();
SubmitFormAndWaitForCardUploadSaveBubble();
// Clicking the [X] close button should dismiss the bubble.
ClickOnCloseButton();
// Add an event observer to the controller to detect strike changes.
AddEventObserverToController();
base::HistogramTester histogram_tester;
// Wait long enough to avoid bubble stickiness, then navigate away from the
// page.
test_clock.Advance(kCardBubbleSurviveNavigationTime);
ResetEventWaiterForSequence({DialogEvent::STRIKE_CHANGE_COMPLETE});
NavigateTo(kCreditCardAndAddressUploadForm);
WaitForObservedEvent();
// Ensure that a strike was added due to the bubble being ignored.
histogram_tester.ExpectUniqueSample(
"Autofill.StrikeDatabase.NthStrikeAdded.CreditCardSave",
/*sample=*/1, /*count=*/1);
}
// Tests the local save bubble. Ensures that clicking the [No thanks] button // Tests the local save bubble. Ensures that clicking the [No thanks] button
// successfully causes a strike to be added. // successfully causes a strike to be added.
IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest, IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest,
...@@ -2750,4 +2681,96 @@ IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTestForManageCard, ...@@ -2750,4 +2681,96 @@ IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTestForManageCard,
} }
#endif #endif
// TODO(crbug.com/1070799): Remove the following two tests when the sticky
// bubble feature is launched.
class SaveCardBubbleViewsFullFormBrowserTestForStrikeDatabaseWithoutStickyBubble
: public SaveCardBubbleViewsFullFormBrowserTest {
protected:
~SaveCardBubbleViewsFullFormBrowserTestForStrikeDatabaseWithoutStickyBubble()
override = default;
void SetUp() override {
feature_list_.InitWithFeatures(
/*enabled_features=*/{},
/*disabled_features=*/{
features::kAutofillEnableStickyPaymentsBubble,
features::kAutofillEnableFixedPaymentsBubbleLogging});
SaveCardBubbleViewsFullFormBrowserTest::SetUp();
}
private:
base::test::ScopedFeatureList feature_list_;
};
// Tests StrikeDatabase interaction with the local save bubble. Ensures that a
// strike is added if the bubble is ignored.
IN_PROC_BROWSER_TEST_F(
SaveCardBubbleViewsFullFormBrowserTestForStrikeDatabaseWithoutStickyBubble,
StrikeDatabase_Local_AddStrikeIfBubbleIgnored) {
TestAutofillClock test_clock;
test_clock.SetNow(base::Time::Now());
// Set up the Payments RPC.
SetUploadDetailsRpcPaymentsDeclines();
FillForm();
SubmitFormAndWaitForCardLocalSaveBubble();
// Clicking the [X] close button should dismiss the bubble.
ClickOnCloseButton();
// Add an event observer to the controller to detect strike changes.
AddEventObserverToController();
base::HistogramTester histogram_tester;
// Wait long enough to avoid bubble stickiness, then navigate away from the
// page.
test_clock.Advance(kCardBubbleSurviveNavigationTime);
ResetEventWaiterForSequence({DialogEvent::STRIKE_CHANGE_COMPLETE});
NavigateTo(kCreditCardAndAddressUploadForm);
WaitForObservedEvent();
// Ensure that a strike was added due to the bubble being ignored.
histogram_tester.ExpectUniqueSample(
"Autofill.StrikeDatabase.NthStrikeAdded.CreditCardSave",
/*sample=*/1, /*count=*/1);
}
// Tests StrikeDatabase interaction with the upload save bubble. Ensures that a
// strike is added if the bubble is ignored.
IN_PROC_BROWSER_TEST_F(
SaveCardBubbleViewsFullFormBrowserTestForStrikeDatabaseWithoutStickyBubble,
StrikeDatabase_Upload_AddStrikeIfBubbleIgnored) {
TestAutofillClock test_clock;
test_clock.SetNow(base::Time::Now());
// Start sync.
harness_->SetupSync();
FillForm();
SubmitFormAndWaitForCardUploadSaveBubble();
// Clicking the [X] close button should dismiss the bubble.
ClickOnCloseButton();
// Add an event observer to the controller to detect strike changes.
AddEventObserverToController();
base::HistogramTester histogram_tester;
// Wait long enough to avoid bubble stickiness, then navigate away from the
// page.
test_clock.Advance(kCardBubbleSurviveNavigationTime);
ResetEventWaiterForSequence({DialogEvent::STRIKE_CHANGE_COMPLETE});
NavigateTo(kCreditCardAndAddressUploadForm);
WaitForObservedEvent();
// Ensure that a strike was added due to the bubble being ignored.
histogram_tester.ExpectUniqueSample(
"Autofill.StrikeDatabase.NthStrikeAdded.CreditCardSave",
/*sample=*/1, /*count=*/1);
}
} // namespace autofill } // namespace autofill
...@@ -701,6 +701,25 @@ ...@@ -701,6 +701,25 @@
] ]
} }
], ],
"AutofillEnableStickyBubbleAndUpdatedLogging": [
{
"platforms": [
"chromeos",
"linux",
"mac",
"windows"
],
"experiments": [
{
"name": "Enabled",
"enable_features": [
"AutofillEnableFixedPaymentsBubbleLogging",
"AutofillEnableStickyPaymentsBubble"
]
}
]
}
],
"AutofillFieldMetadata": [ "AutofillFieldMetadata": [
{ {
"platforms": [ "platforms": [
......
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