AI 143688: am: CL 143562 Usability fixes for runtest.py
  Original author: brettchabot
  Merged from: //branches/cupcake/...

Automated import of CL 143688
diff --git a/testrunner/runtest.py b/testrunner/runtest.py
index bf5bb22..a4df950 100755
--- a/testrunner/runtest.py
+++ b/testrunner/runtest.py
@@ -53,6 +53,10 @@
       "The runtest script works in two ways.  You can query it "
       "for a list of tests, or you can launch one or more tests.")
 
+  def __init__(self):
+    # disable logging of timestamp
+    logger.SetTimestampLogging(False)  
+
   def _ProcessOptions(self):
     """Processes command-line options."""
     # TODO error messages on once-only or mutually-exclusive options.
@@ -178,10 +182,14 @@
         self._coverage_gen.EnableCoverageBuild()
         self._AddBuildTarget(self._coverage_gen.GetEmmaBuildPath(), target_set)
       target_build_string = " ".join(list(target_set))
-      logger.Log("Building %s" % target_build_string)
+      logger.Log("mmm %s" % target_build_string)
       cmd = 'ONE_SHOT_MAKEFILE="%s" make -C "%s" files' %  (target_build_string,
                                                             self._root_path)
-      if not self._options.preview:
+      if self._options.preview:
+        # in preview mode, just display to the user what command would have been
+        # run
+        logger.Log("adb sync")
+      else:
         run_command.RunCommand(cmd, return_output=False)
         logger.Log("Syncing to device...")
         self._adb.Sync()
@@ -259,6 +267,10 @@
         self._DumpTests()
         return
 
+      if not self._adb.IsDevicePresent():
+        logger.Log("Error: specified device cannot be found")
+        return
+
       if not self._options.skip_build:
         self._DoBuild()