diff --git a/wa/framework/target/runtime_config.py b/wa/framework/target/runtime_config.py index 469503bd..6f62860b 100644 --- a/wa/framework/target/runtime_config.py +++ b/wa/framework/target/runtime_config.py @@ -844,7 +844,9 @@ class AndroidRuntimeConfig(RuntimeConfig): super(AndroidRuntimeConfig, self).__init__(target) def initialize(self): - if self.target.os != 'android': + if self.target.os not in ['android', 'chromeos']: + return + if self.target.os == 'chromeos' and not self.target.supports_android: return param_name = 'brightness' @@ -857,33 +859,39 @@ class AndroidRuntimeConfig(RuntimeConfig): Specify the screen brightness to be set for the device """) - param_name = 'airplane_mode' - self._runtime_params[param_name] = \ - RuntimeParameter(param_name, kind=bool, - setter=self.set_airplane_mode, - description=""" - Specify whether airplane mode should be - enabled for the device - """) - param_name = 'rotation' - self._runtime_params[param_name] = \ - RuntimeParameter(param_name, kind=ScreenOrientation, - setter=self.set_rotation, - description=""" - Specify the screen orientation for the device - """) - param_name = 'screen_on' - self._runtime_params[param_name] = \ - RuntimeParameter(param_name, kind=bool, - default=True, - setter=self.set_screen_state, - description=""" - Specify whether the device screen should be on - """) + + if self.target.os is 'android': + param_name = 'airplane_mode' + self._runtime_params[param_name] = \ + RuntimeParameter(param_name, kind=bool, + setter=self.set_airplane_mode, + description=""" + Specify whether airplane mode should be + enabled for the device + """) + + param_name = 'rotation' + self._runtime_params[param_name] = \ + RuntimeParameter(param_name, kind=ScreenOrientation, + setter=self.set_rotation, + description=""" + Specify the screen orientation for the device + """) + + param_name = 'screen_on' + self._runtime_params[param_name] = \ + RuntimeParameter(param_name, kind=bool, + default=True, + setter=self.set_screen_state, + description=""" + Specify whether the device screen should be on + """) def check_target(self): - if self.target.os != 'android': + if self.target.os != 'android' and self.target.os != 'chromeos': raise ConfigError('Target does not appear to be running Android') + if self.target.os == 'chromeos' and not self.target.supports_android: + raise ConfigError('Target does not appear to support Android') def validate_parameters(self): pass