Commit c2c755de authored by Ryan Sturm's avatar Ryan Sturm Committed by Commit Bot

Adding a flag to enable faster reporting API reports

This CL intends to allow integration tests (for HTTPS server previews)
to test end-to-end behavior of reporting to the right end point. Instead
of waiting a minute for the test to finish, having a faster delay is
preferable.

Bug: 931411
Change-Id: I828d51f1b2faecbbd8dc38fd75d6f39e8fa9655f
Reviewed-on: https://chromium-review.googlesource.com/c/1471214Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Commit-Queue: Ryan Sturm <ryansturm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632336}
parent 506db4da
......@@ -7,6 +7,7 @@
#include <string>
#include "base/bind.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
......@@ -24,6 +25,7 @@
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "components/certificate_transparency/pref_names.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
......@@ -378,6 +380,12 @@ ProfileNetworkContextService::CreateNetworkContextParams(
network_context_params->accept_language = ComputeAcceptLanguage();
network_context_params->enable_referrers = enable_referrers_.GetValue();
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kShortReportingDelay)) {
network_context_params->reporting_delivery_interval =
base::TimeDelta::FromMilliseconds(100);
}
// Always enable the HTTP cache.
network_context_params->http_cache_enabled = true;
......
......@@ -551,6 +551,9 @@ const char kRestoreLastSession[] = "restore-last-session";
// See http://crbug.com/120416 for how to remove this switch.
const char kSavePageAsMHTML[] = "save-page-as-mhtml";
// Sets the Reporting API delay to under a second to allow much quicker reports.
const char kShortReportingDelay[] = "short-reporting-delay";
// If true the app list will be shown.
const char kShowAppList[] = "show-app-list";
......
......@@ -163,6 +163,7 @@ extern const char kProxyPacUrl[];
extern const char kRemoteDebuggingTargets[];
extern const char kRestoreLastSession[];
extern const char kSavePageAsMHTML[];
extern const char kShortReportingDelay[];
extern const char kShowAppList[];
extern const char kSilentDebuggerExtensionAPI[];
extern const char kSilentLaunch[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment