Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/chrome_browser_backend.py

Issue 652793004: Always use --host-resolver-rules Chrome flag with ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/backends/chrome/chrome_browser_backend.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/chrome_browser_backend.py b/tools/telemetry/telemetry/core/backends/chrome/chrome_browser_backend.py
index 33d6b7005169bd57a79085768b8719a2296453d8..f2131f9afa3dd3d5f59a9eb3af536d91d3d7529d 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/chrome_browser_backend.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/chrome_browser_backend.py
@@ -127,6 +127,20 @@ class ChromeBrowserBackend(browser_backend.BrowserBackend):
return args
+ @property
+ def _use_host_resolver_rules(self):
+ """Returns True if need --host-resolver-rules to send requests to replay."""
+ if self.browser_options.netsim:
+ # Avoid --host-resolver-rules with netsim because it causes Chrome to
+ # skip DNS requests. With netsim, we want to exercise DNS requests.
+ return False
+ if self.forwarder_factory.does_forwarder_override_dns:
+ # Avoid --host-resolver-rules when the forwarder can map DNS requests
+ # from devices to the replay DNS port on the host running Telemetry.
+ # This allows the browser to exercise DNS requests.
+ return False
+ return True
+
def GetReplayBrowserStartupArgs(self):
if self.browser_options.wpr_mode == wpr_modes.WPR_OFF:
return []
@@ -134,9 +148,6 @@ class ChromeBrowserBackend(browser_backend.BrowserBackend):
# the HTTP requests directly to Replay. Also use --host-resolver-rules
# without netsim. With netsim, DNS requests should be sent (to get the
# simulated latency), however, the flag causes DNS requests to be skipped.
- use_host_resolver = (
- not self.forwarder_factory.does_forwarder_override_dns and
- not self.browser_options.netsim)
http_remote_port = self.wpr_port_pairs.http.remote_port
https_remote_port = self.wpr_port_pairs.https.remote_port
replay_args = []
@@ -145,7 +156,7 @@ class ChromeBrowserBackend(browser_backend.BrowserBackend):
# and installed a root certificate. When |self.wpr_ca_cert_path| is
# set, Web Page Replay uses it to sign HTTPS responses.
replay_args.append('--ignore-certificate-errors')
- if use_host_resolver:
+ if self._use_host_resolver_rules:
replay_args.append('--host-resolver-rules=MAP * %s,EXCLUDE localhost' %
self.forwarder_factory.host_ip) # replay's host_ip
# Force the browser to send HTTP/HTTPS requests to fixed ports if they
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698