summaryrefslogtreecommitdiffstats
path: root/third_party/android_testrunner
diff options
context:
space:
mode:
authorbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-13 11:11:55 +0000
committerbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-13 11:11:55 +0000
commit16794a3537a5ff93b0831c0902d18d90efd4e73d (patch)
treecab44a114b6003858cd64e3192de57c377682b33 /third_party/android_testrunner
parent074d55d8bdc146c821193603f1e52eff69881e42 (diff)
downloadchromium_src-16794a3537a5ff93b0831c0902d18d90efd4e73d.zip
chromium_src-16794a3537a5ff93b0831c0902d18d90efd4e73d.tar.gz
chromium_src-16794a3537a5ff93b0831c0902d18d90efd4e73d.tar.bz2
Android: move functions added in third_party to android_commands.
Following http://codereview.chromium.org/10692132. That patch effectively forked adb_interface.py under third_party. We already have our android_commands.py wrapper, so let's use that and avoid forking. BUG= TEST=./build/android/run_tests.py -s out/Release/base_unittests_apk/base_unittests-debug.apk -e 1 Review URL: https://chromiumcodereview.appspot.com/10736049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146557 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/android_testrunner')
-rw-r--r--third_party/android_testrunner/README.chromium5
-rw-r--r--third_party/android_testrunner/adb_interface.py48
2 files changed, 2 insertions, 51 deletions
diff --git a/third_party/android_testrunner/README.chromium b/third_party/android_testrunner/README.chromium
index a2e76f0..d62c373 100644
--- a/third_party/android_testrunner/README.chromium
+++ b/third_party/android_testrunner/README.chromium
@@ -9,9 +9,8 @@ This package is the scripts used to run the unit test for Android and from
Android Gingerbread.
Local Modifications:
-1. Added functions to start/kill/restart the adb server.
-2. Added function of WaitForSystemBootCompleted to wait for the flag of
-sys.boot_completed to be set.
+There are no local modifications, all files were copied from
+<android_gingerbread_tree>/development/testrunner/
Here is the detail steps
1. Checkout Android source code
diff --git a/third_party/android_testrunner/adb_interface.py b/third_party/android_testrunner/adb_interface.py
index 9109916..1928c73 100644
--- a/third_party/android_testrunner/adb_interface.py
+++ b/third_party/android_testrunner/adb_interface.py
@@ -51,21 +51,6 @@ class AdbInterface:
"""Direct all future commands to Android target with the given serial."""
self._target_arg = "-s %s" % serial
- def RestartAdbServer(self):
- """Restart the adb server."""
- self.KillAdbServer()
- self.StartAdbServer()
-
- def KillAdbServer(self):
- """Kill adb server."""
- adb_cmd = "adb kill-server"
- return run_command.RunCommand(adb_cmd)
-
- def StartAdbServer(self):
- """Start adb server."""
- adb_cmd = "adb start-server"
- return run_command.RunCommand(adb_cmd)
-
def SendCommand(self, command_string, timeout_time=20, retry_count=3):
"""Send a command via adb.
@@ -434,39 +419,6 @@ class AdbInterface:
if not success:
raise errors.WaitForResponseTimedOutError()
- def WaitForSystemBootCompleted(self, wait_time=120):
- """Waits for targeted system's boot_completed flag to be set.
-
- Args:
- wait_time: time in seconds to wait
-
- Raises:
- WaitForResponseTimedOutError if wait_time elapses and flag still not
- set.
- """
- logger.Log("Waiting for system boot completed...")
- self.SendCommand("wait-for-device")
- # Now the device is there, but system not boot completed.
- # Query the sys.boot_completed flag with a basic command
- boot_completed = False
- attempts = 0
- wait_period = 5
- while not boot_completed and (attempts*wait_period) < wait_time:
- output = self.SendShellCommand("getprop sys.boot_completed", retry_count=1)
- output = output.strip()
- if output == "1":
- boot_completed = True
- else:
- # If 'error: xxx' returned when querying the flag, it means
- # adb server lost the connection to the emulator, so restart the adb server.
- if "error:" in output:
- self.RestartAdbServer()
- time.sleep(wait_period)
- attempts += 1
- if not boot_completed:
- raise errors.WaitForResponseTimedOutError(
- "sys.boot_completed flag was not set after %s seconds" % wait_time)
-
def WaitForBootComplete(self, wait_time=120):
"""Waits for targeted device's bootcomplete flag to be set.