Commit 9f332b87 authored by rnephew's avatar rnephew Committed by Commit bot

Add android acceptance test to telemetry.

This telemetry test closely mimics the android acceptance test for power.
It uses the same websites; sits on them for 20 seconds, scrolls down, sits 20 more seconds.

BUG=421569

Review URL: https://codereview.chromium.org/654263005

Cr-Commit-Position: refs/heads/master@{#300147}
parent c9f03f14
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from measurements import power
import page_sets
from telemetry import benchmark
@benchmark.Enabled('android')
class PowerAndroidAcceptance(benchmark.Benchmark):
"""Android power acceptance test."""
test = power.Power
page_set = page_sets.AndroidAcceptancePageSet
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from metrics import power
from telemetry.page import page_test
class Power(page_test.PageTest):
def __init__(self):
super(Power, self).__init__('RunPowerPageInteractions')
self._power_metric = None
def WillStartBrowser(self, platform):
self._power_metric = power.PowerMetric(platform)
def DidNavigateToPage(self, page, tab):
self._power_metric.Start(page, tab)
def ValidateAndMeasurePage(self, page, tab, results):
self._power_metric.Stop(page, tab)
self._power_metric.AddResults(tab, results)
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class AndroidAcceptancePage(page_module.Page):
def __init__(self, url, page_set, name=''):
super(AndroidAcceptancePage, self).__init__(
url=url, page_set=page_set, name=name,
credentials_path = 'data/credentials.json')
self.user_agent_type = 'desktop'
self.archive_data_file = 'data/android_acceptance.json'
def RunPowerPageInteractions(self, action_runner):
action_runner.Wait(40)
class AndroidAcceptancePageSet(page_set_module.PageSet):
""" Pages used in android acceptance testing. """
def __init__(self):
super(AndroidAcceptancePageSet, self).__init__(
user_agent_type='desktop', # Android acceptance uses desktop.
archive_data_file='data/android_acceptance.json',
bucket=page_set_module.PARTNER_BUCKET)
urls_list = [
'http://www.amazon.com',
'http://www.cnn.com',
'http://www.msn.com',
]
for url in urls_list:
self.AddPage(AndroidAcceptancePage(url, self))
{
"description": "Describes the Web Page Replay archives for a page set. Don't edit by hand! Use record_wpr for updating.",
"archives": {
"android_acceptance_000.wpr": [
"http://www.amazon.com",
"http://www.cnn.com",
"http://www.msn.com"
]
}
}
\ No newline at end of file
493ab6fe483507e65a2d72a11a64920ccda32bbf
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment