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') |