Chromium Code Reviews| Index: tools/perf/page_sets/webrtc_rendering_measurement.py |
| diff --git a/tools/perf/page_sets/webrtc_rendering_measurement.py b/tools/perf/page_sets/webrtc_rendering_measurement.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..85e4af1712bc5069c882f4829e76e6e4f10cdf78 |
| --- /dev/null |
| +++ b/tools/perf/page_sets/webrtc_rendering_measurement.py |
| @@ -0,0 +1,41 @@ |
| +# Copyright 2015 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +from telemetry.page import page as page_module |
| +from telemetry.page import page_test as page_test |
| +from telemetry import story |
| + |
| +WIDTH = 1280 |
|
phoglund_chromium
2015/09/17 11:23:58
Since you're just using these constants once I thi
cpaulin (no longer in chrome)
2015/09/17 23:58:54
Done.
|
| +HEIGHT = 720 |
| + |
| +class WebrtcRenderingPage(page_module.Page): |
| + |
| + def __init__(self, url, page_set): |
| + super(WebrtcRenderingPage, self).__init__( |
| + url=url, |
| + page_set=page_set, |
| + name='webrtc_rendering_page') |
| + self.webrtc_rendering = True |
|
phoglund_chromium
2015/09/17 11:23:58
What is this used for?
cpaulin (no longer in chrome)
2015/09/17 23:58:55
Old artifact from when I did not know what I was d
|
| + |
| + def RunPageInteractions(self, action_runner): |
| + with action_runner.CreateInteraction('Action_Create_PeerConnection', |
| + repeatable=False): |
| + command = 'testCamera([%s, %s]);' % (WIDTH, HEIGHT) |
| + action_runner.ExecuteJavaScript(command) |
| + action_runner.WaitForJavaScriptCondition('testDone') |
| + errors = action_runner.EvaluateJavaScript('errors') |
| + if errors: |
| + raise page_test.Failure('Errors on page: ' + ', '.join(errors)) |
| + |
| +class WebrtcRenderingPageSet(story.StorySet): |
| + |
| + """ A benchmark of webrtc rendering performance.""" |
| + |
| + def __init__(self): |
| + super(WebrtcRenderingPageSet, self).__init__() |
| + self.webrtc_rendering = True |
|
phoglund_chromium
2015/09/17 11:23:58
And this?
cpaulin (no longer in chrome)
2015/09/17 23:58:54
Done.
|
| + |
| + url = ('file://../../../chrome/test/data/webrtc_rendering/' |
| + 'loopback_peerconnection.html') |
| + self.AddStory(WebrtcRenderingPage(url, self)) |