OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import os | 6 import os |
| 7 import sys |
7 import tempfile | 8 import tempfile |
8 import time | 9 import time |
9 | 10 |
10 import media.audio_tools as audio_tools | 11 import media.audio_tools as audio_tools |
11 | 12 |
12 # Note: pyauto_functional must come before pyauto. | 13 # Note: pyauto_functional must come before pyauto. |
13 import pyauto_functional | 14 import pyauto_functional |
14 import pyauto | 15 import pyauto |
15 import pyauto_utils | 16 import pyauto_utils |
16 import webrtc_test_base | 17 import webrtc_test_base |
17 | 18 |
18 _MEDIA_PATH = os.path.abspath(os.path.join(pyauto.PyUITest.DataDir(), | 19 _MEDIA_PATH = os.path.abspath(os.path.join(pyauto.PyUITest.DataDir(), |
19 'pyauto_private', 'webrtc')) | 20 'pyauto_private', 'webrtc')) |
20 _REFERENCE_FILE = os.path.join(_MEDIA_PATH, 'human-voice.wav') | 21 if 'win32' in sys.platform: |
| 22 _REFERENCE_FILE = os.path.join(_MEDIA_PATH, 'human-voice-win.wav') |
| 23 else: |
| 24 _REFERENCE_FILE = os.path.join(_MEDIA_PATH, 'human-voice-linux.wav') |
21 _JAVASCRIPT_PATH = os.path.abspath(os.path.join(pyauto.PyUITest.DataDir(), | 25 _JAVASCRIPT_PATH = os.path.abspath(os.path.join(pyauto.PyUITest.DataDir(), |
22 'webrtc')) | 26 'webrtc')) |
23 | 27 |
24 | 28 |
25 class WebrtcAudioQualityTest(webrtc_test_base.WebrtcTestBase): | 29 class WebrtcAudioQualityTest(webrtc_test_base.WebrtcTestBase): |
26 """Test we can set up a WebRTC call and play audio through it. | 30 """Test we can set up a WebRTC call and play audio through it. |
27 | 31 |
28 This test will only work on machines that have been configured to record their | 32 This test will only work on machines that have been configured to record their |
29 own input*. | 33 own input*. |
30 | 34 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 175 |
172 def _CreateTempFile(self): | 176 def _CreateTempFile(self): |
173 """Returns an absolute path to an empty temp file.""" | 177 """Returns an absolute path to an empty temp file.""" |
174 file_handle, path = tempfile.mkstemp(suffix='_webrtc.wav') | 178 file_handle, path = tempfile.mkstemp(suffix='_webrtc.wav') |
175 os.close(file_handle) | 179 os.close(file_handle) |
176 return path | 180 return path |
177 | 181 |
178 | 182 |
179 if __name__ == '__main__': | 183 if __name__ == '__main__': |
180 pyauto_functional.Main() | 184 pyauto_functional.Main() |
OLD | NEW |