Chromium Code Reviews| Index: chrome/test/functional/webrtc_test_base.py |
| diff --git a/chrome/test/functional/webrtc_test_base.py b/chrome/test/functional/webrtc_test_base.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2dc4b492d0b3f9035cd9ec236415f6e78ff39ed6 |
| --- /dev/null |
| +++ b/chrome/test/functional/webrtc_test_base.py |
| @@ -0,0 +1,19 @@ |
| +#!/usr/bin/env python |
| +# Copyright (c) 2012 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. |
| + |
| +import pyauto |
| + |
|
Nirnimesh
2012/07/31 20:10:09
need another blank line here
phoglund_chromium
2012/08/01 07:08:39
Done.
|
| +class WebrtcTestBase(pyauto.PyUITest): |
| + """This base class provides helpers for getUserMedia calls.""" |
| + |
| + def _WaitForGetUserMediaResult(self, tab_index): |
|
Nirnimesh
2012/07/31 20:10:09
Public methods should not have _ prefix
phoglund_chromium
2012/08/01 07:08:39
Done.
|
| + def HasResult(): |
| + return self._GetUserMediaResult(tab_index) != 'not-called-yet' |
| + self.assertTrue(self.WaitUntil(HasResult), |
| + msg='Timed out while waiting for getUserMedia callback.') |
| + |
| + def _GetUserMediaResult(self, tab_index): |
| + return self.ExecuteJavascript( |
| + 'obtainGetUserMediaResult()', tab_index=tab_index) |