#include <memory>
#include "base/json/json_writer.h"
#include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/platform_thread.h"
#include "base/values.h"
#include "build/build_config.h"
#include "content/browser/attribution_reporting/attribution_manager_impl.h"
#include "content/browser/attribution_reporting/attribution_test_utils.h"
#include "content/browser/attribution_reporting/test/source_observer.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/features.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/context_menu_interceptor.h"
#include "content/public/test/hit_test_region_observer.h"
#include "content/shell/browser/shell.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/controllable_http_response.h"
#include "net/test/embedded_test_server/default_handlers.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "url/gurl.h"
namespace content {
namespace {
ElementsAre;
Field;
IsEmpty;
Pair;
Pointee;
UnorderedElementsAre;
class AttributionSourceBrowserTest : public ContentBrowserTest { … };
class AttributionSourceDisabledBrowserTest : public AttributionSourceBrowserTest { … };
IN_PROC_BROWSER_TEST_F(AttributionSourceDisabledBrowserTest,
ImpressionWithoutFeatureEnabled_NotReceived) { … }
class AttributionSourceDeclarationBrowserTest
: public AttributionSourceBrowserTest { … };
IN_PROC_BROWSER_TEST_F(AttributionSourceDeclarationBrowserTest,
ImpressionTagNavigatesRemoteFrame_ImpressionReceived) { … }
IN_PROC_BROWSER_TEST_F(
AttributionSourceDeclarationBrowserTest,
DISABLED_ImpressionTagNavigatesExistingRemoteFrame_ImpressionReceived) { … }
IN_PROC_BROWSER_TEST_F(
AttributionSourceDeclarationBrowserTest,
ImpressionTagNavigatesFromMiddleClick_ImpressionReceived) { … }
IN_PROC_BROWSER_TEST_F(
AttributionSourceDeclarationBrowserTest,
TagNavigatesFromMiddleClickInSubframe_ImpressionReceived) { … }
IN_PROC_BROWSER_TEST_F(
AttributionSourceDeclarationBrowserTest,
DISABLED_ImpressionTagNavigatesFromEnterPress_ImpressionReceived) { … }
IN_PROC_BROWSER_TEST_F(AttributionSourceDeclarationBrowserTest,
ImpressionOnInsecureSite_NotRegistered) { … }
IN_PROC_BROWSER_TEST_F(AttributionSourceDeclarationBrowserTest,
ImpressionWithInsecureReportingOrigin_ReceivesToken) { … }
IN_PROC_BROWSER_TEST_F(AttributionSourceDeclarationBrowserTest,
ImpressionWithPermissionsPolicyDisabled_NotRegistered) { … }
IN_PROC_BROWSER_TEST_F(
AttributionSourceDeclarationBrowserTest,
ImpressionInSubframeWithoutPermissionsPolicy_Registered) { … }
IN_PROC_BROWSER_TEST_F(
AttributionSourceDeclarationBrowserTest,
ImpressionInSubframeWithPermissionsPolicyDisabled_NotRegistered) { … }
IN_PROC_BROWSER_TEST_F(AttributionSourceDeclarationBrowserTest,
ImpressionInSubframeWithPermissionsPolicy_Registered) { … }
#if !BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(AttributionSourceDeclarationBrowserTest,
DISABLED_ContextMenuShownForImpression_ImpressionSet) { … }
#endif
IN_PROC_BROWSER_TEST_F(AttributionSourceDeclarationBrowserTest,
ImpressionNavigationReloads_NoImpression) { … }
IN_PROC_BROWSER_TEST_F(AttributionSourceDeclarationBrowserTest,
RendererReloadImpressionNavigation_NoImpression) { … }
IN_PROC_BROWSER_TEST_F(AttributionSourceDeclarationBrowserTest,
BackNavigateToImpressionNavigation_NoImpression) { … }
IN_PROC_BROWSER_TEST_F(AttributionSourceDeclarationBrowserTest,
ImpressionInSubframeInInsecureContext_NotRegistered) { … }
}
}