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

Unified Diff: tools/telemetry/telemetry/core/chrome/android_browser_backend.py

Issue 16000002: Telemetry / Android: removes SetDevToolsPreferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/chrome/android_browser_backend.py
diff --git a/tools/telemetry/telemetry/core/chrome/android_browser_backend.py b/tools/telemetry/telemetry/core/chrome/android_browser_backend.py
index 58c8b6806aa8c06e128559eec14477303f8f2142..ab8b3ddbd384cc65c5c8f21fdaabdebd3c2bb9ad 100644
--- a/tools/telemetry/telemetry/core/chrome/android_browser_backend.py
+++ b/tools/telemetry/telemetry/core/chrome/android_browser_backend.py
@@ -1,7 +1,7 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import json
+
import logging
import os
import subprocess
@@ -33,9 +33,6 @@ class AndroidBrowserBackendSettings(object):
logging.critical('Profiles cannot be overriden with current configuration')
sys.exit(1)
- def SetDevToolsPreferences(self):
- pass
-
@property
def is_content_shell(self):
return False
@@ -63,61 +60,6 @@ class ChromeBackendSettings(AndroidBrowserBackendSettings):
def PushProfile(self, new_profile_dir):
self.adb.Push(new_profile_dir, self._profile_dir)
- def SetDevToolsPreferences(self):
- # TODO(bulach): Once --enable-remote-debugging flag makes its way to the
- # oldest version under test (m27 goes to stable), remove this function.
- if (not self.adb.Adb().CanAccessProtectedFileContents()):
- return
-
- prefs_file = self._profile_dir + 'Default/Preferences'
- # Reuse the previous preferences if available, otherwise take the slow path
- # (launch chrome and wait for it to be created).
- if ChromeBackendSettings._default_preferences_file:
- self.adb.Adb().SetProtectedFileContents(
- prefs_file,
- ChromeBackendSettings._default_preferences_file)
- return
-
- # Make sure we can find the apps' prefs file
- if not self.adb.FileExistsOnDevice(prefs_file):
- # Start it up the first time so we can tweak the prefs.
- self.adb.StartActivity(self.package,
- self.activity,
- True,
- None,
- None)
- retries = 0
- timeout = 3
- time.sleep(timeout)
- while not self.adb.Adb().GetProtectedFileContents(prefs_file):
- time.sleep(timeout)
- retries += 1
- timeout *= 2
- if retries == 3:
- logging.critical('android_browser_backend: Could not find '
- 'preferences file %s for %s',
- prefs_file, self.package)
- raise exceptions.BrowserGoneException('Missing preferences file.')
- self.adb.CloseApplication(self.package)
-
- preferences = json.loads(''.join(
- self.adb.Adb().GetProtectedFileContents(prefs_file)))
- changed = False
- if 'devtools' not in preferences:
- preferences['devtools'] = {}
- changed = True
- if not preferences['devtools'].get('remote_enabled'):
- preferences['devtools']['remote_enabled'] = True
- changed = True
- ChromeBackendSettings._default_preferences_file = json.dumps(
- preferences, indent=2)
- if changed:
- logging.warning('Manually enabled devtools protocol on %s' %
- self.package)
- self.adb.Adb().SetProtectedFileContents(
- prefs_file,
- ChromeBackendSettings._default_preferences_file)
-
@property
def _profile_dir(self):
return '/data/data/%s/app_chrome/' % self.package
@@ -252,8 +194,6 @@ class AndroidBrowserBackend(browser_backend.BrowserBackend):
self._adb.Adb().SetProtectedFileContents(
self._backend_settings.cmdline_file, ' '.join(args))
- backend_settings.SetDevToolsPreferences()
-
# Start it up with a fresh log.
self._adb.RunShellCommand('logcat -c')
self._adb.StartActivity(self._backend_settings.package,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698