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

Side by Side Diff: chrome/browser/media/webrtc_browsertest_base.cc

Issue 1917133002: WebRtcBrowserTest tests with RSA and ECDSA certificates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed if-statement Created 4 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/media/webrtc_browsertest_base.h" 5 #include "chrome/browser/media/webrtc_browsertest_base.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 const char WebRtcTestBase::kFailedWithPermissionDeniedError[] = 48 const char WebRtcTestBase::kFailedWithPermissionDeniedError[] =
49 "failed-with-error-PermissionDeniedError"; 49 "failed-with-error-PermissionDeniedError";
50 const char WebRtcTestBase::kFailedWithPermissionDismissedError[] = 50 const char WebRtcTestBase::kFailedWithPermissionDismissedError[] =
51 "failed-with-error-PermissionDismissedError"; 51 "failed-with-error-PermissionDismissedError";
52 const char WebRtcTestBase::kAudioVideoCallConstraints360p[] = 52 const char WebRtcTestBase::kAudioVideoCallConstraints360p[] =
53 "{audio: true, video: {mandatory: {minWidth: 640, maxWidth: 640, " 53 "{audio: true, video: {mandatory: {minWidth: 640, maxWidth: 640, "
54 " minHeight: 360, maxHeight: 360}}}"; 54 " minHeight: 360, maxHeight: 360}}}";
55 const char WebRtcTestBase::kAudioVideoCallConstraints720p[] = 55 const char WebRtcTestBase::kAudioVideoCallConstraints720p[] =
56 "{audio: true, video: {mandatory: {minWidth: 1280, maxWidth: 1280, " 56 "{audio: true, video: {mandatory: {minWidth: 1280, maxWidth: 1280, "
57 " minHeight: 720, maxHeight: 720}}}"; 57 " minHeight: 720, maxHeight: 720}}}";
58 const char WebRtcTestBase::kUseDefaultCertKeygen[] = "null";
59 const char WebRtcTestBase::kUseDefaultVideoCodec[] = "";
58 60
59 namespace { 61 namespace {
60 62
61 base::LazyInstance<bool> hit_javascript_errors_ = 63 base::LazyInstance<bool> hit_javascript_errors_ =
62 LAZY_INSTANCE_INITIALIZER; 64 LAZY_INSTANCE_INITIALIZER;
63 65
64 // Intercepts all log messages. We always attach this handler but only look at 66 // Intercepts all log messages. We always attach this handler but only look at
65 // the results if the test requests so. Note that this will only work if the 67 // the results if the test requests so. Note that this will only work if the
66 // WebrtcTestBase-inheriting test cases do not run in parallel (if they did they 68 // WebrtcTestBase-inheriting test cases do not run in parallel (if they did they
67 // would race to look at the log, which is global to all tests). 69 // would race to look at the log, which is global to all tests).
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 std::string WebRtcTestBase::ExecuteJavascript( 298 std::string WebRtcTestBase::ExecuteJavascript(
297 const std::string& javascript, 299 const std::string& javascript,
298 content::WebContents* tab_contents) const { 300 content::WebContents* tab_contents) const {
299 std::string result; 301 std::string result;
300 EXPECT_TRUE(content::ExecuteScriptAndExtractString( 302 EXPECT_TRUE(content::ExecuteScriptAndExtractString(
301 tab_contents, javascript, &result)); 303 tab_contents, javascript, &result));
302 return result; 304 return result;
303 } 305 }
304 306
305 void WebRtcTestBase::SetupPeerconnectionWithLocalStream( 307 void WebRtcTestBase::SetupPeerconnectionWithLocalStream(
306 content::WebContents* tab) const { 308 content::WebContents* tab,
307 SetupPeerconnectionWithoutLocalStream(tab); 309 std::string certificate_keygen_algorithm) const {
310 SetupPeerconnectionWithoutLocalStream(tab, certificate_keygen_algorithm);
308 EXPECT_EQ("ok-added", ExecuteJavascript("addLocalStream()", tab)); 311 EXPECT_EQ("ok-added", ExecuteJavascript("addLocalStream()", tab));
309 } 312 }
310 313
311 void WebRtcTestBase::SetupPeerconnectionWithoutLocalStream( 314 void WebRtcTestBase::SetupPeerconnectionWithoutLocalStream(
312 content::WebContents* tab) const { 315 content::WebContents* tab,
316 std::string certificate_keygen_algorithm) const {
317 std::string javascript = base::StringPrintf(
318 "preparePeerConnection(%s)", certificate_keygen_algorithm.c_str());
313 EXPECT_EQ("ok-peerconnection-created", 319 EXPECT_EQ("ok-peerconnection-created",
314 ExecuteJavascript("preparePeerConnection()", tab)); 320 ExecuteJavascript(javascript, tab));
315 } 321 }
316 322
317 std::string WebRtcTestBase::CreateLocalOffer( 323 std::string WebRtcTestBase::CreateLocalOffer(
318 content::WebContents* from_tab, 324 content::WebContents* from_tab,
319 std::string default_video_codec) const { 325 std::string default_video_codec) const {
320 if (default_video_codec.empty()) 326 if (default_video_codec.empty())
321 default_video_codec = "null"; 327 default_video_codec = "null";
322 else 328 else
323 default_video_codec = "'" + default_video_codec + "'"; 329 default_video_codec = "'" + default_video_codec + "'";
324 std::string javascript = base::StringPrintf( 330 std::string javascript = base::StringPrintf(
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 #endif 444 #endif
439 } 445 }
440 446
441 bool WebRtcTestBase::OnWin8() const { 447 bool WebRtcTestBase::OnWin8() const {
442 #if defined(OS_WIN) 448 #if defined(OS_WIN)
443 return base::win::GetVersion() > base::win::VERSION_WIN7; 449 return base::win::GetVersion() > base::win::VERSION_WIN7;
444 #else 450 #else
445 return false; 451 return false;
446 #endif 452 #endif
447 } 453 }
OLDNEW
« no previous file with comments | « chrome/browser/media/webrtc_browsertest_base.h ('k') | chrome/test/data/webrtc/peerconnection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698