#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/json/json_reader.h"
#include "base/run_loop.h"
#include "base/test/values_test_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/domain_reliability/service_factory.h"
#include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
#include "chrome/browser/net/profile_network_context_service.h"
#include "chrome/browser/policy/policy_test_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/domain_reliability/domain_reliability_prefs.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/policy_constants.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/test/browser_test.h"
#include "mojo/public/cpp/bindings/sync_call_restrictions.h"
#include "net/base/net_errors.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "net/test/url_request/url_request_failed_job.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "url/gurl.h"
namespace domain_reliability {
class DomainReliabilityBrowserTest : public InProcessBrowserTest { … };
class DomainReliabilityDisabledBrowserTest
: public DomainReliabilityBrowserTest { … };
class DomainReliabilityPolicyTest : public policy::PolicyTest { … };
IN_PROC_BROWSER_TEST_F(DomainReliabilityPolicyTest, PolicyOverride) { … }
IN_PROC_BROWSER_TEST_F(DomainReliabilityPolicyTest,
PolicyEnabledMetricsEnabled) { … }
IN_PROC_BROWSER_TEST_F(DomainReliabilityPolicyTest,
PolicyEnabledMetricsDisabled) { … }
IN_PROC_BROWSER_TEST_F(DomainReliabilityPolicyTest,
PolicyDisabledMetricsEnabled) { … }
IN_PROC_BROWSER_TEST_F(DomainReliabilityPolicyTest,
PolicyDisabledMetricsDisabled) { … }
IN_PROC_BROWSER_TEST_F(DomainReliabilityDisabledBrowserTest,
ServiceNotCreated) { … }
IN_PROC_BROWSER_TEST_F(DomainReliabilityBrowserTest, ServiceCreated) { … }
static const char kUploadPath[] = …;
std::unique_ptr<net::test_server::HttpResponse> TestRequestHandler(
int* request_count_out,
std::string* last_request_content_out,
const base::RepeatingClosure& quit_closure,
const net::test_server::HttpRequest& request) { … }
IN_PROC_BROWSER_TEST_F(DomainReliabilityBrowserTest, Upload) { … }
IN_PROC_BROWSER_TEST_F(DomainReliabilityBrowserTest, UploadAtShutdown) { … }
IN_PROC_BROWSER_TEST_F(DomainReliabilityBrowserTest, RequestAtShutdown) { … }
}