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__(url=url, page_set=page_set) | 11 super(ToughSchedulingCasesPage, self).__init__( |
12 self.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 | 22 |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 action_runner.ScrollBouncePage() | 369 action_runner.ScrollBouncePage() |
370 interaction.End() | 370 interaction.End() |
371 | 371 |
372 | 372 |
373 class ToughSchedulingCasesPageSet(page_set_module.PageSet): | 373 class ToughSchedulingCasesPageSet(page_set_module.PageSet): |
374 | 374 |
375 """ Tough scheduler latency test cases """ | 375 """ Tough scheduler latency test cases """ |
376 | 376 |
377 def __init__(self): | 377 def __init__(self): |
378 super(ToughSchedulingCasesPageSet, self).__init__( | 378 super(ToughSchedulingCasesPageSet, self).__init__( |
379 credentials_path='data/credentials.json', | |
380 user_agent_type='mobile', | 379 user_agent_type='mobile', |
381 archive_data_file='data/tough_scheduling_cases.json', | 380 archive_data_file='data/tough_scheduling_cases.json', |
382 bucket=page_set_module.INTERNAL_BUCKET) | 381 bucket=page_set_module.INTERNAL_BUCKET) |
383 | 382 |
384 # Why: Simple scrolling baseline | 383 # Why: Simple scrolling baseline |
385 self.AddPage(ToughSchedulingCasesPage( | 384 self.AddPage(ToughSchedulingCasesPage( |
386 'file://tough_scheduling_cases/simple_text_page.html', | 385 'file://tough_scheduling_cases/simple_text_page.html', |
387 self)) | 386 self)) |
388 self.AddPage(Page1(self)) | 387 self.AddPage(Page1(self)) |
389 self.AddPage(Page2(self)) | 388 self.AddPage(Page2(self)) |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 page_set=self)) | 475 page_set=self)) |
477 # Why: For measuring the latency of scroll-synchronized effects. | 476 # Why: For measuring the latency of scroll-synchronized effects. |
478 self.AddPage(SynchronizedScrollOffsetPage(page_set=self)) | 477 self.AddPage(SynchronizedScrollOffsetPage(page_set=self)) |
479 # Why: Good examples of poor initial scrolling | 478 # Why: Good examples of poor initial scrolling |
480 self.AddPage(ToughSchedulingCasesPage( | 479 self.AddPage(ToughSchedulingCasesPage( |
481 'http://www.latimes.com', | 480 'http://www.latimes.com', |
482 self)) | 481 self)) |
483 self.AddPage(ToughSchedulingCasesPage( | 482 self.AddPage(ToughSchedulingCasesPage( |
484 'http://m.espn.go.com/nhl/rankings', | 483 'http://m.espn.go.com/nhl/rankings', |
485 self)) | 484 self)) |
OLD | NEW |