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 shared_page_state | 5 from telemetry.page import shared_page_state |
6 from telemetry import story | 6 from telemetry import story |
7 | 7 |
8 | 8 |
9 class KeySilkCasesPage(page_module.Page): | 9 class KeySilkCasesPage(page_module.Page): |
10 | 10 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 295 |
296 def __init__(self, page_set, run_no_page_interactions): | 296 def __init__(self, page_set, run_no_page_interactions): |
297 super(Page16, self).__init__( | 297 super(Page16, self).__init__( |
298 url='file://key_silk_cases/inbox_app.html?swipe_to_dismiss', | 298 url='file://key_silk_cases/inbox_app.html?swipe_to_dismiss', |
299 page_set=page_set, run_no_page_interactions=run_no_page_interactions) | 299 page_set=page_set, run_no_page_interactions=run_no_page_interactions) |
300 | 300 |
301 def SwipeToDismiss(self, action_runner): | 301 def SwipeToDismiss(self, action_runner): |
302 with action_runner.CreateGestureInteraction('SwipeAction'): | 302 with action_runner.CreateGestureInteraction('SwipeAction'): |
303 action_runner.SwipeElement( | 303 action_runner.SwipeElement( |
304 left_start_ratio=0.8, top_start_ratio=0.2, | 304 left_start_ratio=0.8, top_start_ratio=0.2, |
305 direction='left', distance=400, speed_in_pixels_per_second=5000, | 305 direction='right', distance=400, speed_in_pixels_per_second=5000, |
306 element_function='document.getElementsByClassName("message")[2]') | 306 element_function='document.getElementsByClassName("message")[2]') |
307 | 307 |
308 def PerformPageInteractions(self, action_runner): | 308 def PerformPageInteractions(self, action_runner): |
309 self.SwipeToDismiss(action_runner) | 309 self.SwipeToDismiss(action_runner) |
310 | 310 |
311 | 311 |
312 class Page17(KeySilkCasesPage): | 312 class Page17(KeySilkCasesPage): |
313 | 313 |
314 def __init__(self, page_set, run_no_page_interactions): | 314 def __init__(self, page_set, run_no_page_interactions): |
315 super(Page17, self).__init__( | 315 super(Page17, self).__init__( |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 action_runner.Wait(2) | 374 action_runner.Wait(2) |
375 self.ToggleDrawer(action_runner) | 375 self.ToggleDrawer(action_runner) |
376 | 376 |
377 def PerformPageInteractions(self, action_runner): | 377 def PerformPageInteractions(self, action_runner): |
378 self.SlideDrawer(action_runner) | 378 self.SlideDrawer(action_runner) |
379 | 379 |
380 def SlideDrawer(self, action_runner): | 380 def SlideDrawer(self, action_runner): |
381 with action_runner.CreateInteraction('Action_SwipeAction'): | 381 with action_runner.CreateInteraction('Action_SwipeAction'): |
382 action_runner.SwipeElement( | 382 action_runner.SwipeElement( |
383 left_start_ratio=0.8, top_start_ratio=0.2, | 383 left_start_ratio=0.8, top_start_ratio=0.2, |
384 direction='left', distance=200, | 384 direction='right', distance=200, |
385 element_function='document.getElementById("nav-drawer").children[0]') | 385 element_function='document.getElementById("nav-drawer").children[0]') |
386 action_runner.WaitForJavaScriptCondition( | 386 action_runner.WaitForJavaScriptCondition( |
387 '!document.getElementById("nav-drawer").active') | 387 '!document.getElementById("nav-drawer").active') |
388 | 388 |
389 | 389 |
390 class Page20(KeySilkCasesPage): | 390 class Page20(KeySilkCasesPage): |
391 | 391 |
392 """ Why: Shadow DOM infinite scrolling. """ | 392 """ Why: Shadow DOM infinite scrolling. """ |
393 | 393 |
394 def __init__(self, page_set, run_no_page_interactions): | 394 def __init__(self, page_set, run_no_page_interactions): |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 | 532 |
533 def RunNavigateSteps(self, action_runner): | 533 def RunNavigateSteps(self, action_runner): |
534 super(Page25, self).RunNavigateSteps(action_runner) | 534 super(Page25, self).RunNavigateSteps(action_runner) |
535 action_runner.WaitForJavaScriptCondition( | 535 action_runner.WaitForJavaScriptCondition( |
536 'document.getElementById(":h") != null') | 536 'document.getElementById(":h") != null') |
537 action_runner.Wait(1) | 537 action_runner.Wait(1) |
538 | 538 |
539 def PerformPageInteractions(self, action_runner): | 539 def PerformPageInteractions(self, action_runner): |
540 with action_runner.CreateGestureInteraction('SwipeAction', repeatable=True): | 540 with action_runner.CreateGestureInteraction('SwipeAction', repeatable=True): |
541 action_runner.SwipeElement( | 541 action_runner.SwipeElement( |
542 direction='left', distance=100, | 542 direction='right', distance=100, |
543 element_function='document.getElementById(":f")') | 543 element_function='document.getElementById(":f")') |
544 with action_runner.CreateGestureInteraction('SwipeAction', repeatable=True): | 544 with action_runner.CreateGestureInteraction('SwipeAction', repeatable=True): |
545 action_runner.Wait(1) | 545 action_runner.Wait(1) |
546 | 546 |
547 | 547 |
548 class Page26(KeySilkCasesPage): | 548 class Page26(KeySilkCasesPage): |
549 | 549 |
550 """ Why: famo.us twitter demo """ | 550 """ Why: famo.us twitter demo """ |
551 | 551 |
552 def __init__(self, page_set, run_no_page_interactions): | 552 def __init__(self, page_set, run_no_page_interactions): |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 self.AddStory(SilkFinance(self, run_no_page_interactions)) | 759 self.AddStory(SilkFinance(self, run_no_page_interactions)) |
760 # Flaky interaction steps on Android; crbug.com/507865 | 760 # Flaky interaction steps on Android; crbug.com/507865 |
761 # self.AddStory(PolymerTopeka(self, run_no_page_interactions)) | 761 # self.AddStory(PolymerTopeka(self, run_no_page_interactions)) |
762 self.AddStory(Masonry(self, run_no_page_interactions)) | 762 self.AddStory(Masonry(self, run_no_page_interactions)) |
763 | 763 |
764 for page in self: | 764 for page in self: |
765 assert (page.__class__.RunPageInteractions == | 765 assert (page.__class__.RunPageInteractions == |
766 KeySilkCasesPage.RunPageInteractions), ( | 766 KeySilkCasesPage.RunPageInteractions), ( |
767 'Pages in this page set must not override KeySilkCasesPage\' ' | 767 'Pages in this page set must not override KeySilkCasesPage\' ' |
768 'RunPageInteractions method.') | 768 'RunPageInteractions method.') |
OLD | NEW |