OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 subprocess | 7 import subprocess |
8 import time | 8 import time |
9 | 9 |
10 # This little construct ensures we can run even if we have a bad version of | 10 # This little construct ensures we can run even if we have a bad version of |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 This test will check that if a local track is muted, the remote end don't | 171 This test will check that if a local track is muted, the remote end don't |
172 get video. Also test that if a remote track is disabled, the video is not | 172 get video. Also test that if a remote track is disabled, the video is not |
173 updated in the video tag.""" | 173 updated in the video tag.""" |
174 | 174 |
175 # TODO(perkj): Also verify that the local preview is muted when the | 175 # TODO(perkj): Also verify that the local preview is muted when the |
176 # feature is implemented. | 176 # feature is implemented. |
177 # TODO(perkj): Verify that audio is muted. | 177 # TODO(perkj): Verify that audio is muted. |
178 | 178 |
179 self._LoadPageInTwoTabs('webrtc_jsep01_test.html') | 179 self._LoadPageInTwoTabs('webrtc_jsep01_test.html') |
180 self._SetupCall(request_video=True, request_audio=True) | 180 self._SetupCall(request_video=True, request_audio=True) |
181 select_video_function = 'function(local) { return local.videoTracks[0]; }' | 181 select_video_function = \ |
| 182 'function(local) { return local.getVideoTracks()[0]; }' |
182 self.assertEquals('ok-video-toggled-to-false', self.ExecuteJavascript( | 183 self.assertEquals('ok-video-toggled-to-false', self.ExecuteJavascript( |
183 'toggleLocalStream(' + select_video_function + ', "video")', | 184 'toggleLocalStream(' + select_video_function + ', "video")', |
184 tab_index=0)) | 185 tab_index=0)) |
185 self._WaitForVideo(tab_index=1, expect_playing=False) | 186 self._WaitForVideo(tab_index=1, expect_playing=False) |
186 | 187 |
187 self.assertEquals('ok-video-toggled-to-true', self.ExecuteJavascript( | 188 self.assertEquals('ok-video-toggled-to-true', self.ExecuteJavascript( |
188 'toggleLocalStream(' + select_video_function + ', "video")', | 189 'toggleLocalStream(' + select_video_function + ', "video")', |
189 tab_index=0)) | 190 tab_index=0)) |
190 self._WaitForVideo(tab_index=1, expect_playing=True) | 191 self._WaitForVideo(tab_index=1, expect_playing=True) |
191 | 192 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 """Returns the Chrome renderer process as a psutil process wrapper.""" | 251 """Returns the Chrome renderer process as a psutil process wrapper.""" |
251 tab_info = self.GetBrowserInfo()['windows'][0]['tabs'][tab_index] | 252 tab_info = self.GetBrowserInfo()['windows'][0]['tabs'][tab_index] |
252 renderer_id = tab_info['renderer_pid'] | 253 renderer_id = tab_info['renderer_pid'] |
253 if not renderer_id: | 254 if not renderer_id: |
254 self.fail('Can not find the tab renderer process.') | 255 self.fail('Can not find the tab renderer process.') |
255 return psutil.Process(renderer_id) | 256 return psutil.Process(renderer_id) |
256 | 257 |
257 | 258 |
258 if __name__ == '__main__': | 259 if __name__ == '__main__': |
259 pyauto_functional.Main() | 260 pyauto_functional.Main() |
OLD | NEW |