Index: tools/telemetry/telemetry/core/chrome/cros_browser_backend.py |
=================================================================== |
--- tools/telemetry/telemetry/core/chrome/cros_browser_backend.py (revision 202623) |
+++ tools/telemetry/telemetry/core/chrome/cros_browser_backend.py (working copy) |
@@ -5,6 +5,7 @@ |
import os |
import subprocess |
+from telemetry.core import exceptions |
from telemetry.core import util |
from telemetry.core.chrome import browser_backend |
from telemetry.core.chrome import cros_util |
@@ -101,6 +102,14 @@ |
self.Close() |
raise |
+ # chrome_branch_number is set in _PostBrowserStartupInitialization. |
+ # Without --skip-hwid-check (introduced in crrev.com/203397), devices/VMs |
+ # will be stuck on the bad hwid screen. |
+ if self.chrome_branch_number <= 1500 and not self.hwid: |
+ raise exceptions.LoginException( |
+ 'Hardware id not set on device/VM. --skip-hwid-check not supported ' |
+ 'with chrome branches 1500 or earlier.') |
+ |
if self._is_guest: |
cros_util.NavigateGuestLogin(self, cri) |
# Guest browsing shuts down the current browser and launches an incognito |
@@ -129,6 +138,10 @@ |
if not self._is_guest: |
args.append('--auth-ext-path=%s' % self._login_ext_dir) |
+ # Skip hwid check on systems that don't have a hwid set, eg VMs. |
+ if not self.hwid: |
+ args.append('--skip-hwid-check') |
+ |
return args |
@property |
@@ -139,6 +152,10 @@ |
return int(pid) |
return None |
+ @property |
+ def hwid(self): |
+ return self._cri.RunCmdOnDevice(['/usr/bin/crossystem', 'hwid'])[0] |
+ |
def GetRemotePort(self, _): |
return self._cri.GetRemotePort() |