#ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_BROWSERTEST_BASE_H_
#define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_BROWSERTEST_BASE_H_
#include <string>
#include "base/memory/raw_ptr.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/test/base/chrome_test_utils.h"
#include "chrome/test/base/platform_browser_test.h"
#include "components/browsing_data/content/browsing_data_model.h"
#include "components/signin/public/base/signin_buildflags.h"
namespace network::mojom {
class NetworkContext;
}
class BrowsingDataRemoverBrowserTestBase : public PlatformBrowserTest {
public:
BrowsingDataRemoverBrowserTestBase();
~BrowsingDataRemoverBrowserTestBase() override;
void InitFeatureLists(std::vector<base::test::FeatureRef> enabled_features,
std::vector<base::test::FeatureRef> disabled_features);
void SetUpOnMainThread() override;
void RunScriptAndCheckResult(const std::string& script,
const std::string& result,
content::WebContents* web_contents = nullptr);
bool RunScriptAndGetBool(const std::string& script,
content::WebContents* web_contents = nullptr);
void VerifyDownloadCount(size_t expected, Profile* profile = nullptr);
void DownloadAnItem();
bool HasDataForType(const std::string& type,
content::WebContents* web_contents = nullptr);
void SetDataForType(const std::string& type,
content::WebContents* web_contents = nullptr);
int GetSiteDataCount(content::WebContents* web_contents = nullptr);
#if BUILDFLAG(IS_ANDROID)
bool IsIncognito() { return false; }
#else
Browser* GetBrowser() const;
void UseIncognitoBrowser();
void RestartIncognitoBrowser();
bool IsIncognito() { return incognito_browser_ != nullptr; }
#endif
network::mojom::NetworkContext* network_context();
protected:
content::WebContents* GetActiveWebContents();
#if !BUILDFLAG(IS_ANDROID)
content::WebContents* GetActiveWebContents(Browser* browser);
#endif
Profile* GetProfile();
protected:
bool CheckUserDirectoryForString(
const std::string& hostname,
const std::vector<std::string>& ignore_file_patterns,
bool check_leveldb_content);
std::unique_ptr<BrowsingDataModel> GetBrowsingDataModel(Profile* profile);
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
bool SetGaiaCookieForProfile(Profile* profile);
#endif
private:
base::test::ScopedFeatureList feature_list_;
#if !BUILDFLAG(IS_ANDROID)
raw_ptr<Browser, AcrossTasksDanglingUntriaged> incognito_browser_ = nullptr;
#endif
};
#endif