Chromium Code Reviews| Index: tools/perf/page_sets/android_acceptance.py |
| diff --git a/tools/perf/page_sets/android_acceptance.py b/tools/perf/page_sets/android_acceptance.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c3d7ec70d047ee40f37016f5969c7ad7db25c022 |
| --- /dev/null |
| +++ b/tools/perf/page_sets/android_acceptance.py |
| @@ -0,0 +1,80 @@ |
| +# 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 RunPageInteractions(self, action_runner): |
| + interaction = action_runner.BeginGestureInteraction( |
| + 'ScrollAction', is_smooth=True) |
|
tonyg
2014/10/15 23:26:49
I believe is_smooth turns on chrome tracing. We'll
rnephew (Reviews Here)
2014/10/16 17:02:24
Done.
|
| + action_runner.Wait(20) |
| + action_runner.ScrollPage() |
|
tonyg
2014/10/15 23:26:49
I don't believe they do the scroll, right? Adding
sullivan
2014/10/16 14:47:30
Also, is it possible to structure this so we can u
rnephew (Reviews Here)
2014/10/16 17:02:24
Done.
How do I get the websites to load to the SD
|
| + action_runner.Wait(20) |
| + interaction.End() |
| + |
| + |
| +class AmazonPage(AndroidAcceptancePage): |
| + |
| + """ Why: Part of androids power acceptance test """ |
| + |
| + def __init__(self, page_set): |
| + super(AmazonPage, self).__init__( |
| + url='https://www.amazon.com', |
| + page_set=page_set) |
| + |
| + def RunNavigateSteps(self, action_runner): |
| + action_runner.NavigateToPage(self) |
| + action_runner.WaitForElement(text='Conditions of Use') |
|
tonyg
2014/10/15 23:26:49
Why are we waiting for an element? AFAICT, we shou
rnephew (Reviews Here)
2014/10/16 17:02:24
Done.
|
| + |
| + |
| +class CnnPage(AndroidAcceptancePage): |
| + |
| + """ Why: Part of androids power acceptance test """ |
| + |
| + def __init__(self, page_set): |
| + super(CnnPage, self).__init__( |
| + url='http://www.cnn.com/', |
| + page_set=page_set) |
| + |
| + def RunNavigateSteps(self, action_runner): |
| + action_runner.NavigateToPage(self) |
| + action_runner.WaitForElement(text='Contact us') |
| + |
| + |
| +class MsnPage(AndroidAcceptancePage): |
| + |
| + """ Why: Part of androids power acceptance test """ |
| + |
| + def __init__(self, page_set): |
| + super(MsnPage, self).__init__( |
| + url='http://www.msn.com', |
| + page_set=page_set) |
| + |
| + def RunNavigateSteps(self, action_runner): |
| + action_runner.NavigateToPage(self) |
| + action_runner.WaitForElement(text='Privacy') |
| + |
| + |
| +class AndroidAcceptancePageSet(page_set_module.PageSet): |
| + |
| + """ Pages used in android acceptance testing. """ |
| + |
| + def __init__(self): |
| + super(AndroidAcceptancePageSet, self).__init__( |
| + user_agent_type='desktop', |
|
sullivan
2014/10/16 14:47:30
Why desktop? Does the "real" acceptance test use a
rnephew (Reviews Here)
2014/10/16 17:02:24
Added comment explaining why it uses desktop user
|
| + archive_data_file='data/android_acceptance.json', |
| + bucket=page_set_module.PARTNER_BUCKET) |
| + |
| + self.AddPage(AmazonPage(self)) |
|
tonyg
2014/10/15 23:26:49
Is it possible to write a loop that does something
rnephew (Reviews Here)
2014/10/16 17:02:24
Done.
|
| + self.AddPage(CnnPage(self)) |
| + self.AddPage(MsnPage(self)) |