#include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h"
#include <memory>
#include <string>
#include <utility>
#include "base/functional/bind.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/commerce/shopping_service_factory.h"
#include "chrome/browser/feature_engagement/tracker_factory.h"
#include "chrome/browser/signin/chrome_signin_client_factory.h"
#include "chrome/browser/signin/chrome_signin_client_test_util.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/identity_test_environment_profile_adaptor.h"
#include "chrome/browser/sync/sync_service_factory.h"
#include "chrome/browser/ui/browser_element_identifiers.h"
#include "chrome/browser/ui/commerce/mock_commerce_ui_tab_helper.h"
#include "chrome/browser/ui/signin/bubble_signin_promo_delegate.h"
#include "chrome/browser/ui/tabs/public/tab_features.h"
#include "chrome/browser/ui/tabs/public/tab_interface.h"
#include "chrome/browser/ui/views/commerce/price_tracking_view.h"
#include "chrome/browser/ui/views/commerce/shopping_collection_iph_view.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/views/chrome_test_widget.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
#include "components/commerce/core/commerce_feature_list.h"
#include "components/commerce/core/mock_shopping_service.h"
#include "components/commerce/core/price_tracking_utils.h"
#include "components/commerce/core/test_utils.h"
#include "components/feature_engagement/public/feature_constants.h"
#include "components/feature_engagement/test/mock_tracker.h"
#include "components/signin/public/identity_manager/identity_test_utils.h"
#include "components/sync/test/test_sync_service.h"
#include "components/ukm/test_ukm_recorder.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "ui/base/interaction/element_identifier.h"
#include "ui/base/interaction/element_tracker.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h"
#include "ui/views/interaction/element_tracker_views.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/widget/unique_widget_ptr.h"
BookmarkModel;
namespace {
const char kTestBookmarkURL[] = …;
}
class BookmarkBubbleViewTestBase : public BrowserWithTestWindowTest { … };
class BookmarkBubbleViewTest : public BookmarkBubbleViewTestBase { … };
TEST_F(BookmarkBubbleViewTest, SyncPromoSignedIn) { … }
TEST_F(BookmarkBubbleViewTest, SyncPromoNotSignedIn) { … }
TEST_F(BookmarkBubbleViewTest, PriceTrackingViewIsVisible) { … }
TEST_F(BookmarkBubbleViewTest, RecordPriceTrackingUkmForNewBookmark) { … }
TEST_F(BookmarkBubbleViewTest, PriceTrackingViewIsHidden) { … }
TEST_F(BookmarkBubbleViewTest, PriceTrackingViewWithToggleOn) { … }
class PriceTrackingViewFeatureFlagTest
: public BookmarkBubbleViewTestBase,
public testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(PriceTrackingViewFeatureFlagTest, PriceTrackingViewCreation) { … }
class BookmarkBubbleViewShoppingCollectionTest
: public BookmarkBubbleViewTestBase { … };
TEST_F(BookmarkBubbleViewShoppingCollectionTest, IPHShown) { … }
TEST_F(BookmarkBubbleViewShoppingCollectionTest, IPHNotShown_NotInCollection) { … }
TEST_F(BookmarkBubbleViewShoppingCollectionTest, IPHNotShown_NotAProduct) { … }