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

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: addressed Patrik's comments. 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 testReloadPageAfterGetUserMedia(self):
148 """Ensures no crash on a quick reaload after GetUserMedia.
149
150 This test will quickly reload the page after running getUserMedia, which
151 will remove the pending request. This crashed the browser before the fix
152 for crbug.com/135043.
153 """
154
155 url = self.GetFileURLForDataPath('webrtc', 'webrtc_jsep_test.html')
156 self.NavigateToURL(url)
157 self.AppendTab(pyauto.GURL(url))
158 self.assertEquals('ok-requested', self.ExecuteJavascript(
159 'getUserMedia(true, true)', tab_index=0))
160 self.assertEquals('ok-reloaded-page', self.ExecuteJavascript(
Nirnimesh 2012/07/12 14:07:01 You don't need javascript to reload the page. You
161 'ReloadWebPage()', tab_index=0))
162
147 def _GetUserMedia(self, tab_index, action='allow'): 163 def _GetUserMedia(self, tab_index, action='allow'):
148 """Acquires webcam or mic for one tab and returns the result.""" 164 """Acquires webcam or mic for one tab and returns the result."""
149 self.assertEquals('ok-requested', self.ExecuteJavascript( 165 self.assertEquals('ok-requested', self.ExecuteJavascript(
150 'getUserMedia(true, true)', tab_index=tab_index)) 166 'getUserMedia(true, true)', tab_index=tab_index))
151 167
152 self.WaitForInfobarCount(1, tab_index=tab_index) 168 self.WaitForInfobarCount(1, tab_index=tab_index)
153 self.PerformActionOnInfobar(action, infobar_index=0, tab_index=tab_index) 169 self.PerformActionOnInfobar(action, infobar_index=0, tab_index=tab_index)
154 self._WaitForGetUserMediaResult(tab_index=0) 170 self._WaitForGetUserMediaResult(tab_index=0)
155 171
156 result = self._GetUserMediaResult(tab_index=0) 172 result = self._GetUserMediaResult(tab_index=0)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 self.assertTrue(video_playing, 224 self.assertTrue(video_playing,
209 msg='Timed out while trying to detect video.') 225 msg='Timed out while trying to detect video.')
210 226
211 def _AssertNoFailures(self, tab_index): 227 def _AssertNoFailures(self, tab_index):
212 self.assertEquals('ok-no-errors', self.ExecuteJavascript( 228 self.assertEquals('ok-no-errors', self.ExecuteJavascript(
213 'getAnyTestFailures()', tab_index=tab_index)) 229 'getAnyTestFailures()', tab_index=tab_index))
214 230
215 231
216 if __name__ == '__main__': 232 if __name__ == '__main__':
217 pyauto_functional.Main() 233 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