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

Side by Side Diff: chrome/browser/media/webrtc_browsertest.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
« no previous file with comments | « no previous file | chrome/browser/media/webrtc_browsertest_base.h » ('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 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/strings/stringprintf.h" 6 #include "base/strings/stringprintf.h"
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/media/webrtc_browsertest_base.h" 8 #include "chrome/browser/media/webrtc_browsertest_base.h"
9 #include "chrome/browser/media/webrtc_browsertest_common.h" 9 #include "chrome/browser/media/webrtc_browsertest_common.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 25 matching lines...) Expand all
36 // Ensure the infobar is enabled, since we expect that in this test. 36 // Ensure the infobar is enabled, since we expect that in this test.
37 EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream)); 37 EXPECT_FALSE(command_line->HasSwitch(switches::kUseFakeUIForMediaStream));
38 38
39 // Always use fake devices. 39 // Always use fake devices.
40 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); 40 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream);
41 41
42 // Flag used by TestWebAudioMediaStream to force garbage collection. 42 // Flag used by TestWebAudioMediaStream to force garbage collection.
43 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); 43 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc");
44 } 44 }
45 45
46 void RunsAudioVideoWebRTCCallInTwoTabs(std::string video_codec) { 46 void RunsAudioVideoWebRTCCallInTwoTabs(
47 std::string certificate_keygen_algorithm,
48 std::string video_codec) {
47 if (OnWinXp()) return; 49 if (OnWinXp()) return;
48 50
49 ASSERT_TRUE(embedded_test_server()->Start()); 51 ASSERT_TRUE(embedded_test_server()->Start());
50 52
51 content::WebContents* left_tab = 53 content::WebContents* left_tab =
52 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); 54 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage);
53 content::WebContents* right_tab = 55 content::WebContents* right_tab =
54 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); 56 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage);
55 57
56 SetupPeerconnectionWithLocalStream(left_tab); 58 SetupPeerconnectionWithLocalStream(left_tab, certificate_keygen_algorithm);
57 SetupPeerconnectionWithLocalStream(right_tab); 59 SetupPeerconnectionWithLocalStream(right_tab, certificate_keygen_algorithm);
58 60
59 NegotiateCall(left_tab, right_tab, video_codec); 61 NegotiateCall(left_tab, right_tab, video_codec);
60 62
61 StartDetectingVideo(left_tab, "remote-view"); 63 StartDetectingVideo(left_tab, "remote-view");
62 StartDetectingVideo(right_tab, "remote-view"); 64 StartDetectingVideo(right_tab, "remote-view");
63 65
64 #if !defined(OS_MACOSX) 66 #if !defined(OS_MACOSX)
65 // Video is choppy on Mac OS X. http://crbug.com/443542. 67 // Video is choppy on Mac OS X. http://crbug.com/443542.
66 WaitForVideoToPlay(left_tab); 68 WaitForVideoToPlay(left_tab);
67 WaitForVideoToPlay(right_tab); 69 WaitForVideoToPlay(right_tab);
68 #endif 70 #endif
69 71
70 HangUp(left_tab); 72 HangUp(left_tab);
71 HangUp(right_tab); 73 HangUp(right_tab);
72 } 74 }
73 }; 75 };
74 76
75 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 77 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
78 RunsAudioVideoWebRTCCallInTwoTabsRSACertificate) {
79 RunsAudioVideoWebRTCCallInTwoTabs(
80 "{ name: \"RSASSA-PKCS1-v1_5\", modulusLength: 2048, publicExponent: "
81 "new Uint8Array([1, 0, 1]), hash: \"SHA-256\" }",
82 WebRtcTestBase::kUseDefaultVideoCodec);
83 }
84
85 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
86 RunsAudioVideoWebRTCCallInTwoTabsECDSACertificate) {
87 RunsAudioVideoWebRTCCallInTwoTabs(
88 "{ name: \"ECDSA\", namedCurve: \"P-256\" }",
89 WebRtcTestBase::kUseDefaultVideoCodec);
90 }
91
92 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
76 RunsAudioVideoWebRTCCallInTwoTabsVP8) { 93 RunsAudioVideoWebRTCCallInTwoTabsVP8) {
77 RunsAudioVideoWebRTCCallInTwoTabs("VP8"); 94 RunsAudioVideoWebRTCCallInTwoTabs(
95 WebRtcTestBase::kUseDefaultCertKeygen, "VP8");
78 } 96 }
79 97
80 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 98 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
81 RunsAudioVideoWebRTCCallInTwoTabsVP9) { 99 RunsAudioVideoWebRTCCallInTwoTabsVP9) {
82 RunsAudioVideoWebRTCCallInTwoTabs("VP9"); 100 RunsAudioVideoWebRTCCallInTwoTabs(
101 WebRtcTestBase::kUseDefaultCertKeygen, "VP9");
83 } 102 }
84 103
85 #if BUILDFLAG(RTC_USE_H264) 104 #if BUILDFLAG(RTC_USE_H264)
86 105
87 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 106 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
88 RunsAudioVideoWebRTCCallInTwoTabsH264) { 107 RunsAudioVideoWebRTCCallInTwoTabsH264) {
89 // Only run test if run-time feature corresponding to |rtc_use_h264| is on. 108 // Only run test if run-time feature corresponding to |rtc_use_h264| is on.
90 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { 109 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) {
91 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. " 110 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. "
92 "Skipping WebRtcBrowserTest.RunsAudioVideoWebRTCCallInTwoTabsH264 " 111 "Skipping WebRtcBrowserTest.RunsAudioVideoWebRTCCallInTwoTabsH264 "
93 "(test \"OK\")"; 112 "(test \"OK\")";
94 return; 113 return;
95 } 114 }
96 RunsAudioVideoWebRTCCallInTwoTabs("H264"); 115 RunsAudioVideoWebRTCCallInTwoTabs(
116 WebRtcTestBase::kUseDefaultCertKeygen, "H264");
97 } 117 }
98 118
99 #endif // BUILDFLAG(RTC_USE_H264) 119 #endif // BUILDFLAG(RTC_USE_H264)
100 120
101 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, TestWebAudioMediaStream) { 121 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, TestWebAudioMediaStream) {
102 // This tests against crash regressions for the WebAudio-MediaStream 122 // This tests against crash regressions for the WebAudio-MediaStream
103 // integration. 123 // integration.
104 if (OnWinXp()) return; 124 if (OnWinXp()) return;
105 125
106 ASSERT_TRUE(embedded_test_server()->Start()); 126 ASSERT_TRUE(embedded_test_server()->Start());
107 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); 127 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html"));
108 ui_test_utils::NavigateToURL(browser(), url); 128 ui_test_utils::NavigateToURL(browser(), url);
109 content::WebContents* tab = 129 content::WebContents* tab =
110 browser()->tab_strip_model()->GetActiveWebContents(); 130 browser()->tab_strip_model()->GetActiveWebContents();
111 131
112 // A sleep is necessary to be able to detect the crash. 132 // A sleep is necessary to be able to detect the crash.
113 test::SleepInJavascript(tab, 1000); 133 test::SleepInJavascript(tab, 1000);
114 134
115 ASSERT_FALSE(tab->IsCrashed()); 135 ASSERT_FALSE(tab->IsCrashed());
116 } 136 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/webrtc_browsertest_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698