| 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 import flag_changer | 8 from pylib import flag_changer |
| 9 from pylib.device import intent | 9 from pylib.device import intent |
| 10 from pylib.instrumentation import test_options as instr_test_options | 10 from pylib.instrumentation import test_options as instr_test_options |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #override | 53 #override |
| 54 def InstallTestPackage(self): | 54 def InstallTestPackage(self): |
| 55 self.test_pkg.Install(self.device) | 55 self.test_pkg.Install(self.device) |
| 56 | 56 |
| 57 #override | 57 #override |
| 58 def PushDataDeps(self): | 58 def PushDataDeps(self): |
| 59 pass | 59 pass |
| 60 | 60 |
| 61 #override | 61 #override |
| 62 def _RunTest(self, test, timeout): | 62 def _RunTest(self, test, timeout): |
| 63 self.device.old_interface.ClearApplicationState(self._package) | 63 self.device.ClearApplicationState(self._package) |
| 64 if self.flags: | 64 if self.flags: |
| 65 if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test): | 65 if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test): |
| 66 self.flags.RemoveFlags(['--disable-fre']) | 66 self.flags.RemoveFlags(['--disable-fre']) |
| 67 else: | 67 else: |
| 68 self.flags.AddFlags(['--disable-fre']) | 68 self.flags.AddFlags(['--disable-fre']) |
| 69 self.device.StartActivity( | 69 self.device.StartActivity( |
| 70 intent.Intent(action='android.intent.action.MAIN', | 70 intent.Intent(action='android.intent.action.MAIN', |
| 71 activity=self._activity, | 71 activity=self._activity, |
| 72 package=self._package), | 72 package=self._package), |
| 73 blocking=True, | 73 blocking=True, |
| 74 force_stop=True) | 74 force_stop=True) |
| 75 return self.device.old_interface.RunUIAutomatorTest( | 75 return self.device.old_interface.RunUIAutomatorTest( |
| 76 test, self.test_pkg.GetPackageName(), timeout) | 76 test, self.test_pkg.GetPackageName(), timeout) |
| OLD | NEW |