| 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 CalendarForwardBackwardPage(page_module.Page): | 10 class CalendarForwardBackwardPage(page_module.Page): |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 action_runner.WaitForElement('div[class~="navForward"]') | 27 action_runner.WaitForElement('div[class~="navForward"]') |
| 28 action_runner.ExecuteJavaScript(''' | 28 action_runner.ExecuteJavaScript(''' |
| 29 (function() { | 29 (function() { |
| 30 var elem = document.createElement('meta'); | 30 var elem = document.createElement('meta'); |
| 31 elem.name='viewport'; | 31 elem.name='viewport'; |
| 32 elem.content='initial-scale=1'; | 32 elem.content='initial-scale=1'; |
| 33 document.body.appendChild(elem); | 33 document.body.appendChild(elem); |
| 34 })();''') | 34 })();''') |
| 35 | 35 |
| 36 def RunEndure(self, action_runner): | 36 def RunEndure(self, action_runner): |
| 37 action_runner.RunAction(ClickElementAction( | 37 action_runner.ClickElement('div[class~="navForward"]') |
| 38 { | |
| 39 'selector': 'div[class~="navForward"]' | |
| 40 })) | |
| 41 action_runner.Wait(2) | 38 action_runner.Wait(2) |
| 42 action_runner.WaitForElement('div[class~="navForward"]') | 39 action_runner.WaitForElement('div[class~="navForward"]') |
| 43 action_runner.RunAction(ClickElementAction( | 40 action_runner.ClickElement('div[class~="navForward"]') |
| 44 { | |
| 45 'selector': 'div[class~="navForward"]' | |
| 46 })) | |
| 47 action_runner.Wait(2) | 41 action_runner.Wait(2) |
| 48 action_runner.WaitForElement('div[class~="navForward"]') | 42 action_runner.WaitForElement('div[class~="navForward"]') |
| 49 action_runner.RunAction(ClickElementAction( | 43 action_runner.ClickElement('div[class~="navForward"]') |
| 50 { | |
| 51 'selector': 'div[class~="navForward"]' | |
| 52 })) | |
| 53 action_runner.Wait(2) | 44 action_runner.Wait(2) |
| 54 action_runner.WaitForElement('div[class~="navForward"]') | 45 action_runner.WaitForElement('div[class~="navForward"]') |
| 55 action_runner.RunAction(ClickElementAction( | 46 action_runner.ClickElement('div[class~="navForward"]') |
| 56 { | |
| 57 'selector': 'div[class~="navForward"]' | |
| 58 })) | |
| 59 action_runner.Wait(2) | 47 action_runner.Wait(2) |
| 60 action_runner.WaitForElement('div[class~="navBack"]') | 48 action_runner.WaitForElement('div[class~="navBack"]') |
| 61 action_runner.RunAction(ClickElementAction( | 49 action_runner.ClickElement('div[class~="navBack"]') |
| 62 { | |
| 63 'selector': 'div[class~="navBack"]' | |
| 64 })) | |
| 65 action_runner.Wait(2) | 50 action_runner.Wait(2) |
| 66 action_runner.WaitForElement('div[class~="navBack"]') | 51 action_runner.WaitForElement('div[class~="navBack"]') |
| 67 action_runner.RunAction(ClickElementAction( | 52 action_runner.ClickElement('div[class~="navBack"]') |
| 68 { | |
| 69 'selector': 'div[class~="navBack"]' | |
| 70 })) | |
| 71 action_runner.Wait(2) | 53 action_runner.Wait(2) |
| 72 action_runner.WaitForElement('div[class~="navBack"]') | 54 action_runner.WaitForElement('div[class~="navBack"]') |
| 73 action_runner.RunAction(ClickElementAction( | 55 action_runner.ClickElement('div[class~="navBack"]') |
| 74 { | |
| 75 'selector': 'div[class~="navBack"]' | |
| 76 })) | |
| 77 action_runner.Wait(2) | 56 action_runner.Wait(2) |
| 78 action_runner.WaitForElement('div[class~="navBack"]') | 57 action_runner.WaitForElement('div[class~="navBack"]') |
| 79 action_runner.RunAction(ClickElementAction( | 58 action_runner.ClickElement('div[class~="navBack"]') |
| 80 { | |
| 81 'selector': 'div[class~="navBack"]' | |
| 82 })) | |
| 83 action_runner.Wait(2) | 59 action_runner.Wait(2) |
| 84 action_runner.WaitForElement('div[class~="navForward"]') | 60 action_runner.WaitForElement('div[class~="navForward"]') |
| 85 | 61 |
| 86 | 62 |
| 87 class CalendarForwardBackwardPageSet(page_set_module.PageSet): | 63 class CalendarForwardBackwardPageSet(page_set_module.PageSet): |
| 88 | 64 |
| 89 """ Chrome Endure test for Google Calendar. """ | 65 """ Chrome Endure test for Google Calendar. """ |
| 90 | 66 |
| 91 def __init__(self): | 67 def __init__(self): |
| 92 super(CalendarForwardBackwardPageSet, self).__init__( | 68 super(CalendarForwardBackwardPageSet, self).__init__( |
| 93 credentials_path='data/credentials.json', | 69 credentials_path='data/credentials.json', |
| 94 user_agent_type='desktop', | 70 user_agent_type='desktop', |
| 95 archive_data_file='data/calendar_forward_backward.json') | 71 archive_data_file='data/calendar_forward_backward.json') |
| 96 | 72 |
| 97 self.AddPage(CalendarForwardBackwardPage(self)) | 73 self.AddPage(CalendarForwardBackwardPage(self)) |
| OLD | NEW |