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 pyauto_functional | 6 import pyauto_functional |
7 import pyauto | 7 import pyauto |
8 import webrtc_test_base | 8 import webrtc_test_base |
9 | 9 |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 self._TestGetUserMedia(with_action='accept')) | 63 self._TestGetUserMedia(with_action='accept')) |
64 self.assertEquals('failed-with-error-PERMISSION_DENIED', | 64 self.assertEquals('failed-with-error-PERMISSION_DENIED', |
65 self._TestGetUserMedia(with_action='dismiss')) | 65 self._TestGetUserMedia(with_action='dismiss')) |
66 | 66 |
67 def _TestGetUserMedia(self, with_action): | 67 def _TestGetUserMedia(self, with_action): |
68 """Runs getUserMedia in the test page and returns the result.""" | 68 """Runs getUserMedia in the test page and returns the result.""" |
69 url = self.GetFileURLForDataPath('webrtc', 'webrtc_jsep01_test.html') | 69 url = self.GetFileURLForDataPath('webrtc', 'webrtc_jsep01_test.html') |
70 self.NavigateToURL(url) | 70 self.NavigateToURL(url) |
71 | 71 |
72 self.assertEquals('ok-requested', self.ExecuteJavascript( | 72 self.assertEquals('ok-requested', self.ExecuteJavascript( |
73 'getUserMedia("{ audio: true, video: true, }")')) | 73 'doGetUserMedia("{ audio: true, video: true, }")')) |
74 | 74 |
75 self.WaitForInfobarCount(1) | 75 self.WaitForInfobarCount(1) |
76 self.PerformActionOnInfobar(with_action, infobar_index=0) | 76 self.PerformActionOnInfobar(with_action, infobar_index=0) |
77 self.WaitForGetUserMediaResult(tab_index=0) | 77 self.WaitForGetUserMediaResult(tab_index=0) |
78 | 78 |
79 return self.GetUserMediaResult(tab_index=0) | 79 return self.GetUserMediaResult(tab_index=0) |
80 | 80 |
81 | 81 |
82 if __name__ == '__main__': | 82 if __name__ == '__main__': |
83 pyauto_functional.Main() | 83 pyauto_functional.Main() |
OLD | NEW |