| 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 WebrtcCasesPage(page_module.Page): | 10 class WebrtcCasesPage(page_module.Page): |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 class Page2(WebrtcCasesPage): | 31 class Page2(WebrtcCasesPage): |
| 32 | 32 |
| 33 """ Why: Loopback video call using the PeerConnection API. """ | 33 """ Why: Loopback video call using the PeerConnection API. """ |
| 34 | 34 |
| 35 def __init__(self, page_set): | 35 def __init__(self, page_set): |
| 36 super(Page2, self).__init__( | 36 super(Page2, self).__init__( |
| 37 url='file://third_party/webrtc/samples/js/demos/html/pc1.html', | 37 url='file://third_party/webrtc/samples/js/demos/html/pc1.html', |
| 38 page_set=page_set) | 38 page_set=page_set) |
| 39 | 39 |
| 40 def RunEndure(self, action_runner): | 40 def RunEndure(self, action_runner): |
| 41 action_runner.RunAction(ClickElementAction( | 41 action_runner.ClickElement('button[id="btn1"]') |
| 42 { | |
| 43 'selector': 'button[id="btn1"]' | |
| 44 })) | |
| 45 action_runner.Wait(2) | 42 action_runner.Wait(2) |
| 46 action_runner.RunAction(ClickElementAction( | 43 action_runner.ClickElement('button[id="btn2"]') |
| 47 { | |
| 48 'selector': 'button[id="btn2"]' | |
| 49 })) | |
| 50 action_runner.Wait(10) | 44 action_runner.Wait(10) |
| 51 action_runner.RunAction(ClickElementAction( | 45 action_runner.ClickElement('button[id="btn3"]') |
| 52 { | |
| 53 'selector': 'button[id="btn3"]' | |
| 54 })) | |
| 55 | 46 |
| 56 def RunWebrtc(self, action_runner): | 47 def RunWebrtc(self, action_runner): |
| 57 action_runner.RunAction(ClickElementAction( | 48 action_runner.ClickElement('button[id="btn1"]') |
| 58 { | |
| 59 'selector': 'button[id="btn1"]' | |
| 60 })) | |
| 61 action_runner.Wait(2) | 49 action_runner.Wait(2) |
| 62 action_runner.RunAction(ClickElementAction( | 50 action_runner.ClickElement('button[id="btn2"]') |
| 63 { | |
| 64 'selector': 'button[id="btn2"]' | |
| 65 })) | |
| 66 action_runner.Wait(10) | 51 action_runner.Wait(10) |
| 67 action_runner.RunAction(ClickElementAction( | 52 action_runner.ClickElement('button[id="btn3"]') |
| 68 { | |
| 69 'selector': 'button[id="btn3"]' | |
| 70 })) | |
| 71 | 53 |
| 72 | 54 |
| 73 class WebrtcCasesPageSet(page_set_module.PageSet): | 55 class WebrtcCasesPageSet(page_set_module.PageSet): |
| 74 | 56 |
| 75 """ WebRTC tests for Real-time audio and video communication. """ | 57 """ WebRTC tests for Real-time audio and video communication. """ |
| 76 | 58 |
| 77 def __init__(self): | 59 def __init__(self): |
| 78 super(WebrtcCasesPageSet, self).__init__( | 60 super(WebrtcCasesPageSet, self).__init__( |
| 79 serving_dirs=['third_party/webrtc/samples/js']) | 61 serving_dirs=['third_party/webrtc/samples/js']) |
| 80 | 62 |
| 81 self.AddPage(Page1(self)) | 63 self.AddPage(Page1(self)) |
| 82 self.AddPage(Page2(self)) | 64 self.AddPage(Page2(self)) |
| OLD | NEW |