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

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

Issue 2733233002: [tools/android] Replace FlagReplacer with flag_changer equivalent (Closed)
Patch Set: Created 3 years, 9 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/controller.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/device_setup.py
diff --git a/tools/android/loading/device_setup.py b/tools/android/loading/device_setup.py
index e39ab86b358ef2d4d7c416e9d299c1d3cd66c3c2..19e0d99a364e7314d353bfa2efda79f6234f4b55 100644
--- a/tools/android/loading/device_setup.py
+++ b/tools/android/loading/device_setup.py
@@ -18,7 +18,6 @@ _SRC_DIR = os.path.abspath(os.path.join(
_CATAPULT_DIR = os.path.join(_SRC_DIR, 'third_party', 'catapult')
sys.path.append(os.path.join(_CATAPULT_DIR, 'devil'))
from devil.android import device_utils
-from devil.android import flag_changer
from devil.android import forwarder
from devil.android.sdk import adb_wrapper
from devil.android.sdk import intent
@@ -121,29 +120,6 @@ def DeviceSubmitShellCommandQueue(device, command_queue):
@contextlib.contextmanager
-def FlagReplacer(device, command_line_path, new_flags):
- """Replaces chrome flags in a context, restores them afterwards.
-
- Args:
- device: Device to target, from DeviceUtils. Can be None, in which case this
- context manager is a no-op.
- command_line_path: Full path to the command-line file.
- new_flags: Flags to replace.
- """
- # If we're logging requests from a local desktop chrome instance there is no
- # device.
- if not device:
- yield
- return
- changer = flag_changer.FlagChanger(device, command_line_path)
- changer.ReplaceFlags(new_flags)
- try:
- yield
- finally:
- changer.Restore()
-
-
-@contextlib.contextmanager
def ForwardPort(device, local, remote):
"""Forwards a local port to a remote one on a device in a context."""
# If we're logging requests from a local desktop chrome instance there is no
« no previous file with comments | « tools/android/loading/controller.py ('k') | tools/android/loading/wpr_helper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698