#include <memory>
#include <string>
#include <vector>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/threading/thread_restrictions.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/predictors/loading_predictor_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/metrics/content/subprocess_metrics_provider.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/download_test_observer.h"
#include "content/public/test/test_navigation_observer.h"
#include "net/base/filename_util.h"
#include "net/base/net_errors.h"
#include "net/http/http_connection_info.h"
#include "net/test/embedded_test_server/controllable_http_response.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/loader/resource_load_info.mojom.h"
#include "ui/base/window_open_disposition.h"
#include "url/gurl.h"
namespace content {
namespace {
constexpr char kUninterestingMainFramePath[] = …;
constexpr char kInterestingPath[] = …;
enum class RequestType { … };
enum class HeadersReceived { … };
enum class NetworkAccessed { … };
class WaitForMainFrameResourceObserver : public content::WebContentsObserver { … };
class NetworkRequestMetricsBrowserTest
: public InProcessBrowserTest,
public testing::WithParamInterface<RequestType> { … };
IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest,
NetErrorBeforeHeaders) { … }
IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest, NetErrorDuringBody) { … }
IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest, CancelBeforeHeaders) { … }
IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest, CancelDuringBody) { … }
IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest,
InterruptedBeforeHeaders) { … }
IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest,
InterruptedCancelDuringBody) { … }
IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest, SuccessWithBody) { … }
IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest, SuccessWithEmptyBody) { … }
IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest, Download) { … }
IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest, FileURLError) { … }
IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest, FileURLSuccess) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
}