| 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): |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 def __init__(self, name, desktop, slow_handler, bounce, page_set): | 324 def __init__(self, name, desktop, slow_handler, bounce, page_set): |
| 325 super(EmptyTouchHandlerPage, self).__init__( | 325 super(EmptyTouchHandlerPage, self).__init__( |
| 326 url='file://tough_scheduling_cases/empty_touch_handler' + | 326 url='file://tough_scheduling_cases/empty_touch_handler' + |
| 327 ('_desktop' if desktop else '') + '.html?' + name, | 327 ('_desktop' if desktop else '') + '.html?' + name, |
| 328 page_set=page_set) | 328 page_set=page_set) |
| 329 | 329 |
| 330 if slow_handler: | 330 if slow_handler: |
| 331 self.synthetic_delays = { | 331 self.synthetic_delays = { |
| 332 'blink.HandleInputEvent': {'target_duration': 0.2} | 332 'blink.HandleInputEvent': {'target_duration': 0.2} |
| 333 } | 333 } |
| 334 |
| 334 self.bounce = bounce | 335 self.bounce = bounce |
| 335 | 336 |
| 336 def RunSmoothness(self, action_runner): | 337 def RunSmoothness(self, action_runner): |
| 337 if self.bounce: | 338 if self.bounce: |
| 338 interaction = action_runner.BeginGestureInteraction( | 339 interaction = action_runner.BeginGestureInteraction( |
| 339 'ScrollBounceAction', is_smooth=True) | 340 'ScrollBounceAction', is_smooth=True) |
| 340 action_runner.ScrollBouncePage() | 341 action_runner.ScrollBouncePage() |
| 341 interaction.End() | 342 interaction.End() |
| 342 else: | 343 else: |
| 343 interaction = action_runner.BeginGestureInteraction( | 344 interaction = action_runner.BeginGestureInteraction( |
| (...skipping 19 matching lines...) Expand all Loading... |
| 363 'ScrollBounceAction', is_smooth=True) | 364 'ScrollBounceAction', is_smooth=True) |
| 364 action_runner.ScrollBouncePage() | 365 action_runner.ScrollBouncePage() |
| 365 interaction.End() | 366 interaction.End() |
| 366 | 367 |
| 367 | 368 |
| 368 class ToughSchedulingCasesPageSet(page_set_module.PageSet): | 369 class ToughSchedulingCasesPageSet(page_set_module.PageSet): |
| 369 | 370 |
| 370 """ Tough scheduler latency test cases """ | 371 """ Tough scheduler latency test cases """ |
| 371 | 372 |
| 372 def __init__(self): | 373 def __init__(self): |
| 373 super(ToughSchedulingCasesPageSet, self).__init__( | 374 super(ToughSchedulingCasesPageSet, self).__init__() |
| 374 archive_data_file='data/tough_scheduling_cases.json') | |
| 375 | 375 |
| 376 # Why: Simple scrolling baseline | 376 # Why: Simple scrolling baseline |
| 377 self.AddPage(ToughSchedulingCasesPage( | 377 self.AddPage(ToughSchedulingCasesPage( |
| 378 'file://tough_scheduling_cases/simple_text_page.html', | 378 'file://tough_scheduling_cases/simple_text_page.html', |
| 379 self)) | 379 self)) |
| 380 self.AddPage(Page1(self)) | 380 self.AddPage(Page1(self)) |
| 381 self.AddPage(Page2(self)) | 381 self.AddPage(Page2(self)) |
| 382 self.AddPage(Page3(self)) | 382 self.AddPage(Page3(self)) |
| 383 self.AddPage(Page4(self)) | 383 self.AddPage(Page4(self)) |
| 384 self.AddPage(Page5(self)) | 384 self.AddPage(Page5(self)) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 # Why: Scroll bounce with slow handler on desktop, blocks only once until | 458 # Why: Scroll bounce with slow handler on desktop, blocks only once until |
| 459 # ACK timeout. | 459 # ACK timeout. |
| 460 self.AddPage(EmptyTouchHandlerPage( | 460 self.AddPage(EmptyTouchHandlerPage( |
| 461 name='bounce_desktop_slow_handler', | 461 name='bounce_desktop_slow_handler', |
| 462 desktop=True, | 462 desktop=True, |
| 463 slow_handler=True, | 463 slow_handler=True, |
| 464 bounce=True, | 464 bounce=True, |
| 465 page_set=self)) | 465 page_set=self)) |
| 466 # Why: For measuring the latency of scroll-synchronized effects. | 466 # Why: For measuring the latency of scroll-synchronized effects. |
| 467 self.AddPage(SynchronizedScrollOffsetPage(page_set=self)) | 467 self.AddPage(SynchronizedScrollOffsetPage(page_set=self)) |
| 468 | |
| 469 real_pages_url_list = [ | |
| 470 'http://www.latimes.com', | |
| 471 ('http://io9.com/the-10-most-shocking-characters-that-george-r-r-' + | |
| 472 'martin-1579481155/+tinaamini'), | |
| 473 'http://ftw.usatoday.com/2014/05/spelling-bee-rules-shenanigans', | |
| 474 'http://m.espn.go.com/nhl/rankings' | |
| 475 ] | |
| 476 | |
| 477 for url in real_pages_url_list: | |
| 478 self.AddPage(ToughSchedulingCasesPage(url, self)) | |
| OLD | NEW |