Commit b4476e3a authored by Siyu An's avatar Siyu An Committed by Commit Bot

[Sticky Bubble] Reland "Add fieldtrial testing config for feature

AutofillEnableStickyBubbleAndUpdatedLogging"

Change was reverted in crrev.com/c/2438609. Reason was that for upload
save card bubble we need to explicitly enable flag
features::kAutofillUpstream.

Bug: 1070799
Change-Id: Ib2d2cb35306b2d855a6223942249b3d7a4f4b5bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2464203
Commit-Queue: Siyu An <siyua@chromium.org>
Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarJared Saul <jsaul@google.com>
Cr-Commit-Position: refs/heads/master@{#816762}
parent 44616f1c
...@@ -1982,70 +1982,6 @@ IN_PROC_BROWSER_TEST_F( ...@@ -1982,70 +1982,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();
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();
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,
...@@ -2702,4 +2638,102 @@ IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTestForManageCard, ...@@ -2702,4 +2638,102 @@ 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 SaveCardBubbleViewsFullFormBrowserTestWithoutStickyBubble
: public SaveCardBubbleViewsFullFormBrowserTest {
public:
SaveCardBubbleViewsFullFormBrowserTestWithoutStickyBubble() {
feature_list_.InitWithFeatures(
/*enabled_features=*/{},
/*disabled_features=*/{
features::kAutofillUpstream,
features::kAutofillEnableStickyPaymentsBubble,
features::kAutofillEnableFixedPaymentsBubbleLogging});
}
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(
SaveCardBubbleViewsFullFormBrowserTestWithoutStickyBubble,
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();
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);
}
class
SaveCardBubbleViewsFullFormBrowserTestWithoutStickyBubbleWithAutofillUpstream
: public SaveCardBubbleViewsFullFormBrowserTest {
public:
SaveCardBubbleViewsFullFormBrowserTestWithoutStickyBubbleWithAutofillUpstream() {
feature_list_.InitWithFeatures(
/*enabled_features=*/{features::kAutofillUpstream},
/*disabled_features=*/{
features::kAutofillEnableStickyPaymentsBubble,
features::kAutofillEnableFixedPaymentsBubbleLogging});
}
private:
base::test::ScopedFeatureList feature_list_;
};
// Tests StrikeDatabase interaction with the upload save bubble. Ensures that a
// strike is added if the bubble is ignored.
IN_PROC_BROWSER_TEST_F(
SaveCardBubbleViewsFullFormBrowserTestWithoutStickyBubbleWithAutofillUpstream,
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();
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
...@@ -772,6 +772,25 @@ ...@@ -772,6 +772,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