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

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: Created 4 years, 8 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 "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 // RSA certificate, default video codec.
80 RunsAudioVideoWebRTCCallInTwoTabs(
81 "{ name: \"RSASSA-PKCS1-v1_5\", modulusLength: 2048, publicExponent: "
82 "new Uint8Array([1, 0, 1]), hash: \"SHA-256\" }",
83 "");
84 }
85
86 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
87 RunsAudioVideoWebRTCCallInTwoTabsECDSACertificate) {
88 // ECDSA certificate, default video codec.
89 RunsAudioVideoWebRTCCallInTwoTabs(
90 "{ name: \"ECDSA\", namedCurve: \"P-256\" }",
91 "");
92 }
93
94 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
76 RunsAudioVideoWebRTCCallInTwoTabsVP8) { 95 RunsAudioVideoWebRTCCallInTwoTabsVP8) {
77 RunsAudioVideoWebRTCCallInTwoTabs("VP8"); 96 // Default certificate, VP8 video codec.
97 RunsAudioVideoWebRTCCallInTwoTabs("", "VP8");
78 } 98 }
79 99
80 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 100 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
81 RunsAudioVideoWebRTCCallInTwoTabsVP9) { 101 RunsAudioVideoWebRTCCallInTwoTabsVP9) {
82 RunsAudioVideoWebRTCCallInTwoTabs("VP9"); 102 // Default certificate, VP9 video codec.
103 RunsAudioVideoWebRTCCallInTwoTabs("", "VP9");
83 } 104 }
84 105
85 #if BUILDFLAG(RTC_USE_H264) 106 #if BUILDFLAG(RTC_USE_H264)
86 107
87 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 108 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
88 RunsAudioVideoWebRTCCallInTwoTabsH264) { 109 RunsAudioVideoWebRTCCallInTwoTabsH264) {
89 // Only run test if run-time feature corresponding to |rtc_use_h264| is on. 110 // Only run test if run-time feature corresponding to |rtc_use_h264| is on.
90 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) { 111 if (!base::FeatureList::IsEnabled(content::kWebRtcH264WithOpenH264FFmpeg)) {
91 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. " 112 LOG(WARNING) << "Run-time feature WebRTC-H264WithOpenH264FFmpeg disabled. "
92 "Skipping WebRtcBrowserTest.RunsAudioVideoWebRTCCallInTwoTabsH264 " 113 "Skipping WebRtcBrowserTest.RunsAudioVideoWebRTCCallInTwoTabsH264 "
93 "(test \"OK\")"; 114 "(test \"OK\")";
94 return; 115 return;
95 } 116 }
96 RunsAudioVideoWebRTCCallInTwoTabs("H264"); 117 // Default certificate, H264 video codec.
hbos_chromium 2016/04/26 10:03:05 (oops extra spaces, will remove before landing)
118 RunsAudioVideoWebRTCCallInTwoTabs("", "H264");
97 } 119 }
98 120
99 #endif // BUILDFLAG(RTC_USE_H264) 121 #endif // BUILDFLAG(RTC_USE_H264)
100 122
101 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, TestWebAudioMediaStream) { 123 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, TestWebAudioMediaStream) {
102 // This tests against crash regressions for the WebAudio-MediaStream 124 // This tests against crash regressions for the WebAudio-MediaStream
103 // integration. 125 // integration.
104 if (OnWinXp()) return; 126 if (OnWinXp()) return;
105 127
106 ASSERT_TRUE(embedded_test_server()->Start()); 128 ASSERT_TRUE(embedded_test_server()->Start());
107 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html")); 129 GURL url(embedded_test_server()->GetURL("/webrtc/webaudio_crash.html"));
108 ui_test_utils::NavigateToURL(browser(), url); 130 ui_test_utils::NavigateToURL(browser(), url);
109 content::WebContents* tab = 131 content::WebContents* tab =
110 browser()->tab_strip_model()->GetActiveWebContents(); 132 browser()->tab_strip_model()->GetActiveWebContents();
111 133
112 // A sleep is necessary to be able to detect the crash. 134 // A sleep is necessary to be able to detect the crash.
113 test::SleepInJavascript(tab, 1000); 135 test::SleepInJavascript(tab, 1000);
114 136
115 ASSERT_FALSE(tab->IsCrashed()); 137 ASSERT_FALSE(tab->IsCrashed());
116 } 138 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/webrtc_browsertest_base.h » ('j') | chrome/browser/media/webrtc_browsertest_base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698