#ifndef COMPONENTS_COMMERCE_CORE_TEST_UTILS_H_
#define COMPONENTS_COMMERCE_CORE_TEST_UTILS_H_
#include <optional>
#include <string>
#include "components/commerce/core/shopping_service.h"
#include "components/commerce/core/subscriptions/commerce_subscription.h"
#include "testing/gmock/include/gmock/gmock.h"
class GURL;
class PrefRegistrySimple;
class TestingPrefServiceSimple;
namespace bookmarks {
class BookmarkModel;
class BookmarkNode;
}
namespace {
const char kDate[] = …;
const int64_t kTypicalLowPriceMicros = …;
const int64_t kTypicalHighPriceMicros = …;
const int64_t kTypicalPriceMicros = …;
}
namespace commerce {
MATCHER_P(VectorHasSubscriptionWithId, expected_id, "") { … }
MATCHER_P(SubscriptionWithId, expected_id, "") { … }
const bookmarks::BookmarkNode* AddProductBookmark(
bookmarks::BookmarkModel* bookmark_model,
const std::u16string& title,
const GURL& url,
uint64_t cluster_id,
bool is_price_tracked = false,
const int64_t price_micros = 0L,
const std::string& currency_code = "usd",
const std::optional<int64_t>& last_subscription_change_time = std::nullopt);
void AddProductInfoToExistingBookmark(
bookmarks::BookmarkModel* bookmark_model,
const bookmarks::BookmarkNode* bookmark_node,
const std::u16string& title,
uint64_t cluster_id,
bool is_price_tracked = false,
const int64_t price_micros = 0L,
const std::string& currency_code = "usd",
const std::optional<int64_t>& last_subscription_change_time = std::nullopt);
void SetShoppingListEnterprisePolicyPref(TestingPrefServiceSimple* prefs,
bool enabled);
void RegisterCommercePrefs(PrefRegistrySimple* registry);
void SetTabCompareEnterprisePolicyPref(TestingPrefServiceSimple* prefs,
int enabled_state);
std::optional<PriceInsightsInfo> CreateValidPriceInsightsInfo(
bool has_price_range_data = false,
bool has_price_history_data = false,
PriceBucket price_bucket = PriceBucket::kUnknown);
DiscountInfo CreateValidDiscountInfo(const std::string& detail,
const std::string& terms_and_conditions,
const std::string& value_in_text,
const std::string& discount_code,
int64_t id,
bool is_merchant_wide,
double expiry_time_sec);
}
#endif