#include "components/commerce/core/price_tracking_utils.h"
#include <memory>
#include <optional>
#include "base/functional/callback.h"
#include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "base/uuid.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_uuids.h"
#include "components/bookmarks/test/test_bookmark_client.h"
#include "components/commerce/core/commerce_feature_list.h"
#include "components/commerce/core/mock_shopping_service.h"
#include "components/commerce/core/pref_names.h"
#include "components/commerce/core/subscriptions/commerce_subscription.h"
#include "components/commerce/core/test_utils.h"
#include "components/power_bookmarks/core/power_bookmark_utils.h"
#include "components/power_bookmarks/core/proto/power_bookmark_meta.pb.h"
#include "components/power_bookmarks/core/proto/shopping_specifics.pb.h"
#include "components/prefs/testing_pref_service.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace commerce {
namespace {
class PriceTrackingUtilsTest : public testing::Test { … };
TEST_F(PriceTrackingUtilsTest,
SetPriceTrackingStateUpdatesAll_UnsubscribeSuccess) { … }
TEST_F(PriceTrackingUtilsTest,
SetPriceTrackingState_Unsubscribe_TrackByDefault) { … }
TEST_F(PriceTrackingUtilsTest, SetPriceTrackingState_SubscribeOldBookmark) { … }
TEST_F(PriceTrackingUtilsTest, SetPriceTrackingState_ErrorCases_NoService) { … }
TEST_F(PriceTrackingUtilsTest, SetPriceTrackingState_ErrorCases_NoBookmark) { … }
TEST_F(PriceTrackingUtilsTest, SetPriceTrackingState_ErrorCases_NoInfo) { … }
TEST_F(PriceTrackingUtilsTest, SetPriceTrackingForClusterId) { … }
TEST_F(PriceTrackingUtilsTest, GetBookmarksWithClusterId) { … }
TEST_F(PriceTrackingUtilsTest, GetBookmarksWithClusterId_CountRestricted) { … }
TEST_F(PriceTrackingUtilsTest, GetAllPriceTrackedBookmarks) { … }
TEST_F(PriceTrackingUtilsTest, GetBookmarksWithClusterId_NoProducts) { … }
TEST_F(PriceTrackingUtilsTest, IsBookmarkPriceTracked_Tracked) { … }
TEST_F(PriceTrackingUtilsTest, IsBookmarkPriceTracked_NonProduct) { … }
TEST_F(PriceTrackingUtilsTest, PopulateOrUpdateBookmark) { … }
TEST_F(PriceTrackingUtilsTest, PopulateOrUpdateBookmark_NoNewData) { … }
TEST_F(PriceTrackingUtilsTest,
PopulateOrUpdateBookmark_EmptyClusterIdReplaced) { … }
TEST_F(PriceTrackingUtilsTest, PopulateOrUpdateBookmark_ClusterIdUnchanged) { … }
TEST_F(PriceTrackingUtilsTest, PopulateOrUpdateBookmark_ImageRemoved) { … }
TEST_F(PriceTrackingUtilsTest, PopulateOrUpdateBookmark_TitleUpdated) { … }
TEST_F(PriceTrackingUtilsTest, PopulateOrUpdateBookmark_NonemptyTitleKept) { … }
TEST_F(PriceTrackingUtilsTest, PopulateOrUpdateBookmark_PreviousPriceCleared) { … }
TEST_F(PriceTrackingUtilsTest, MaybeEnableEmailNotifications) { … }
TEST_F(PriceTrackingUtilsTest, TestSubscriptionForClusterIdCreation) { … }
TEST_F(PriceTrackingUtilsTest, TestGetBookmarkParentName) { … }
TEST_F(PriceTrackingUtilsTest, GetShoppingCollection) { … }
TEST_F(PriceTrackingUtilsTest, GetShoppingCollection_InvalidParams) { … }
TEST_F(PriceTrackingUtilsTest, GetProductClusterIdFromBookmark) { … }
TEST_F(PriceTrackingUtilsTest, RemoveDanglingSubscriptions) { … }
TEST_F(PriceTrackingUtilsTest, RemoveDanglingSubscriptions_NoDanglingSubs) { … }
}
}