Skip to content

Commit

Permalink
[M100][VCN] Fix enroll bubble in Upstream
Browse files Browse the repository at this point in the history
Virtual card enroll bubble not shown in Upstream because we wait on
the card saved animation to be finished but when status chip is not
enabled there is no card save animation.

(cherry picked from commit 8110c87)

Bug: 1302117
Change-Id: I9141ad3e36a925ad7a75626e8e51a1510015f90f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3499342
Reviewed-by: Jared Saul <jsaul@google.com>
Commit-Queue: Siyu An <siyua@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#976504}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3508493
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/branch-heads/4896@{#350}
Cr-Branched-From: 1f63ff4-refs/heads/main@{#972766}
  • Loading branch information
Siyu An authored and Chromium LUCI CQ committed Mar 7, 2022
1 parent db2176c commit 5414ec0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Expand Up @@ -12,6 +12,7 @@
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/strike_database.h"
#include "components/autofill/core/browser/strike_database_base.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "ui/gfx/image/image.h"

namespace autofill {
Expand Down Expand Up @@ -288,7 +289,9 @@ void VirtualCardEnrollmentManager::OnDidGetDetailsForEnrollResponse(
}

#if !BUILDFLAG(IS_ANDROID)
if (state_.virtual_card_enrollment_fields.virtual_card_enrollment_source ==
if (base::FeatureList::IsEnabled(
features::kAutofillEnableToolbarStatusChip) &&
state_.virtual_card_enrollment_fields.virtual_card_enrollment_source ==
VirtualCardEnrollmentSource::kUpstream &&
!avatar_animation_complete_) {
return;
Expand Down
Expand Up @@ -7,6 +7,7 @@
#include "base/callback.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/data_model/credit_card.h"
Expand All @@ -20,6 +21,7 @@
#include "components/autofill/core/browser/test_autofill_client.h"
#include "components/autofill/core/browser/test_autofill_driver.h"
#include "components/autofill/core/browser/test_personal_data_manager.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/image/image_unittest_util.h"
Expand Down Expand Up @@ -465,6 +467,8 @@ TEST_F(VirtualCardEnrollmentManagerTest, UpstreamAnimationSync_AnimationFirst) {
}

TEST_F(VirtualCardEnrollmentManagerTest, UpstreamAnimationSync_ResponseFirst) {
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(features::kAutofillEnableToolbarStatusChip);
personal_data_manager_->ClearCreditCardArtImages();
SetUpCard();
SetValidCardArtImageForCard(*card_);
Expand Down

0 comments on commit 5414ec0

Please sign in to comment.