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 # pylint: disable=W0401,W0614 | 4 # pylint: disable=W0401,W0614 |
5 from telemetry.page.actions.all_page_actions import * | 5 from telemetry.page.actions.all_page_actions import * |
6 from telemetry.page import page as page_module | 6 from telemetry.page import page as page_module |
7 from telemetry.page import page_set as page_set_module | 7 from telemetry.page import page_set as page_set_module |
8 | 8 |
9 | 9 |
10 class ToughSchedulingCasesPage(page_module.Page): | 10 class ToughSchedulingCasesPage(page_module.Page): |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 'scrollable_element_function': ''' | 311 'scrollable_element_function': ''' |
312 function(callback) { | 312 function(callback) { |
313 callback(document.getElementById('card')); | 313 callback(document.getElementById('card')); |
314 }''', | 314 }''', |
315 'scroll_requires_touch': True, | 315 'scroll_requires_touch': True, |
316 'direction': 'up', | 316 'direction': 'up', |
317 'speed': 150, | 317 'speed': 150, |
318 'scroll_distance_function': 'function() { return 400; }' | 318 'scroll_distance_function': 'function() { return 400; }' |
319 })) | 319 })) |
320 | 320 |
| 321 class Page21(ToughSchedulingCasesPage): |
| 322 |
| 323 """ Why: Simple pepper plugin for touch drawing """ |
| 324 |
| 325 def __init__(self, page_set): |
| 326 super(Page21, self).__init__( |
| 327 url='file://tough_scheduling_cases/simple_pepper_plugin.html', |
| 328 page_set=page_set) |
| 329 |
| 330 def RunSmoothness(self, action_runner): |
| 331 # Wait until the page and the plugin module are loaded. |
| 332 action_runner.RunAction(WaitAction( |
| 333 { |
| 334 'javascript': ('pageLoaded === true && moduleLoaded === true') |
| 335 })) |
| 336 action_runner.RunAction(ScrollAction( |
| 337 { |
| 338 'scroll_requires_touch': True, |
| 339 'direction': 'up', |
| 340 'top_start_percentage': 0.3, |
| 341 'speed': 200, |
| 342 'scroll_distance_function': 'function() { return 500; }', |
| 343 })) |
| 344 |
321 class EmptyTouchHandlerPage(ToughSchedulingCasesPage): | 345 class EmptyTouchHandlerPage(ToughSchedulingCasesPage): |
322 | 346 |
323 """ Why: Scrolling on a page with a touch handler that consumes no events but | 347 """ Why: Scrolling on a page with a touch handler that consumes no events but |
324 may be slow """ | 348 may be slow """ |
325 | 349 |
326 def __init__(self, name, desktop, slow_handler, bounce, page_set): | 350 def __init__(self, name, desktop, slow_handler, bounce, page_set): |
327 super(EmptyTouchHandlerPage, self).__init__( | 351 super(EmptyTouchHandlerPage, self).__init__( |
328 url='file://tough_scheduling_cases/empty_touch_handler' + | 352 url='file://tough_scheduling_cases/empty_touch_handler' + |
329 ('_desktop' if desktop else '') + '.html?' + name, | 353 ('_desktop' if desktop else '') + '.html?' + name, |
330 page_set=page_set) | 354 page_set=page_set) |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 'file://tough_scheduling_cases/raf_animation.html', | 420 'file://tough_scheduling_cases/raf_animation.html', |
397 self)) | 421 self)) |
398 # Why: Stress test for the scheduler | 422 # Why: Stress test for the scheduler |
399 self.AddPage(ToughSchedulingCasesPage( | 423 self.AddPage(ToughSchedulingCasesPage( |
400 'file://tough_scheduling_cases/raf_touch_animation.html', | 424 'file://tough_scheduling_cases/raf_touch_animation.html', |
401 self)) | 425 self)) |
402 self.AddPage(Page17(self)) | 426 self.AddPage(Page17(self)) |
403 self.AddPage(Page18(self)) | 427 self.AddPage(Page18(self)) |
404 self.AddPage(Page19(self)) | 428 self.AddPage(Page19(self)) |
405 self.AddPage(Page20(self)) | 429 self.AddPage(Page20(self)) |
| 430 self.AddPage(Page21(self)) |
406 # Why: Baseline for scrolling in the presence of a no-op touch handler | 431 # Why: Baseline for scrolling in the presence of a no-op touch handler |
407 self.AddPage(EmptyTouchHandlerPage( | 432 self.AddPage(EmptyTouchHandlerPage( |
408 name='baseline', | 433 name='baseline', |
409 desktop=False, | 434 desktop=False, |
410 slow_handler=False, | 435 slow_handler=False, |
411 bounce=False, | 436 bounce=False, |
412 page_set=self)) | 437 page_set=self)) |
413 # Why: Slow handler blocks scroll start | 438 # Why: Slow handler blocks scroll start |
414 self.AddPage(EmptyTouchHandlerPage( | 439 self.AddPage(EmptyTouchHandlerPage( |
415 name='slow_handler', | 440 name='slow_handler', |
(...skipping 25 matching lines...) Expand all Loading... |
441 bounce=True, | 466 bounce=True, |
442 page_set=self)) | 467 page_set=self)) |
443 # Why: Scroll bounce with slow handler on desktop, blocks only once until | 468 # Why: Scroll bounce with slow handler on desktop, blocks only once until |
444 # ACK timeout. | 469 # ACK timeout. |
445 self.AddPage(EmptyTouchHandlerPage( | 470 self.AddPage(EmptyTouchHandlerPage( |
446 name='bounce_desktop_slow_handler', | 471 name='bounce_desktop_slow_handler', |
447 desktop=True, | 472 desktop=True, |
448 slow_handler=True, | 473 slow_handler=True, |
449 bounce=True, | 474 bounce=True, |
450 page_set=self)) | 475 page_set=self)) |
451 | |
OLD | NEW |