Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Unified Diff: systrace/profile_chrome/agents_unittest.py

Issue 2295913002: Enable some profile_chrome unit tests on Trybots (Closed) Base URL: https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git@master
Patch Set: Add never-run decorator to perf agent as well Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698