Chromium Code Reviews| Index: systrace/profile_chrome/agents_unittest.py |
| diff --git a/systrace/profile_chrome/agents_unittest.py b/systrace/profile_chrome/agents_unittest.py |
| index 527162cfcf9dab8b3f0e9a46fba65a81f97dfde0..378a71b5da927df78a3f8a7f0d0d2921ec3e5b3b 100644 |
| --- a/systrace/profile_chrome/agents_unittest.py |
| +++ b/systrace/profile_chrome/agents_unittest.py |
| @@ -2,12 +2,14 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| +import time |
| import unittest |
| from profile_chrome import profiler |
| from devil.android import device_utils |
| from devil.android.sdk import intent |
| +from devil.android.sdk import keyevent |
| class BaseAgentTest(unittest.TestCase): |
| @@ -17,8 +19,15 @@ class BaseAgentTest(unittest.TestCase): |
| self.package_info = profiler.GetSupportedBrowsers()[self.browser] |
| self.device = devices[0] |
| + # Turn on and unlock device in order to access the browser. |
| + self.device.SetScreen(True) |
| + self.device.SendKeyEvent(keyevent.KEYCODE_MENU) |
| + |
| self.device.ForceStop(self.package_info.package) |
| self.device.StartActivity( |
| intent.Intent(activity=self.package_info.activity, |
| package=self.package_info.package), |
| blocking=True) |
| + |
| + # Sleep between unit tests to avoid race conditions. |
| + time.sleep(5) |
|
Zhen Wang
2016/09/01 23:16:56
Have you figured out how to know if the browser is
Sami
2016/09/02 13:01:13
Yeah, it'd be great to avoid arbitrary sleeps sinc
washingtonp
2016/09/08 22:51:36
The chrome agent tests fail to find the start trac
washingtonp
2016/09/08 22:51:36
Unfortunately, from what I have repeatedly observe
|