Plumb scroll elasticity layer from Blink to cc
[chromium-blink-merge.git] / tools / perf / page_sets / webrtc_cases.py
blob3fd25a6cf9a1b7ce2679a85a376fe900ed86b998
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
3 # found in the LICENSE file.
4 import os
6 from telemetry.page import page as page_module
7 from telemetry.page import page_set as page_set_module
10 class WebrtcCasesPage(page_module.Page):
12 def __init__(self, url, page_set):
13 super(WebrtcCasesPage, self).__init__(url=url, page_set=page_set)
15 with open(os.path.join(os.path.dirname(__file__),
16 'webrtc_track_peerconnections.js')) as javascript:
17 self.script_to_evaluate_on_commit = javascript.read()
20 class Page1(WebrtcCasesPage):
22 """ Why: Acquires a vga local stream. """
24 def __init__(self, page_set):
25 super(Page1, self).__init__(
26 url=('http://googlechrome.github.io/webrtc/samples/web/content/'
27 'getusermedia-resolution/'),
28 page_set=page_set)
30 def RunPageInteractions(self, action_runner):
31 action_runner.ClickElement('button[id="vga"]')
32 action_runner.Wait(10)
35 class Page2(WebrtcCasesPage):
37 """ Why: Sets up a local WebRTC call. """
39 def __init__(self, page_set):
40 super(Page2, self).__init__(
41 url=('http://googlechrome.github.io/webrtc/samples/web/content/'
42 'peerconnection/'),
43 page_set=page_set)
45 def RunPageInteractions(self, action_runner):
46 action_runner.ClickElement('button[id="startButton"]')
47 action_runner.Wait(2)
48 action_runner.ClickElement('button[id="callButton"]')
49 action_runner.Wait(10)
50 action_runner.ClickElement('button[id="hangupButton"]')
52 class Page3(WebrtcCasesPage):
54 """ Why: Acquires a high definition local stream. """
56 def __init__(self, page_set):
57 super(Page3, self).__init__(
58 url=('http://googlechrome.github.io/webrtc/samples/web/content/'
59 'getusermedia-resolution/'),
60 page_set=page_set)
62 def RunPageInteractions(self, action_runner):
63 action_runner.ClickElement('button[id="hd"]')
64 action_runner.Wait(10)
67 class WebrtcCasesPageSet(page_set_module.PageSet):
69 """ WebRTC tests for Real-time audio and video communication. """
71 def __init__(self):
72 super(WebrtcCasesPageSet, self).__init__(
73 archive_data_file='data/webrtc_cases.json',
74 bucket=page_set_module.PUBLIC_BUCKET)
76 self.AddPage(Page1(self))
77 self.AddPage(Page2(self))
78 self.AddPage(Page3(self))