chromium/content/public/test/browsing_topics_test_util.h

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_PUBLIC_TEST_BROWSING_TOPICS_TEST_UTIL_H_
#define CONTENT_PUBLIC_TEST_BROWSING_TOPICS_TEST_UTIL_H_

#include "base/files/file_path.h"
#include "content/public/browser/browsing_topics_site_data_manager.h"

namespace content {

class BrowsingTopicsSiteDataManagerImpl;

// Synchrnously get all the browsing topics api usage contexts. Entries are
// sorted based on [hashed_context_domain, hashed_main_frame_host, time]
std::vector<browsing_topics::ApiUsageContext> GetBrowsingTopicsApiUsage(
    BrowsingTopicsSiteDataManager* topics_site_data_manager);

// Synchronously get unhashed context domains from hashed context domains.
std::map<browsing_topics::HashedDomain, std::string>
GetContextDomainsFromHashedContextDomains(
    content::BrowsingTopicsSiteDataManager* topics_site_data_manager,
    std::set<browsing_topics::HashedDomain> hashed_context_domains);

// A tester class that allows mocking a query failure (e.g. database error).
class TesterBrowsingTopicsSiteDataManager
    : public BrowsingTopicsSiteDataManager {};

}  // namespace content

#endif  // CONTENT_PUBLIC_TEST_BROWSING_TOPICS_TEST_UTIL_H_