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

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

Issue 2687803004: [tools/android/loading] Helper script running Chrome on device with WPR (Closed)
Patch Set: Share dupliacted code Created 3 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 | « tools/android/loading/chrome_setup.py ('k') | tools/android/loading/wpr_helper.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/controller.py
diff --git a/tools/android/loading/controller.py b/tools/android/loading/controller.py
index bbd4799ac1470b9e264b4dc3caefd8cf570c215a..cceb4c88a90f38f9a3d2ba376371a4a9b991eb3b 100644
--- a/tools/android/loading/controller.py
+++ b/tools/android/loading/controller.py
@@ -27,6 +27,7 @@ import traceback
import psutil
import chrome_cache
+import chrome_setup
import common_util
import device_setup
import devtools_monitor
@@ -146,23 +147,7 @@ class ChromeControllerBase(object):
DEVTOOLS_CONNECTION_ATTEMPT_INTERVAL_SECONDS = 1
def __init__(self):
- self._chrome_args = [
- # Disable backgound network requests that may pollute WPR archive,
- # pollute HTTP cache generation, and introduce noise in loading
- # performance.
- '--disable-background-networking',
- '--disable-default-apps',
- '--no-proxy-server',
- # TODO(gabadie): Remove once crbug.com/354743 done.
- '--safebrowsing-disable-auto-update',
-
- # Disables actions that chrome performs only on first run or each
- # launches, which can interfere with page load performance, or even
- # block its execution by waiting for user input.
- '--disable-fre',
- '--no-default-browser-check',
- '--no-first-run',
-
+ self._chrome_args = chrome_setup.CHROME_ARGS + [
# Tests & dev-tools related stuff.
'--enable-test-events',
'--remote-debugging-port=%d' % OPTIONS.devtools_port,
@@ -406,14 +391,9 @@ class RemoteChromeController(ChromeControllerBase):
def ResetBrowserState(self):
"""Override resetting Chrome local state."""
logging.info('Resetting Chrome local state')
- package = OPTIONS.ChromePackage().package
- # Remove the Chrome Profile and the various disk caches. Other parts
- # theoretically should not affect loading performance. Also remove the tab
- # state to prevent it from growing infinitely. [:D]
- for directory in ['app_chrome/Default', 'cache', 'app_chrome/ShaderCache',
- 'app_tabs']:
- cmd = ['rm', '-rf', '/data/data/{}/{}'.format(package, directory)]
- self._device.adb.Shell(subprocess.list2cmdline(cmd))
+ chrome_setup.ResetChromeLocalState(self._device,
+ OPTIONS.ChromePackage().package)
+
def RebootDevice(self):
"""Reboot the remote device."""
« no previous file with comments | « tools/android/loading/chrome_setup.py ('k') | tools/android/loading/wpr_helper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698