OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from telemetry.page import page as page_module | 5 from telemetry.page import page as page_module |
6 from telemetry.page import page_set as page_set_module | 6 from telemetry.page import page_set as page_set_module |
7 | 7 |
8 | 8 |
9 class KeyHitTestCasesPage(page_module.Page): | 9 class KeyHitTestCasesPage(page_module.Page): |
10 | 10 |
11 def __init__(self, url, page_set): | 11 def __init__(self, url, page_set): |
12 super(KeyHitTestCasesPage, self).__init__( | 12 super(KeyHitTestCasesPage, self).__init__( |
13 url=url, page_set=page_set, credentials_path = 'data/credentials.json') | 13 url=url, page_set=page_set, credentials_path = 'data/credentials.json') |
14 self.user_agent_type = 'mobile' | 14 self.user_agent_type = 'mobile' |
15 | 15 |
16 def RunNavigateSteps(self, action_runner): | 16 def RunNavigateSteps(self, action_runner): |
17 action_runner.NavigateToPage(self) | 17 action_runner.NavigateToPage(self) |
18 action_runner.Wait(2) | 18 action_runner.Wait(2) |
19 | 19 |
20 def RunSmoothness(self, action_runner): | 20 def RunPageInteractions(self, action_runner): |
21 action_runner.Wait(2) | 21 action_runner.Wait(2) |
22 for _ in xrange(100): | 22 for _ in xrange(100): |
23 self.TapButton(action_runner) | 23 self.TapButton(action_runner) |
24 | 24 |
25 | 25 |
26 class PaperCalculatorHitTest(KeyHitTestCasesPage): | 26 class PaperCalculatorHitTest(KeyHitTestCasesPage): |
27 | 27 |
28 def __init__(self, page_set): | 28 def __init__(self, page_set): |
29 super(PaperCalculatorHitTest, self).__init__( | 29 super(PaperCalculatorHitTest, self).__init__( |
30 # Generated from https://github.com/zqureshi/paper-calculator | 30 # Generated from https://github.com/zqureshi/paper-calculator |
(...skipping 15 matching lines...) Expand all Loading... |
46 interaction.End() | 46 interaction.End() |
47 | 47 |
48 | 48 |
49 class KeyHitTestCasesPageSet(page_set_module.PageSet): | 49 class KeyHitTestCasesPageSet(page_set_module.PageSet): |
50 | 50 |
51 def __init__(self): | 51 def __init__(self): |
52 super(KeyHitTestCasesPageSet, self).__init__( | 52 super(KeyHitTestCasesPageSet, self).__init__( |
53 user_agent_type='mobile') | 53 user_agent_type='mobile') |
54 | 54 |
55 self.AddUserStory(PaperCalculatorHitTest(self)) | 55 self.AddUserStory(PaperCalculatorHitTest(self)) |
OLD | NEW |