| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Class for running uiautomator tests on a single device.""" | 5 """Class for running uiautomator tests on a single device.""" |
| 6 | 6 |
| 7 from pylib import constants | 7 from pylib import constants |
| 8 from pylib.instrumentation import test_options as instr_test_options | 8 from pylib.instrumentation import test_options as instr_test_options |
| 9 from pylib.instrumentation import test_runner as instr_test_runner | 9 from pylib.instrumentation import test_runner as instr_test_runner |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 def InstallTestPackage(self): | 47 def InstallTestPackage(self): |
| 48 self.test_pkg.Install(self.adb) | 48 self.test_pkg.Install(self.adb) |
| 49 | 49 |
| 50 #override | 50 #override |
| 51 def PushDataDeps(self): | 51 def PushDataDeps(self): |
| 52 pass | 52 pass |
| 53 | 53 |
| 54 #override | 54 #override |
| 55 def _RunTest(self, test, timeout): | 55 def _RunTest(self, test, timeout): |
| 56 self.adb.ClearApplicationState(self._package) | 56 self.adb.ClearApplicationState(self._package) |
| 57 if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test): | 57 if self.flags: |
| 58 self.flags.RemoveFlags(['--disable-fre']) | 58 if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test): |
| 59 else: | 59 self.flags.RemoveFlags(['--disable-fre']) |
| 60 self.flags.AddFlags(['--disable-fre']) | 60 else: |
| 61 self.flags.AddFlags(['--disable-fre']) |
| 61 self.adb.StartActivity(self._package, | 62 self.adb.StartActivity(self._package, |
| 62 self._activity, | 63 self._activity, |
| 63 wait_for_completion=True, | 64 wait_for_completion=True, |
| 64 action='android.intent.action.MAIN', | 65 action='android.intent.action.MAIN', |
| 65 force_stop=True) | 66 force_stop=True) |
| 66 return self.adb.RunUIAutomatorTest( | 67 return self.adb.RunUIAutomatorTest( |
| 67 test, self.test_pkg.GetPackageName(), timeout) | 68 test, self.test_pkg.GetPackageName(), timeout) |
| OLD | NEW |