Reporting API / Network Error Logging: Make available to Cronet.

This is a reland of https://chromium-review.googlesource.com/c/chromium/src/+/853172
which was rolled back as part of https://chromium-review.googlesource.com/c/chromium/src/+/879041.

Bug: 799616
Change-Id: I5dae7cd41b55dd2151a06e0f708743cd19b85b41
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Reviewed-on: https://chromium-review.googlesource.com/881401
Commit-Queue: Julia Tuttle <[email protected]>
Reviewed-by: Miriam Gershenson <[email protected]>
Cr-Commit-Position: refs/heads/master@{#532465}
diff --git a/components/cronet/url_request_context_config_unittest.cc b/components/cronet/url_request_context_config_unittest.cc
index 85154cd..4af5b31 100644
--- a/components/cronet/url_request_context_config_unittest.cc
+++ b/components/cronet/url_request_context_config_unittest.cc
@@ -52,6 +52,7 @@
       "\"race_cert_verification\":true,"
       "\"connection_options\":\"TIME,TBBR,REJ\"},"
       "\"AsyncDNS\":{\"enable\":true},"
+      "\"NetworkErrorLogging\":{\"enable\":true},"
       "\"UnknownOption\":{\"foo\":true},"
       "\"HostResolverRules\":{\"host_resolver_rules\":"
       "\"MAP * 127.0.0.1\"},"
@@ -106,6 +107,13 @@
   EXPECT_TRUE(context->host_resolver()->GetDnsConfigAsValue());
 #endif  // defined(ENABLE_BUILT_IN_DNS)
 
+#if BUILDFLAG(ENABLE_REPORTING)
+  // Check Reporting and Network Error Logging are enabled (can be disabled at
+  // build time).
+  EXPECT_TRUE(context->reporting_service());
+  EXPECT_TRUE(context->network_error_logging_delegate());
+#endif  // BUILDFLAG(ENABLE_REPORTING)
+
   // Check IPv6 is disabled when on wifi.
   EXPECT_TRUE(context->host_resolver()->GetNoIPv6OnWifi());