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 from telemetry.page import page as page_module | 4 from telemetry.page import page as page_module |
5 from telemetry.page import page_set as page_set_module | 5 from telemetry.page import page_set as page_set_module |
6 | 6 |
7 | 7 |
8 class ToughSchedulingCasesPage(page_module.Page): | 8 class ToughSchedulingCasesPage(page_module.Page): |
9 | 9 |
10 def __init__(self, url, page_set): | 10 def __init__(self, url, page_set): |
11 super(ToughSchedulingCasesPage, self).__init__( | 11 super(ToughSchedulingCasesPage, self).__init__( |
12 url=url, page_set=page_set, credentials_path='data/credentials.json') | 12 url=url, page_set=page_set, credentials_path='data/credentials.json') |
13 self.user_agent_type = 'mobile' | 13 self.user_agent_type = 'mobile' |
14 self.archive_data_file = 'data/tough_scheduling_cases.json' | 14 self.archive_data_file = 'data/tough_scheduling_cases.json' |
15 | 15 |
16 def RunSmoothness(self, action_runner): | 16 def RunSmoothness(self, action_runner): |
17 interaction = action_runner.BeginGestureInteraction( | 17 interaction = action_runner.BeginGestureInteraction( |
18 'ScrollAction', is_smooth=True) | 18 'ScrollAction', is_smooth=True) |
19 action_runner.ScrollPage() | 19 action_runner.ScrollPage() |
20 interaction.End() | 20 interaction.End() |
21 | 21 |
22 def RunTaskExecutionTime(self, action_runner): | |
23 interaction = action_runner.BeginGestureInteraction( | |
24 'ScrollAction', is_smooth=True) | |
25 action_runner.ScrollPage() | |
26 interaction.End() | |
27 | |
28 | 22 |
29 class Page1(ToughSchedulingCasesPage): | 23 class Page1(ToughSchedulingCasesPage): |
30 | 24 |
31 """ Why: Simulate oversubscribed main thread """ | 25 """ Why: Simulate oversubscribed main thread """ |
32 | 26 |
33 def __init__(self, page_set): | 27 def __init__(self, page_set): |
34 super(Page1, self).__init__( | 28 super(Page1, self).__init__( |
35 url='file://tough_scheduling_cases/simple_text_page.html?main_busy', | 29 url='file://tough_scheduling_cases/simple_text_page.html?main_busy', |
36 page_set=page_set) | 30 page_set=page_set) |
37 | 31 |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 page_set=self)) | 475 page_set=self)) |
482 # Why: For measuring the latency of scroll-synchronized effects. | 476 # Why: For measuring the latency of scroll-synchronized effects. |
483 self.AddPage(SynchronizedScrollOffsetPage(page_set=self)) | 477 self.AddPage(SynchronizedScrollOffsetPage(page_set=self)) |
484 # Why: Good examples of poor initial scrolling | 478 # Why: Good examples of poor initial scrolling |
485 self.AddPage(ToughSchedulingCasesPage( | 479 self.AddPage(ToughSchedulingCasesPage( |
486 'http://www.latimes.com', | 480 'http://www.latimes.com', |
487 self)) | 481 self)) |
488 self.AddPage(ToughSchedulingCasesPage( | 482 self.AddPage(ToughSchedulingCasesPage( |
489 'http://m.espn.go.com/nhl/rankings', | 483 'http://m.espn.go.com/nhl/rankings', |
490 self)) | 484 self)) |
OLD | NEW |