#include "chrome/browser/dips/dips_test_utils.h"
#include <string_view>
#include "base/test/bind.h"
#include "chrome/browser/dips/dips_cleanup_service_factory.h"
#include "chrome/browser/dips/dips_service.h"
#include "chrome/browser/dips/dips_service_factory.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/hit_test_region_observer.h"
#include "content/public/test/test_utils.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "testing/gmock/include/gmock/gmock.h"
CookieAccessDetails;
NavigationHandle;
RenderFrameHost;
WebContents;
void CloseTab(content::WebContents* web_contents) { … }
base::expected<WebContents*, std::string> OpenInNewTab(
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) { … }
std::optional<StateValue> GetDIPSState(DIPSServiceImpl* dips_service,
const GURL& url) { … }
URLCookieAccessObserver::URLCookieAccessObserver(WebContents* web_contents,
const GURL& url,
CookieOperation access_type)
: … { … }
void URLCookieAccessObserver::Wait() { … }
void URLCookieAccessObserver::OnCookiesAccessed(
RenderFrameHost* render_frame_host,
const CookieAccessDetails& details) { … }
void URLCookieAccessObserver::OnCookiesAccessed(
NavigationHandle* navigation_handle,
const CookieAccessDetails& details) { … }
bool URLCookieAccessObserver::CookieAccessedInPrimaryPage() const { … }
FrameCookieAccessObserver::FrameCookieAccessObserver(
WebContents* web_contents,
RenderFrameHost* render_frame_host,
CookieOperation access_type)
: … { … }
void FrameCookieAccessObserver::Wait() { … }
void FrameCookieAccessObserver::OnCookiesAccessed(
content::RenderFrameHost* render_frame_host,
const content::CookieAccessDetails& details) { … }
RedirectChainObserver::RedirectChainObserver(DIPSService* service,
GURL final_url,
size_t expected_match_count)
: … { … }
RedirectChainObserver::~RedirectChainObserver() = default;
void RedirectChainObserver::OnChainHandled(
const DIPSRedirectChainInfoPtr& chain) { … }
void RedirectChainObserver::Wait() { … }
UserActivationObserver::UserActivationObserver(
WebContents* web_contents,
RenderFrameHost* render_frame_host)
: … { … }
void UserActivationObserver::Wait() { … }
void UserActivationObserver::FrameReceivedUserActivation(
RenderFrameHost* render_frame_host) { … }
EntryUrlsAre::EntryUrlsAre(std::string entry_name,
std::vector<std::string> urls)
: … { … }
EntryUrlsAre::EntryUrlsAre(const EntryUrlsAre&) = default;
EntryUrlsAre::EntryUrlsAre(EntryUrlsAre&&) = default;
EntryUrlsAre::~EntryUrlsAre() = default;
bool EntryUrlsAre::MatchAndExplain(
const ukm::TestUkmRecorder& ukm_recorder,
testing::MatchResultListener* result_listener) const { … }
void EntryUrlsAre::DescribeTo(std::ostream* os) const { … }
void EntryUrlsAre::DescribeNegationTo(std::ostream* os) const { … }
ScopedInitFeature::ScopedInitFeature(const base::Feature& feature,
bool enable,
const base::FieldTrialParams& params) { … }
ScopedInitDIPSFeature::ScopedInitDIPSFeature(
bool enable,
const base::FieldTrialParams& params)
: … { … }
OpenedWindowObserver::OpenedWindowObserver(
content::WebContents* web_contents,
WindowOpenDisposition open_disposition)
: … { … }
void OpenedWindowObserver::DidOpenRequestedURL(
content::WebContents* new_contents,
content::RenderFrameHost* source_render_frame_host,
const GURL& url,
const content::Referrer& referrer,
WindowOpenDisposition disposition,
ui::PageTransition transition,
bool started_from_context_menu,
bool renderer_initiated) { … }
void SimulateMouseClickAndWait(WebContents* web_contents) { … }
UrlAndSourceId MakeUrlAndId(std::string_view url) { … }
testing::AssertionResult SimulateDipsBounce(content::WebContents* web_contents,
const GURL& initial_url,
const GURL& bounce_url,
const GURL& final_url,
const GURL& next_initial_url) { … }