From 3b322a36c90ae84c3d5d27b656e4fd30f6f70c37 Mon Sep 17 00:00:00 2001 From: scott Date: Mon, 19 Mar 2018 10:53:16 +0000 Subject: [PATCH] Speedometer: Changing workload to use Speedometer 2.0 by default --- wa/workloads/speedometer/__init__.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wa/workloads/speedometer/__init__.py b/wa/workloads/speedometer/__init__.py index 66b06d1d..af4e0e8b 100755 --- a/wa/workloads/speedometer/__init__.py +++ b/wa/workloads/speedometer/__init__.py @@ -25,6 +25,7 @@ class Speedometer(UiautoWorkload): name = 'speedometer' regex=re.compile(r'Speedometer Score ([\d.]+)') + versions = ['1.0', '2.0'] description = ''' A workload to execute the speedometer web based benchmark @@ -35,13 +36,24 @@ class Speedometer(UiautoWorkload): ''' + parameters = [ + Parameter('version', allowed_values=versions, kind=str, default='2.0', + description=''' + The speedometer version to be used. + ''') + ] + def __init__(self, target, **kwargs): super(Speedometer, self).__init__(target, **kwargs) self.gui.timeout = 1500 + self.gui.uiauto_params['version'] = self.version def setup(self, context): super(Speedometer, self).setup(context) - self.target.execute('am start -a android.intent.action.VIEW -d http://browserbench.org/Speedometer/') + url = 'am start -a android.intent.action.VIEW -d http://browserbench.org/Speedometer' + self.version + if self.version == '1.0': + url = 'am start -a android.intent.action.VIEW -d http://browserbench.org/Speedometer' + self.target.execute(url) def update_output(self, context): super(Speedometer, self).update_output(context)