#include <memory>
#include <string>
#include "base/base_switches.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/values_test_util.h"
#include "base/time/time.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/policy/policy_test_utils.h"
#include "chrome/browser/ssl/cert_verifier_browser_test.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_navigator_params.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/policy_constants.h"
#include "components/tpcd/enterprise_reporting/enterprise_reporting_tab_helper.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_features.h"
#include "content/public/common/result_codes.h"
#include "content/public/common/url_constants.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_mock_cert_verifier.h"
#include "content/public/test/no_renderer_crashes_assertion.h"
#include "content/public/test/test_navigation_observer.h"
#include "net/base/features.h"
#include "net/dns/mock_host_resolver.h"
#include "net/reporting/reporting_policy.h"
#include "net/test/embedded_test_server/controllable_http_response.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "services/network/public/cpp/features.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/chrome_debug_urls.h"
#include "third_party/blink/public/common/features.h"
#include "url/gurl.h"
namespace {
const char kReportingHost[] = …;
class BaseReportingBrowserTest : public CertVerifierBrowserTest,
public ::testing::WithParamInterface<bool> { … };
void BaseReportingBrowserTest::SetUp() { … }
void BaseReportingBrowserTest::SetUpOnMainThread() { … }
class ReportingBrowserTest : public BaseReportingBrowserTest { … };
class NonIsolatedReportingBrowserTest : public BaseReportingBrowserTest { … };
class JSCallStackReportingBrowserTest : public BaseReportingBrowserTest { … };
class EnterpriseReportingBrowserTest : public policy::PolicyTest { … };
class HistogramReportingBrowserTest : public BaseReportingBrowserTest { … };
base::Value::List ParseReportUpload(const std::string& payload) { … }
}
IN_PROC_BROWSER_TEST_P(ReportingBrowserTest, TestNELHeadersProcessed) { … }
IN_PROC_BROWSER_TEST_P(ReportingBrowserTest, TestReportingHeadersProcessed) { … }
IN_PROC_BROWSER_TEST_P(NonIsolatedReportingBrowserTest,
TestReportingHeadersProcessed) { … }
IN_PROC_BROWSER_TEST_P(ReportingBrowserTest,
ReportingRespectsNetworkIsolationKeys) { … }
#if defined(ADDRESS_SANITIZER)
#define MAYBE_CrashReport …
#define MAYBE_CrashReportUnresponsive …
#define MAYBE_MainPageOptedIn …
#define MAYBE_MainPageNotOptedIn …
#define MAYBE_IframeUnresponsiveWithJSCallStackOptedIn …
#define MAYBE_IframeUnresponsiveWithJSCallStackNotOptedIn …
#else
#define MAYBE_CrashReport …
#define MAYBE_CrashReportUnresponsive …
#define MAYBE_MainPageOptedIn …
#define MAYBE_MainPageNotOptedIn …
#define MAYBE_IframeUnresponsiveWithJSCallStackOptedIn …
#define MAYBE_IframeUnresponsiveWithJSCallStackNotOptedIn …
#endif
IN_PROC_BROWSER_TEST_P(ReportingBrowserTest, MAYBE_CrashReport) { … }
IN_PROC_BROWSER_TEST_P(ReportingBrowserTest, MAYBE_CrashReportUnresponsive) { … }
IN_PROC_BROWSER_TEST_P(JSCallStackReportingBrowserTest, MAYBE_MainPageOptedIn) { … }
IN_PROC_BROWSER_TEST_P(JSCallStackReportingBrowserTest,
MAYBE_MainPageNotOptedIn) { … }
IN_PROC_BROWSER_TEST_P(JSCallStackReportingBrowserTest,
MAYBE_IframeUnresponsiveWithJSCallStackOptedIn) { … }
IN_PROC_BROWSER_TEST_P(JSCallStackReportingBrowserTest,
MAYBE_IframeUnresponsiveWithJSCallStackNotOptedIn) { … }
IN_PROC_BROWSER_TEST_F(EnterpriseReportingBrowserTest,
RenderFrameHostCookieError) { … }
IN_PROC_BROWSER_TEST_F(EnterpriseReportingBrowserTest,
NavigationHandleCookieError) { … }
IN_PROC_BROWSER_TEST_P(HistogramReportingBrowserTest,
CrashReportUnresponsiveHistogram) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);