Commit 9a8323d9 authored by Jared Saul's avatar Jared Saul Committed by Commit Bot

[AF] Enable AutofillNoLocalSave* flags by default

Also removes 5 tests that only have relevance as long as the checkbox
exists (which it no longer does)

Please note that this is exactly the same CL as
https://chromium-review.googlesource.com/c/chromium/src/+/1682429, which
was originally rolled back so we could temporarily unlaunch.  We are now
continuing with the full rollout and can set these to ENABLED_BY_DEFAULT
again.

Bug: 941664
Change-Id: I1006e28a1f0fab42216ea051fd9b2cd1701bab0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2003622
Commit-Queue: Jared Saul <jsaul@google.com>
Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732893}
parent a04c23ca
......@@ -268,67 +268,6 @@ TEST_F(CardUnmaskPromptControllerImplTest, LogUnmaskedCardAfterFailure) {
AutofillMetrics::UNMASK_PROMPT_UNMASKED_CARD_AFTER_FAILED_ATTEMPTS, 1);
}
TEST_F(CardUnmaskPromptControllerImplTest, LogSavedCardLocally) {
ShowPromptAndSimulateResponse(/*should_store_pan=*/true,
/*enable_fido_auth=*/false);
base::HistogramTester histogram_tester;
controller_->OnVerificationResult(AutofillClient::SUCCESS);
controller_->OnUnmaskDialogClosed();
histogram_tester.ExpectBucketCount(
"Autofill.UnmaskPrompt.Events",
AutofillMetrics::UNMASK_PROMPT_SAVED_CARD_LOCALLY, 1);
}
TEST_F(CardUnmaskPromptControllerImplTest, LogDidOptIn) {
SetImportCheckboxState(false);
ShowPromptAndSimulateResponse(/*should_store_pan=*/true,
/*enable_fido_auth=*/false);
base::HistogramTester histogram_tester;
controller_->OnUnmaskDialogClosed();
histogram_tester.ExpectBucketCount(
"Autofill.UnmaskPrompt.Events",
AutofillMetrics::UNMASK_PROMPT_LOCAL_SAVE_DID_OPT_IN, 1);
}
TEST_F(CardUnmaskPromptControllerImplTest, LogDidNotOptIn) {
SetImportCheckboxState(false);
ShowPromptAndSimulateResponse(/*should_store_pan=*/false,
/*enable_fido_auth=*/false);
base::HistogramTester histogram_tester;
controller_->OnUnmaskDialogClosed();
histogram_tester.ExpectBucketCount(
"Autofill.UnmaskPrompt.Events",
AutofillMetrics::UNMASK_PROMPT_LOCAL_SAVE_DID_NOT_OPT_IN, 1);
}
TEST_F(CardUnmaskPromptControllerImplTest, LogDidOptOut) {
SetImportCheckboxState(true);
ShowPromptAndSimulateResponse(/*should_store_pan=*/false,
/*enable_fido_auth=*/false);
base::HistogramTester histogram_tester;
controller_->OnUnmaskDialogClosed();
histogram_tester.ExpectBucketCount(
"Autofill.UnmaskPrompt.Events",
AutofillMetrics::UNMASK_PROMPT_LOCAL_SAVE_DID_OPT_OUT, 1);
}
TEST_F(CardUnmaskPromptControllerImplTest, LogDidNotOptOut) {
SetImportCheckboxState(true);
ShowPromptAndSimulateResponse(/*should_store_pan=*/true,
/*enable_fido_auth=*/false);
base::HistogramTester histogram_tester;
controller_->OnUnmaskDialogClosed();
histogram_tester.ExpectBucketCount(
"Autofill.UnmaskPrompt.Events",
AutofillMetrics::UNMASK_PROMPT_LOCAL_SAVE_DID_NOT_OPT_OUT, 1);
}
TEST_F(CardUnmaskPromptControllerImplTest, DontLogForHiddenCheckbox) {
controller_->set_can_store_locally(false);
ShowPromptAndSimulateResponse(/*should_store_pan=*/false,
......
......@@ -61,12 +61,12 @@ const base::Feature kAutofillEnableVirtualCard{
// When enabled, will remove the option to save unmasked server cards as
// FULL_SERVER_CARDs upon successful unmask.
const base::Feature kAutofillNoLocalSaveOnUnmaskSuccess{
"AutofillNoLocalSaveOnUnmaskSuccess", base::FEATURE_DISABLED_BY_DEFAULT};
"AutofillNoLocalSaveOnUnmaskSuccess", base::FEATURE_ENABLED_BY_DEFAULT};
// When enabled, no local copy of server card will be saved when upload
// succeeds.
const base::Feature kAutofillNoLocalSaveOnUploadSuccess{
"AutofillNoLocalSaveOnUploadSuccess", base::FEATURE_DISABLED_BY_DEFAULT};
"AutofillNoLocalSaveOnUploadSuccess", base::FEATURE_ENABLED_BY_DEFAULT};
// When enabled, the Save Card infobar will be dismissed by a user initiated
// navigation other than one caused by submitted form.
......
......@@ -197,7 +197,7 @@ TEST_F(CWVCreditCardVerifierTest, IsExpirationDateValid) {
// Tests CWVCreditCardVerifier's verification method handles success case.
TEST_F(CWVCreditCardVerifierTest, VerifyCardSucceeded) {
NSString* cvc = @"123";
BOOL store_locally = YES;
BOOL store_locally = NO;
[credit_card_verifier_ loadRiskData:std::move(base::DoNothing())];
__block BOOL completionCalled = NO;
__block NSError* completionError;
......@@ -211,7 +211,7 @@ TEST_F(CWVCreditCardVerifierTest, VerifyCardSucceeded) {
completionCalled = YES;
completionError = error;
}];
EXPECT_TRUE(credit_card_verifier_.lastStoreLocallyValue);
EXPECT_FALSE(credit_card_verifier_.lastStoreLocallyValue);
const FakeCardUnmaskDelegate::UserProvidedUnmaskDetails& unmask_details_ =
card_unmask_delegate_.GetUserProvidedUnmaskDetails();
......@@ -227,7 +227,7 @@ TEST_F(CWVCreditCardVerifierTest, VerifyCardSucceeded) {
// Tests CWVCreditCardVerifier's verification method handles failure case.
TEST_F(CWVCreditCardVerifierTest, VerifyCardFailed) {
NSString* cvc = @"123";
BOOL store_locally = YES;
BOOL store_locally = NO;
[credit_card_verifier_ loadRiskData:std::move(base::DoNothing())];
__block NSError* completionError;
[credit_card_verifier_
......@@ -239,7 +239,7 @@ TEST_F(CWVCreditCardVerifierTest, VerifyCardFailed) {
completionHandler:^(NSError* error) {
completionError = error;
}];
EXPECT_TRUE(credit_card_verifier_.lastStoreLocallyValue);
EXPECT_FALSE(credit_card_verifier_.lastStoreLocallyValue);
const FakeCardUnmaskDelegate::UserProvidedUnmaskDetails& unmask_details_ =
card_unmask_delegate_.GetUserProvidedUnmaskDetails();
......
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