#ifndef CHROME_BROWSER_DIPS_DIPS_TEST_UTILS_H_
#define CHROME_BROWSER_DIPS_DIPS_TEST_UTILS_H_
#include <iosfwd>
#include <string>
#include <string_view>
#include <vector>
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/test/scoped_feature_list.h"
#include "base/types/expected.h"
#include "chrome/browser/dips/dips_redirect_info.h"
#include "chrome/browser/dips/dips_service.h"
#include "chrome/browser/dips/dips_utils.h"
#include "chrome/browser/profiles/profile_test_util.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/browser/cookie_access_details.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/browser_test_utils.h"
#include "url/gurl.h"
namespace testing {
class MatchResultListener;
}
constexpr char kStorageAccessScript[] = …;
StateForURLCallback;
void CloseTab(content::WebContents* web_contents);
base::expected<content::WebContents*, std::string> OpenInNewTab(
content::WebContents* original_tab,
const GURL& url);
void AccessCookieViaJSIn(content::WebContents* web_contents,
content::RenderFrameHost* frame);
bool NavigateToSetCookie(content::WebContents* web_contents,
const net::EmbeddedTestServer* server,
std::string_view host,
bool is_secure_cookie_set,
bool is_ad_tagged);
void CreateImageAndWaitForCookieAccess(content::WebContents* web_contents,
const GURL& image_url);
inline void WaitOnStorage(DIPSServiceImpl* dips_service) { … }
std::optional<StateValue> GetDIPSState(DIPSServiceImpl* dips_service,
const GURL& url);
inline DIPSServiceImpl* GetDipsService(content::WebContents* web_contents) { … }
class URLCookieAccessObserver : public content::WebContentsObserver { … };
class FrameCookieAccessObserver : public content::WebContentsObserver { … };
class RedirectChainObserver : public DIPSService::Observer { … };
class UserActivationObserver : public content::WebContentsObserver { … };
class EntryUrlsAre { … };
class ScopedInitFeature { … };
class ScopedInitDIPSFeature { … };
class OpenedWindowObserver : public content::WebContentsObserver { … };
void SimulateMouseClickAndWait(content::WebContents*);
UrlAndSourceId MakeUrlAndId(std::string_view url);
testing::AssertionResult SimulateDipsBounce(content::WebContents*,
const GURL& initial_url,
const GURL& bounce_url,
const GURL& final_url,
const GURL& next_url);
#endif