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

Unified Diff: tools/android/loading/device_setup.py

Issue 1698883002: sandwich: Adds command line flag to disable WPR injections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@d04
Patch Set: Address matt's nits Created 4 years, 10 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/android/loading/run_sandwich.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/device_setup.py
diff --git a/tools/android/loading/device_setup.py b/tools/android/loading/device_setup.py
index 5782b58a1bed6c6c01782ef3ce9ae4626de80cea..bb05ce3d9fcb95fb5e5e0250caf9a0973b74aa55 100644
--- a/tools/android/loading/device_setup.py
+++ b/tools/android/loading/device_setup.py
@@ -115,7 +115,8 @@ def _SetUpDevice(device, package_info):
@contextlib.contextmanager
-def WprHost(device, wpr_archive_path, record=False):
+def WprHost(device, wpr_archive_path, record=False,
+ disable_script_injection=False):
"""Launches web page replay host.
Args:
@@ -140,6 +141,11 @@ def WprHost(device, wpr_archive_path, record=False):
else:
assert os.path.exists(wpr_archive_path)
+ if disable_script_injection:
+ # Remove default WPR injected scripts like deterministic.js which
+ # overrides Math.random.
+ wpr_server_args.extend(['--inject_scripts', ''])
+
# Deploy certification authority to the device.
temp_certificate_dir = tempfile.mkdtemp()
wpr_ca_cert_path = os.path.join(temp_certificate_dir, 'testca.pem')
« no previous file with comments | « no previous file | tools/android/loading/run_sandwich.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698