Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: chrome/test/functional/webrtc_call.py

Issue 10696115: Add test to verify we can cancel the GetUserMedia request right after sending the request (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 import unittest 9 import unittest
10 10
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 self._Connect("user_1", tab_index=0) 137 self._Connect("user_1", tab_index=0)
138 self._Connect("user_2", tab_index=1) 138 self._Connect("user_2", tab_index=1)
139 139
140 self._EstablishCall(from_tab_with_index=0) 140 self._EstablishCall(from_tab_with_index=0)
141 141
142 self.assertEquals('failed-with-error-1', 142 self.assertEquals('failed-with-error-1',
143 self._GetUserMedia(tab_index=0, action='deny')) 143 self._GetUserMedia(tab_index=0, action='deny'))
144 self.assertEquals('failed-with-error-1', 144 self.assertEquals('failed-with-error-1',
145 self._GetUserMedia(tab_index=0, action='dismiss')) 145 self._GetUserMedia(tab_index=0, action='dismiss'))
146 146
147 def testCancelGetUserMediaRequest(self):
phoglund_chromium 2012/07/04 14:20:58 The first line in the docstring must not have any
no longer working on chromium 2012/07/05 14:05:19 Done.
148 """Ensures the browser does not crash when cancelling a pending GetUserMedia
149 request. See issue 135043."""
150
151 url = self.GetFileURLForDataPath('webrtc', 'webrtc_jsep_test.html')
152 self.NavigateToURL(url)
153 self.AppendTab(pyauto.GURL(url))
phoglund_chromium 2012/07/04 14:20:58 You did reproduce the crash with the test, right?
no longer working on chromium 2012/07/05 14:05:19 Thanks for pointing this out. I just double checke
154 self.assertEquals('ok-requested', self.ExecuteJavascript(
155 'getUserMedia(true, true)', tab_index=0))
156 self.assertEquals('ok-calceled-request', self.ExecuteJavascript(
157 'CancelGetUserMediaRequest()', tab_index=0))
158
147 def _GetUserMedia(self, tab_index, action='allow'): 159 def _GetUserMedia(self, tab_index, action='allow'):
148 """Acquires webcam or mic for one tab and returns the result.""" 160 """Acquires webcam or mic for one tab and returns the result."""
149 self.assertEquals('ok-requested', self.ExecuteJavascript( 161 self.assertEquals('ok-requested', self.ExecuteJavascript(
150 'getUserMedia(true, true)', tab_index=tab_index)) 162 'getUserMedia(true, true)', tab_index=tab_index))
151 163
152 self.WaitForInfobarCount(1, tab_index=tab_index) 164 self.WaitForInfobarCount(1, tab_index=tab_index)
153 self.PerformActionOnInfobar(action, infobar_index=0, tab_index=tab_index) 165 self.PerformActionOnInfobar(action, infobar_index=0, tab_index=tab_index)
154 self._WaitForGetUserMediaResult(tab_index=0) 166 self._WaitForGetUserMediaResult(tab_index=0)
155 167
156 result = self._GetUserMediaResult(tab_index=0) 168 result = self._GetUserMediaResult(tab_index=0)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 self.assertTrue(video_playing, 220 self.assertTrue(video_playing,
209 msg='Timed out while trying to detect video.') 221 msg='Timed out while trying to detect video.')
210 222
211 def _AssertNoFailures(self, tab_index): 223 def _AssertNoFailures(self, tab_index):
212 self.assertEquals('ok-no-errors', self.ExecuteJavascript( 224 self.assertEquals('ok-no-errors', self.ExecuteJavascript(
213 'getAnyTestFailures()', tab_index=tab_index)) 225 'getAnyTestFailures()', tab_index=tab_index))
214 226
215 227
216 if __name__ == '__main__': 228 if __name__ == '__main__':
217 pyauto_functional.Main() 229 pyauto_functional.Main()
OLDNEW
« chrome/test/data/webrtc/getusermedia.js ('K') | « chrome/test/data/webrtc/getusermedia.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698