Fixes for enterprise_RemoraRequisition.
BUG=chromium:495847
TEST=enterprise_RemoraRequisition
Change-Id: I26adc9bd1f37e8289ed724ded068f29123a5eca6
Reviewed-on: https://chromium-review.googlesource.com/285652
Commit-Queue: Achuith Bhandarkar <achuith@chromium.org>
Trybot-Ready: Achuith Bhandarkar <achuith@chromium.org>
Tested-by: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: David Abrahams <resetswitch@chromium.org>
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
diff --git a/client/common_lib/cros/chrome.py b/client/common_lib/cros/chrome.py
index cda8fdf..1fe18d6 100644
--- a/client/common_lib/cros/chrome.py
+++ b/client/common_lib/cros/chrome.py
@@ -5,7 +5,9 @@
import logging, os
from autotest_lib.client.cros import constants
+from autotest_lib.client.bin import utils
from telemetry.core import exceptions, util
+from telemetry.core.platform import cros_interface
# TODO(achuith): Clean this up - crbug.com/506037.
try:
@@ -188,6 +190,19 @@
return False
+ @staticmethod
+ def wait_for_browser_restart(func):
+ """Runs func, and waits for a browser restart.
+
+ @param func: function to run.
+
+ """
+ _cri = cros_interface.CrOSInterface()
+ pid = _cri.GetChromePid()
+ Chrome.did_browser_crash(func)
+ utils.poll_for_condition(lambda: pid != _cri.GetChromePid(), timeout=60)
+
+
def wait_for_browser_to_come_up(self):
"""Waits for the browser to come up. This should only be called after a
browser crash.