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

Side by Side Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 11428073: Wrote audio- and video-only WebRTC call tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
« no previous file with comments | « no previous file | chrome/test/functional/webrtc_call.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/automation/testing_automation_provider.h" 5 #include "chrome/browser/automation/testing_automation_provider.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after
2251 MediaStreamInfoBarDelegate* media_stream_infobar; 2251 MediaStreamInfoBarDelegate* media_stream_infobar;
2252 if (!(media_stream_infobar = infobar->AsMediaStreamInfoBarDelegate())) { 2252 if (!(media_stream_infobar = infobar->AsMediaStreamInfoBarDelegate())) {
2253 reply.SendError("Not a media stream infobar."); 2253 reply.SendError("Not a media stream infobar.");
2254 return; 2254 return;
2255 } 2255 }
2256 if ("allow" == action) { 2256 if ("allow" == action) {
2257 content::MediaStreamDevices video_devices = 2257 content::MediaStreamDevices video_devices =
2258 media_stream_infobar->GetVideoDevices(); 2258 media_stream_infobar->GetVideoDevices();
2259 content::MediaStreamDevices audio_devices = 2259 content::MediaStreamDevices audio_devices =
2260 media_stream_infobar->GetAudioDevices(); 2260 media_stream_infobar->GetAudioDevices();
2261 if (video_devices.empty() || audio_devices.empty()) { 2261
phoglund_chromium 2012/11/29 10:11:36 HasVideo() == true -> web page actually requested
2262 reply.SendError("No available audio/video devices to autoselect."); 2262 if (media_stream_infobar->HasVideo() && video_devices.empty()) {
2263 reply.SendError("Requested video, but there are no video "
2264 "devices on the system.");
2265 return;
2266 }
2267 if (media_stream_infobar->HasAudio() && audio_devices.empty()) {
2268 reply.SendError("Requested audio, but there are no audio "
2269 "devices on the system.");
2263 return; 2270 return;
2264 } 2271 }
2265 2272
2266 media_stream_infobar->Accept(); 2273 media_stream_infobar->Accept();
2267 infobar_helper->RemoveInfoBar(infobar); 2274 infobar_helper->RemoveInfoBar(infobar);
2268 } else if ("deny" == action) { 2275 } else if ("deny" == action) {
2269 media_stream_infobar->Deny(); 2276 media_stream_infobar->Deny();
2270 infobar_helper->RemoveInfoBar(infobar); 2277 infobar_helper->RemoveInfoBar(infobar);
2271 } 2278 }
2272 reply.SendSuccess(NULL); 2279 reply.SendSuccess(NULL);
(...skipping 4078 matching lines...) Expand 10 before | Expand all | Expand 10 after
6351 if (g_browser_process) 6358 if (g_browser_process)
6352 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 6359 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
6353 } 6360 }
6354 6361
6355 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 6362 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
6356 WebContents* tab) { 6363 WebContents* tab) {
6357 TabStripModel* tab_strip = browser->tab_strip_model(); 6364 TabStripModel* tab_strip = browser->tab_strip_model();
6358 if (tab_strip->GetActiveWebContents() != tab) 6365 if (tab_strip->GetActiveWebContents() != tab)
6359 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); 6366 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true);
6360 } 6367 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/functional/webrtc_call.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698