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

Side by Side Diff: content/browser/media/webrtc_browsertest.cc

Issue 516883002: Disabling WebRTC call tests on Android ASAN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing indent Created 6 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/process/process_handle.h"
8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
10 #include "base/threading/platform_thread.h" 8 #include "base/threading/platform_thread.h"
11 #include "base/values.h"
12 #include "content/browser/media/webrtc_internals.h"
13 #include "content/browser/web_contents/web_contents_impl.h" 9 #include "content/browser/web_contents/web_contents_impl.h"
14 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
15 #include "content/public/test/browser_test_utils.h" 11 #include "content/public/test/browser_test_utils.h"
16 #include "content/public/test/content_browser_test_utils.h" 12 #include "content/public/test/content_browser_test_utils.h"
17 #include "content/public/test/test_utils.h" 13 #include "content/public/test/test_utils.h"
18 #include "content/shell/browser/shell.h"
19 #include "content/test/webrtc_content_browsertest_base.h" 14 #include "content/test/webrtc_content_browsertest_base.h"
20 #include "media/audio/audio_manager.h" 15 #include "media/audio/audio_manager.h"
21 #include "media/base/media_switches.h" 16 #include "media/base/media_switches.h"
22 #include "net/test/embedded_test_server/embedded_test_server.h" 17 #include "net/test/embedded_test_server/embedded_test_server.h"
23 18
24 #if defined(OS_WIN)
25 #include "base/win/windows_version.h"
26 #endif
27
28 namespace { 19 namespace {
29 20
30 #if defined (OS_ANDROID) || defined(THREAD_SANITIZER) 21 #if defined (OS_ANDROID) || defined(THREAD_SANITIZER)
31 // Just do the bare minimum of audio checking on Android and under TSAN since 22 // Just do the bare minimum of audio checking on Android and under TSAN since
32 // it's a bit sensitive to device performance. 23 // it's a bit sensitive to device performance.
33 const char kUseLenientAudioChecking[] = "true"; 24 const char kUseLenientAudioChecking[] = "true";
34 #else 25 #else
35 const char kUseLenientAudioChecking[] = "false"; 26 const char kUseLenientAudioChecking[] = "false";
36 #endif 27 #endif
37 28
38 const int kExpectedConsumerId = 0;
39
40 // Get the ID for the render process host when there should only be one.
41 bool GetRenderProcessHostId(base::ProcessId* id) {
42 content::RenderProcessHost::iterator it(
43 content::RenderProcessHost::AllHostsIterator());
44 *id = base::GetProcId(it.GetCurrentValue()->GetHandle());
45 EXPECT_NE(base::kNullProcessId, *id);
46 if (*id == base::kNullProcessId)
47 return false;
48 it.Advance();
49 EXPECT_TRUE(it.IsAtEnd());
50 return it.IsAtEnd();
51 }
52
53 } // namespace 29 } // namespace
54 30
55 namespace content { 31 namespace content {
56 32
57 class WebRtcBrowserTest : public WebRtcContentBrowserTest { 33 #if defined(OS_ANDROID) && defined(ADDRESS_SANITIZER)
34 // Renderer crashes under Android ASAN: https://crbug.com/408496.
35 #define MAYBE_WebRtcBrowserTest DISABLED_WebRtcBrowserTest
36 #else
37 #define MAYBE_WebRtcBrowserTest WebRtcBrowserTest
38 #endif
39
40 class MAYBE_WebRtcBrowserTest : public WebRtcContentBrowserTest {
58 public: 41 public:
59 WebRtcBrowserTest() {} 42 MAYBE_WebRtcBrowserTest() {}
60 virtual ~WebRtcBrowserTest() {} 43 virtual ~MAYBE_WebRtcBrowserTest() {}
61 44
62 // Convenience function since most peerconnection-call.html tests just load 45 // Convenience function since most peerconnection-call.html tests just load
63 // the page, kick off some javascript and wait for the title to change to OK. 46 // the page, kick off some javascript and wait for the title to change to OK.
64 void MakeTypicalPeerConnectionCall(const std::string& javascript) { 47 void MakeTypicalPeerConnectionCall(const std::string& javascript) {
65 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 48 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
66 49
67 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); 50 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
68 NavigateToURL(shell(), url); 51 NavigateToURL(shell(), url);
69 52
70 DisableOpusIfOnAndroid(); 53 DisableOpusIfOnAndroid();
(...skipping 13 matching lines...) Expand all
84 return; 67 return;
85 } 68 }
86 69
87 ASSERT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch( 70 ASSERT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch(
88 switches::kUseFakeDeviceForMediaStream)) 71 switches::kUseFakeDeviceForMediaStream))
89 << "Must run with fake devices since the test will explicitly look " 72 << "Must run with fake devices since the test will explicitly look "
90 << "for the fake device signal."; 73 << "for the fake device signal.";
91 74
92 MakeTypicalPeerConnectionCall(javascript); 75 MakeTypicalPeerConnectionCall(javascript);
93 } 76 }
94
95 void DisableOpusIfOnAndroid() {
96 #if defined(OS_ANDROID)
97 // Always force iSAC 16K on Android for now (Opus is broken).
98 EXPECT_EQ("isac-forced",
99 ExecuteJavascriptAndReturnResult("forceIsac16KInSdp();"));
100 #endif
101 }
102 }; 77 };
103 78
104 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 79 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
105 // Timing out on ARM linux bot: http://crbug.com/238490 80 // Timing out on ARM linux bot: http://crbug.com/238490
106 #define MAYBE_CanSetupDefaultVideoCall DISABLED_CanSetupDefaultVideoCall 81 #define MAYBE_CanSetupDefaultVideoCall DISABLED_CanSetupDefaultVideoCall
107 // Flaky on TSAN v2. http://crbug.com/408006 82 // Flaky on TSAN v2. http://crbug.com/408006
108 #elif defined(THREAD_SANITIZER) 83 #elif defined(THREAD_SANITIZER)
109 #define MAYBE_CanSetupDefaultVideoCall DISABLED_CanSetupDefaultVideoCall 84 #define MAYBE_CanSetupDefaultVideoCall DISABLED_CanSetupDefaultVideoCall
110 #else 85 #else
111 #define MAYBE_CanSetupDefaultVideoCall CanSetupDefaultVideoCall 86 #define MAYBE_CanSetupDefaultVideoCall CanSetupDefaultVideoCall
112 #endif 87 #endif
113 88
114 // These tests will make a complete PeerConnection-based call and verify that 89 // These tests will make a complete PeerConnection-based call and verify that
115 // video is playing for the call. 90 // video is playing for the call.
116 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanSetupDefaultVideoCall) { 91 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
92 MAYBE_CanSetupDefaultVideoCall) {
117 MakeTypicalPeerConnectionCall( 93 MakeTypicalPeerConnectionCall(
118 "callAndExpectResolution({video: true}, 640, 480);"); 94 "callAndExpectResolution({video: true}, 640, 480);");
119 } 95 }
120 96
121 // Flaky on TSAN v2. http://crbug.com/408006 97 // Flaky on TSAN v2. http://crbug.com/408006
122 #if defined(THREAD_SANITIZER) 98 #if defined(THREAD_SANITIZER)
123 #define MAYBE_CanSetupVideoCallWith1To1AspectRatio \ 99 #define MAYBE_CanSetupVideoCallWith1To1AspectRatio \
124 DISABLED_CanSetupVideoCallWith1To1AspectRatio 100 DISABLED_CanSetupVideoCallWith1To1AspectRatio
125 #else 101 #else
126 #define MAYBE_CanSetupVideoCallWith1To1AspectRatio \ 102 #define MAYBE_CanSetupVideoCallWith1To1AspectRatio \
127 CanSetupVideoCallWith1To1AspectRatio 103 CanSetupVideoCallWith1To1AspectRatio
128 #endif 104 #endif
129 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 105 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
130 MAYBE_CanSetupVideoCallWith1To1AspectRatio) { 106 MAYBE_CanSetupVideoCallWith1To1AspectRatio) {
131 const std::string javascript = 107 const std::string javascript =
132 "callAndExpectResolution({video: {mandatory: {minWidth: 320," 108 "callAndExpectResolution({video: {mandatory: {minWidth: 320,"
133 " maxWidth: 320, minHeight: 320, maxHeight: 320}}}, 320, 320);"; 109 " maxWidth: 320, minHeight: 320, maxHeight: 320}}}, 320, 320);";
134 MakeTypicalPeerConnectionCall(javascript); 110 MakeTypicalPeerConnectionCall(javascript);
135 } 111 }
136 112
137 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARM64) 113 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARM64)
138 // Failing on ARM64 Android bot: http://crbug.com/408179 114 // Failing on ARM64 Android bot: http://crbug.com/408179
139 #define MAYBE_CanSetupVideoCallWith16To9AspectRatio \ 115 #define MAYBE_CanSetupVideoCallWith16To9AspectRatio \
140 DISABLED_CanSetupVideoCallWith16To9AspectRatio 116 DISABLED_CanSetupVideoCallWith16To9AspectRatio
141 // Flaky on TSAN v2. http://crbug.com/408006 117 // Flaky on TSAN v2. http://crbug.com/408006
142 #elif defined(THREAD_SANITIZER) 118 #elif defined(THREAD_SANITIZER)
143 #define MAYBE_CanSetupVideoCallWith16To9AspectRatio \ 119 #define MAYBE_CanSetupVideoCallWith16To9AspectRatio \
144 DISABLED_CanSetupVideoCallWith16To9AspectRatio 120 DISABLED_CanSetupVideoCallWith16To9AspectRatio
145 #else 121 #else
146 #define MAYBE_CanSetupVideoCallWith16To9AspectRatio \ 122 #define MAYBE_CanSetupVideoCallWith16To9AspectRatio \
147 CanSetupVideoCallWith16To9AspectRatio 123 CanSetupVideoCallWith16To9AspectRatio
148 #endif 124 #endif
149 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 125 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
150 MAYBE_CanSetupVideoCallWith16To9AspectRatio) { 126 MAYBE_CanSetupVideoCallWith16To9AspectRatio) {
151 const std::string javascript = 127 const std::string javascript =
152 "callAndExpectResolution({video: {mandatory: {minWidth: 640," 128 "callAndExpectResolution({video: {mandatory: {minWidth: 640,"
153 " maxWidth: 640, minAspectRatio: 1.777}}}, 640, 360);"; 129 " maxWidth: 640, minAspectRatio: 1.777}}}, 640, 360);";
154 MakeTypicalPeerConnectionCall(javascript); 130 MakeTypicalPeerConnectionCall(javascript);
155 } 131 }
156 132
157 // Flaky on TSAN v2. http://crbug.com/408006 133 // Flaky on TSAN v2. http://crbug.com/408006
158 #if defined(THREAD_SANITIZER) 134 #if defined(THREAD_SANITIZER)
159 #define MAYBE_CanSetupVideoCallWith4To3AspectRatio \ 135 #define MAYBE_CanSetupVideoCallWith4To3AspectRatio \
160 DISABLED_CanSetupVideoCallWith4To3AspectRatio 136 DISABLED_CanSetupVideoCallWith4To3AspectRatio
161 #else 137 #else
162 #define MAYBE_CanSetupVideoCallWith4To3AspectRatio \ 138 #define MAYBE_CanSetupVideoCallWith4To3AspectRatio \
163 CanSetupVideoCallWith4To3AspectRatio 139 CanSetupVideoCallWith4To3AspectRatio
164 #endif 140 #endif
165 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 141 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
166 MAYBE_CanSetupVideoCallWith4To3AspectRatio) { 142 MAYBE_CanSetupVideoCallWith4To3AspectRatio) {
167 const std::string javascript = 143 const std::string javascript =
168 "callAndExpectResolution({video: {mandatory: {minWidth: 960," 144 "callAndExpectResolution({video: {mandatory: {minWidth: 960,"
169 "maxAspectRatio: 1.333}}}, 960, 720);"; 145 "maxAspectRatio: 1.333}}}, 960, 720);";
170 MakeTypicalPeerConnectionCall(javascript); 146 MakeTypicalPeerConnectionCall(javascript);
171 } 147 }
172 148
173 // Flaky on TSAN v2. http://crbug.com/408006 149 // Flaky on TSAN v2. http://crbug.com/408006
174 #if defined(THREAD_SANITIZER) 150 #if defined(THREAD_SANITIZER)
175 #define MAYBE_CanSetupVideoCallAndDisableLocalVideo \ 151 #define MAYBE_CanSetupVideoCallAndDisableLocalVideo \
176 DISABLED_CanSetupVideoCallAndDisableLocalVideo 152 DISABLED_CanSetupVideoCallAndDisableLocalVideo
177 #else 153 #else
178 #define MAYBE_CanSetupVideoCallAndDisableLocalVideo \ 154 #define MAYBE_CanSetupVideoCallAndDisableLocalVideo \
179 CanSetupVideoCallAndDisableLocalVideo 155 CanSetupVideoCallAndDisableLocalVideo
180 #endif 156 #endif
181 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 157 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
182 MAYBE_CanSetupVideoCallAndDisableLocalVideo) { 158 MAYBE_CanSetupVideoCallAndDisableLocalVideo) {
183 const std::string javascript = 159 const std::string javascript =
184 "callAndDisableLocalVideo({video: true});"; 160 "callAndDisableLocalVideo({video: true});";
185 MakeTypicalPeerConnectionCall(javascript); 161 MakeTypicalPeerConnectionCall(javascript);
186 } 162 }
187 163
188 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 164 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
189 // Timing out on ARM linux, see http://crbug.com/240376 165 // Timing out on ARM linux, see http://crbug.com/240376
190 #define MAYBE_CanSetupAudioAndVideoCall DISABLED_CanSetupAudioAndVideoCall 166 #define MAYBE_CanSetupAudioAndVideoCall DISABLED_CanSetupAudioAndVideoCall
191 #else 167 #else
192 #define MAYBE_CanSetupAudioAndVideoCall CanSetupAudioAndVideoCall 168 #define MAYBE_CanSetupAudioAndVideoCall CanSetupAudioAndVideoCall
193 #endif 169 #endif
194 170
195 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanSetupAudioAndVideoCall) { 171 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
172 MAYBE_CanSetupAudioAndVideoCall) {
196 MakeTypicalPeerConnectionCall("call({video: true, audio: true});"); 173 MakeTypicalPeerConnectionCall("call({video: true, audio: true});");
197 } 174 }
198 175
199 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MANUAL_CanSetupCallAndSendDtmf) { 176 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
177 MANUAL_CanSetupCallAndSendDtmf) {
200 MakeTypicalPeerConnectionCall("callAndSendDtmf(\'123,abc\');"); 178 MakeTypicalPeerConnectionCall("callAndSendDtmf(\'123,abc\');");
201 } 179 }
202 180
203 // TODO(phoglund): this test fails because the peer connection state will be 181 // TODO(phoglund): this test fails because the peer connection state will be
204 // stable in the second negotiation round rather than have-local-offer. 182 // stable in the second negotiation round rather than have-local-offer.
205 // http://crbug.com/293125. 183 // http://crbug.com/293125.
206 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 184 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
207 DISABLED_CanMakeEmptyCallThenAddStreamsAndRenegotiate) { 185 DISABLED_CanMakeEmptyCallThenAddStreamsAndRenegotiate) {
208 const char* kJavascript = 186 const char* kJavascript =
209 "callEmptyThenAddOneStreamAndRenegotiate({video: true, audio: true});"; 187 "callEmptyThenAddOneStreamAndRenegotiate({video: true, audio: true});";
210 MakeTypicalPeerConnectionCall(kJavascript); 188 MakeTypicalPeerConnectionCall(kJavascript);
211 } 189 }
212 190
213 // Below 2 test will make a complete PeerConnection-based call between pc1 and 191 // Below 2 test will make a complete PeerConnection-based call between pc1 and
214 // pc2, and then use the remote stream to setup a call between pc3 and pc4, and 192 // pc2, and then use the remote stream to setup a call between pc3 and pc4, and
215 // then verify that video is received on pc3 and pc4. 193 // then verify that video is received on pc3 and pc4.
216 // The stream sent from pc3 to pc4 is the stream received on pc1. 194 // The stream sent from pc3 to pc4 is the stream received on pc1.
217 // The stream sent from pc4 to pc3 is cloned from stream the stream received 195 // The stream sent from pc4 to pc3 is cloned from stream the stream received
218 // on pc2. 196 // on pc2.
219 // Flaky on win xp. http://crbug.com/304775 197 // Flaky on win xp. http://crbug.com/304775
220 #if defined(OS_WIN) 198 #if defined(OS_WIN)
221 #define MAYBE_CanForwardRemoteStream DISABLED_CanForwardRemoteStream 199 #define MAYBE_CanForwardRemoteStream DISABLED_CanForwardRemoteStream
222 #define MAYBE_CanForwardRemoteStream720p DISABLED_CanForwardRemoteStream720p 200 #define MAYBE_CanForwardRemoteStream720p DISABLED_CanForwardRemoteStream720p
223 #else 201 #else
224 #define MAYBE_CanForwardRemoteStream CanForwardRemoteStream 202 #define MAYBE_CanForwardRemoteStream CanForwardRemoteStream
225 // Flaky on TSAN v2. http://crbug.com/373637 203 // Flaky on TSAN v2. http://crbug.com/373637
226 #if defined(THREAD_SANITIZER) 204 #if defined(THREAD_SANITIZER)
227 #define MAYBE_CanForwardRemoteStream720p DISABLED_CanForwardRemoteStream720p 205 #define MAYBE_CanForwardRemoteStream720p DISABLED_CanForwardRemoteStream720p
228 #else 206 #else
229 #define MAYBE_CanForwardRemoteStream720p CanForwardRemoteStream720p 207 #define MAYBE_CanForwardRemoteStream720p CanForwardRemoteStream720p
230 #endif 208 #endif
231 #endif 209 #endif
232 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanForwardRemoteStream) { 210 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, MAYBE_CanForwardRemoteStream) {
233 #if defined (OS_ANDROID) 211 #if defined (OS_ANDROID)
234 // This test fails on Nexus 5 devices. 212 // This test fails on Nexus 5 devices.
235 // TODO(henrika): see http://crbug.com/362437 and http://crbug.com/359389 213 // TODO(henrika): see http://crbug.com/362437 and http://crbug.com/359389
236 // for details. 214 // for details.
237 base::CommandLine::ForCurrentProcess()->AppendSwitch( 215 base::CommandLine::ForCurrentProcess()->AppendSwitch(
238 switches::kDisableWebRtcHWDecoding); 216 switches::kDisableWebRtcHWDecoding);
239 #endif 217 #endif
240 MakeTypicalPeerConnectionCall( 218 MakeTypicalPeerConnectionCall(
241 "callAndForwardRemoteStream({video: true, audio: false});"); 219 "callAndForwardRemoteStream({video: true, audio: false});");
242 } 220 }
243 221
244 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanForwardRemoteStream720p) { 222 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
223 MAYBE_CanForwardRemoteStream720p) {
245 #if defined (OS_ANDROID) 224 #if defined (OS_ANDROID)
246 // This test fails on Nexus 5 devices. 225 // This test fails on Nexus 5 devices.
247 // TODO(henrika): see http://crbug.com/362437 and http://crbug.com/359389 226 // TODO(henrika): see http://crbug.com/362437 and http://crbug.com/359389
248 // for details. 227 // for details.
249 base::CommandLine::ForCurrentProcess()->AppendSwitch( 228 base::CommandLine::ForCurrentProcess()->AppendSwitch(
250 switches::kDisableWebRtcHWDecoding); 229 switches::kDisableWebRtcHWDecoding);
251 #endif 230 #endif
252 const std::string javascript = GenerateGetUserMediaCall( 231 const std::string javascript = GenerateGetUserMediaCall(
253 "callAndForwardRemoteStream", 1280, 1280, 720, 720, 10, 30); 232 "callAndForwardRemoteStream", 1280, 1280, 720, 720, 10, 30);
254 MakeTypicalPeerConnectionCall(javascript); 233 MakeTypicalPeerConnectionCall(javascript);
255 } 234 }
256 235
257 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 236 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
258 NoCrashWhenConnectChromiumSinkToRemoteTrack) { 237 NoCrashWhenConnectChromiumSinkToRemoteTrack) {
259 MakeTypicalPeerConnectionCall("ConnectChromiumSinkToRemoteAudioTrack();"); 238 MakeTypicalPeerConnectionCall("ConnectChromiumSinkToRemoteAudioTrack();");
260 } 239 }
261 240
262 // This test will make a complete PeerConnection-based call but remove the 241 // This test will make a complete PeerConnection-based call but remove the
263 // MSID and bundle attribute from the initial offer to verify that 242 // MSID and bundle attribute from the initial offer to verify that
264 // video is playing for the call even if the initiating client don't support 243 // video is playing for the call even if the initiating client don't support
265 // MSID. http://tools.ietf.org/html/draft-alvestrand-rtcweb-msid-02 244 // MSID. http://tools.ietf.org/html/draft-alvestrand-rtcweb-msid-02
266 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 245 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
267 // Timing out on ARM linux, see http://crbug.com/240373 246 // Timing out on ARM linux, see http://crbug.com/240373
268 #define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\ 247 #define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\
269 DISABLED_CanSetupAudioAndVideoCallWithoutMsidAndBundle 248 DISABLED_CanSetupAudioAndVideoCallWithoutMsidAndBundle
270 #else 249 #else
271 #define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\ 250 #define MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle\
272 CanSetupAudioAndVideoCallWithoutMsidAndBundle 251 CanSetupAudioAndVideoCallWithoutMsidAndBundle
273 #endif 252 #endif
274 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 253 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
275 MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle) { 254 MAYBE_CanSetupAudioAndVideoCallWithoutMsidAndBundle) {
276 MakeTypicalPeerConnectionCall("callWithoutMsidAndBundle();"); 255 MakeTypicalPeerConnectionCall("callWithoutMsidAndBundle();");
277 } 256 }
278 257
279 // This test will modify the SDP offer to an unsupported codec, which should 258 // This test will modify the SDP offer to an unsupported codec, which should
280 // cause SetLocalDescription to fail. 259 // cause SetLocalDescription to fail.
281 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, NegotiateUnsupportedVideoCodec) { 260 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
261 NegotiateUnsupportedVideoCodec) {
282 MakeTypicalPeerConnectionCall("negotiateUnsupportedVideoCodec();"); 262 MakeTypicalPeerConnectionCall("negotiateUnsupportedVideoCodec();");
283 } 263 }
284 264
285 // This test will modify the SDP offer to use no encryption, which should 265 // This test will modify the SDP offer to use no encryption, which should
286 // cause SetLocalDescription to fail. 266 // cause SetLocalDescription to fail.
287 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, NegotiateNonCryptoCall) { 267 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, NegotiateNonCryptoCall) {
288 MakeTypicalPeerConnectionCall("negotiateNonCryptoCall();"); 268 MakeTypicalPeerConnectionCall("negotiateNonCryptoCall();");
289 } 269 }
290 270
291 // This test can negotiate an SDP offer that includes a b=AS:xx to control 271 // This test can negotiate an SDP offer that includes a b=AS:xx to control
292 // the bandwidth for audio and video 272 // the bandwidth for audio and video
293 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, NegotiateOfferWithBLine) { 273 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, NegotiateOfferWithBLine) {
294 MakeTypicalPeerConnectionCall("negotiateOfferWithBLine();"); 274 MakeTypicalPeerConnectionCall("negotiateOfferWithBLine();");
295 } 275 }
296 276
297 // This test will make a complete PeerConnection-based call using legacy SDP 277 // This test will make a complete PeerConnection-based call using legacy SDP
298 // settings: GIce, external SDES, and no BUNDLE. 278 // settings: GIce, external SDES, and no BUNDLE.
299 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 279 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
300 // Timing out on ARM linux, see http://crbug.com/240373 280 // Timing out on ARM linux, see http://crbug.com/240373
301 #define MAYBE_CanSetupLegacyCall DISABLED_CanSetupLegacyCall 281 #define MAYBE_CanSetupLegacyCall DISABLED_CanSetupLegacyCall
302 #else 282 #else
303 #define MAYBE_CanSetupLegacyCall CanSetupLegacyCall 283 #define MAYBE_CanSetupLegacyCall CanSetupLegacyCall
304 #endif 284 #endif
305 285
306 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanSetupLegacyCall) { 286 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, MAYBE_CanSetupLegacyCall) {
307 MakeTypicalPeerConnectionCall("callWithLegacySdp();"); 287 MakeTypicalPeerConnectionCall("callWithLegacySdp();");
308 } 288 }
309 289
310 // This test will make a PeerConnection-based call and test an unreliable text 290 // This test will make a PeerConnection-based call and test an unreliable text
311 // dataChannel. 291 // dataChannel.
312 // TODO(mallinath) - Remove this test after rtp based data channel is disabled. 292 // TODO(mallinath) - Remove this test after rtp based data channel is disabled.
313 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, CallWithDataOnly) { 293 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CallWithDataOnly) {
314 MakeTypicalPeerConnectionCall("callWithDataOnly();"); 294 MakeTypicalPeerConnectionCall("callWithDataOnly();");
315 } 295 }
316 296
317 #if defined(MEMORY_SANITIZER) 297 #if defined(MEMORY_SANITIZER)
318 // Fails under MemorySanitizer: http://crbug.com/405951 298 // Fails under MemorySanitizer: http://crbug.com/405951
319 #define MAYBE_CallWithSctpDataOnly DISABLED_CallWithSctpDataOnly 299 #define MAYBE_CallWithSctpDataOnly DISABLED_CallWithSctpDataOnly
320 #else 300 #else
321 #define MAYBE_CallWithSctpDataOnly CallWithSctpDataOnly 301 #define MAYBE_CallWithSctpDataOnly CallWithSctpDataOnly
322 #endif 302 #endif
323 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithSctpDataOnly) { 303 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, MAYBE_CallWithSctpDataOnly) {
324 MakeTypicalPeerConnectionCall("callWithSctpDataOnly();"); 304 MakeTypicalPeerConnectionCall("callWithSctpDataOnly();");
325 } 305 }
326 306
327 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 307 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
328 // Timing out on ARM linux bot: http://crbug.com/238490 308 // Timing out on ARM linux bot: http://crbug.com/238490
329 #define MAYBE_CallWithDataAndMedia DISABLED_CallWithDataAndMedia 309 #define MAYBE_CallWithDataAndMedia DISABLED_CallWithDataAndMedia
330 #else 310 #else
331 #define MAYBE_CallWithDataAndMedia CallWithDataAndMedia 311 #define MAYBE_CallWithDataAndMedia CallWithDataAndMedia
332 #endif 312 #endif
333 313
334 // This test will make a PeerConnection-based call and test an unreliable text 314 // This test will make a PeerConnection-based call and test an unreliable text
335 // dataChannel and audio and video tracks. 315 // dataChannel and audio and video tracks.
336 // TODO(mallinath) - Remove this test after rtp based data channel is disabled. 316 // TODO(mallinath) - Remove this test after rtp based data channel is disabled.
337 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, DISABLED_CallWithDataAndMedia) { 317 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, DISABLED_CallWithDataAndMedia) {
338 MakeTypicalPeerConnectionCall("callWithDataAndMedia();"); 318 MakeTypicalPeerConnectionCall("callWithDataAndMedia();");
339 } 319 }
340 320
341 321
342 #if (defined(OS_LINUX) && !defined(OS_CHROMEOS) && \ 322 #if (defined(OS_LINUX) && !defined(OS_CHROMEOS) && \
343 defined(ARCH_CPU_ARM_FAMILY)) || defined(MEMORY_SANITIZER) 323 defined(ARCH_CPU_ARM_FAMILY)) || defined(MEMORY_SANITIZER)
344 // Timing out on ARM linux bot: http://crbug.com/238490 324 // Timing out on ARM linux bot: http://crbug.com/238490
345 // Fails under MemorySanitizer: http://crbug.com/405951 325 // Fails under MemorySanitizer: http://crbug.com/405951
346 #define MAYBE_CallWithSctpDataAndMedia DISABLED_CallWithSctpDataAndMedia 326 #define MAYBE_CallWithSctpDataAndMedia DISABLED_CallWithSctpDataAndMedia
347 #else 327 #else
348 #define MAYBE_CallWithSctpDataAndMedia CallWithSctpDataAndMedia 328 #define MAYBE_CallWithSctpDataAndMedia CallWithSctpDataAndMedia
349 #endif 329 #endif
350 330
351 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 331 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
352 MAYBE_CallWithSctpDataAndMedia) { 332 MAYBE_CallWithSctpDataAndMedia) {
353 MakeTypicalPeerConnectionCall("callWithSctpDataAndMedia();"); 333 MakeTypicalPeerConnectionCall("callWithSctpDataAndMedia();");
354 } 334 }
355 335
356 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 336 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
357 // Timing out on ARM linux bot: http://crbug.com/238490 337 // Timing out on ARM linux bot: http://crbug.com/238490
358 #define MAYBE_CallWithDataAndLaterAddMedia DISABLED_CallWithDataAndLaterAddMedia 338 #define MAYBE_CallWithDataAndLaterAddMedia DISABLED_CallWithDataAndLaterAddMedia
359 #else 339 #else
360 // Temporarily disable the test on all platforms. http://crbug.com/293252 340 // Temporarily disable the test on all platforms. http://crbug.com/293252
361 #define MAYBE_CallWithDataAndLaterAddMedia DISABLED_CallWithDataAndLaterAddMedia 341 #define MAYBE_CallWithDataAndLaterAddMedia DISABLED_CallWithDataAndLaterAddMedia
362 #endif 342 #endif
363 343
364 // This test will make a PeerConnection-based call and test an unreliable text 344 // This test will make a PeerConnection-based call and test an unreliable text
365 // dataChannel and later add an audio and video track. 345 // dataChannel and later add an audio and video track.
366 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithDataAndLaterAddMedia) { 346 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
347 MAYBE_CallWithDataAndLaterAddMedia) {
367 MakeTypicalPeerConnectionCall("callWithDataAndLaterAddMedia();"); 348 MakeTypicalPeerConnectionCall("callWithDataAndLaterAddMedia();");
368 } 349 }
369 350
370 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) 351 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
371 // Timing out on ARM linux bot: http://crbug.com/238490 352 // Timing out on ARM linux bot: http://crbug.com/238490
372 #define MAYBE_CallWithNewVideoMediaStream DISABLED_CallWithNewVideoMediaStream 353 #define MAYBE_CallWithNewVideoMediaStream DISABLED_CallWithNewVideoMediaStream
373 #else 354 #else
374 #define MAYBE_CallWithNewVideoMediaStream CallWithNewVideoMediaStream 355 #define MAYBE_CallWithNewVideoMediaStream CallWithNewVideoMediaStream
375 #endif 356 #endif
376 357
377 // This test will make a PeerConnection-based call and send a new Video 358 // This test will make a PeerConnection-based call and send a new Video
378 // MediaStream that has been created based on a MediaStream created with 359 // MediaStream that has been created based on a MediaStream created with
379 // getUserMedia. 360 // getUserMedia.
380 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithNewVideoMediaStream) { 361 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
362 MAYBE_CallWithNewVideoMediaStream) {
381 MakeTypicalPeerConnectionCall("callWithNewVideoMediaStream();"); 363 MakeTypicalPeerConnectionCall("callWithNewVideoMediaStream();");
382 } 364 }
383 365
384 // This test will make a PeerConnection-based call and send a new Video 366 // This test will make a PeerConnection-based call and send a new Video
385 // MediaStream that has been created based on a MediaStream created with 367 // MediaStream that has been created based on a MediaStream created with
386 // getUserMedia. When video is flowing, the VideoTrack is removed and an 368 // getUserMedia. When video is flowing, the VideoTrack is removed and an
387 // AudioTrack is added instead. 369 // AudioTrack is added instead.
388 // TODO(phoglund): This test is manual since not all buildbots has an audio 370 // TODO(phoglund): This test is manual since not all buildbots has an audio
389 // input. 371 // input.
390 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MANUAL_CallAndModifyStream) { 372 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, MANUAL_CallAndModifyStream) {
391 MakeTypicalPeerConnectionCall( 373 MakeTypicalPeerConnectionCall(
392 "callWithNewVideoMediaStreamLaterSwitchToAudio();"); 374 "callWithNewVideoMediaStreamLaterSwitchToAudio();");
393 } 375 }
394 376
395 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, AddTwoMediaStreamsToOnePC) { 377 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, AddTwoMediaStreamsToOnePC) {
396 MakeTypicalPeerConnectionCall("addTwoMediaStreamsToOneConnection();"); 378 MakeTypicalPeerConnectionCall("addTwoMediaStreamsToOneConnection();");
397 } 379 }
398 380
399 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 381 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
400 EstablishAudioVideoCallAndEnsureAudioIsPlaying) { 382 EstablishAudioVideoCallAndEnsureAudioIsPlaying) {
401 MakeAudioDetectingPeerConnectionCall(base::StringPrintf( 383 MakeAudioDetectingPeerConnectionCall(base::StringPrintf(
402 "callAndEnsureAudioIsPlaying(%s, {audio:true, video:true});", 384 "callAndEnsureAudioIsPlaying(%s, {audio:true, video:true});",
403 kUseLenientAudioChecking)); 385 kUseLenientAudioChecking));
404 } 386 }
405 387
406 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 388 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
407 EstablishAudioOnlyCallAndEnsureAudioIsPlaying) { 389 EstablishAudioOnlyCallAndEnsureAudioIsPlaying) {
408 MakeAudioDetectingPeerConnectionCall(base::StringPrintf( 390 MakeAudioDetectingPeerConnectionCall(base::StringPrintf(
409 "callAndEnsureAudioIsPlaying(%s, {audio:true});", 391 "callAndEnsureAudioIsPlaying(%s, {audio:true});",
410 kUseLenientAudioChecking)); 392 kUseLenientAudioChecking));
411 } 393 }
412 394
413 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 395 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
414 EstablishAudioVideoCallAndVerifyRemoteMutingWorks) { 396 EstablishAudioVideoCallAndVerifyRemoteMutingWorks) {
415 MakeAudioDetectingPeerConnectionCall(base::StringPrintf( 397 MakeAudioDetectingPeerConnectionCall(base::StringPrintf(
416 "callAndEnsureRemoteAudioTrackMutingWorks(%s);", 398 "callAndEnsureRemoteAudioTrackMutingWorks(%s);",
417 kUseLenientAudioChecking)); 399 kUseLenientAudioChecking));
418 } 400 }
419 401
420 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 402 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
421 EstablishAudioVideoCallAndVerifyLocalMutingWorks) { 403 EstablishAudioVideoCallAndVerifyLocalMutingWorks) {
422 MakeAudioDetectingPeerConnectionCall(base::StringPrintf( 404 MakeAudioDetectingPeerConnectionCall(base::StringPrintf(
423 "callAndEnsureLocalAudioTrackMutingWorks(%s);", 405 "callAndEnsureLocalAudioTrackMutingWorks(%s);",
424 kUseLenientAudioChecking)); 406 kUseLenientAudioChecking));
425 } 407 }
426 408
427 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 409 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
428 EnsureLocalVideoMuteDoesntMuteAudio) { 410 EnsureLocalVideoMuteDoesntMuteAudio) {
429 MakeAudioDetectingPeerConnectionCall(base::StringPrintf( 411 MakeAudioDetectingPeerConnectionCall(base::StringPrintf(
430 "callAndEnsureLocalVideoMutingDoesntMuteAudio(%s);", 412 "callAndEnsureLocalVideoMutingDoesntMuteAudio(%s);",
431 kUseLenientAudioChecking)); 413 kUseLenientAudioChecking));
432 } 414 }
433 415
434 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 416 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
435 EnsureRemoteVideoMuteDoesntMuteAudio) { 417 EnsureRemoteVideoMuteDoesntMuteAudio) {
436 MakeAudioDetectingPeerConnectionCall(base::StringPrintf( 418 MakeAudioDetectingPeerConnectionCall(base::StringPrintf(
437 "callAndEnsureRemoteVideoMutingDoesntMuteAudio(%s);", 419 "callAndEnsureRemoteVideoMutingDoesntMuteAudio(%s);",
438 kUseLenientAudioChecking)); 420 kUseLenientAudioChecking));
439 } 421 }
440 422
441 // Flaky on TSAN v2: http://crbug.com/373637 423 // Flaky on TSAN v2: http://crbug.com/373637
442 #if defined(THREAD_SANITIZER) 424 #if defined(THREAD_SANITIZER)
443 #define MAYBE_EstablishAudioVideoCallAndVerifyUnmutingWorks\ 425 #define MAYBE_EstablishAudioVideoCallAndVerifyUnmutingWorks\
444 DISABLED_EstablishAudioVideoCallAndVerifyUnmutingWorks 426 DISABLED_EstablishAudioVideoCallAndVerifyUnmutingWorks
445 #else 427 #else
446 #define MAYBE_EstablishAudioVideoCallAndVerifyUnmutingWorks\ 428 #define MAYBE_EstablishAudioVideoCallAndVerifyUnmutingWorks\
447 EstablishAudioVideoCallAndVerifyUnmutingWorks 429 EstablishAudioVideoCallAndVerifyUnmutingWorks
448 #endif 430 #endif
449 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, 431 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
450 MAYBE_EstablishAudioVideoCallAndVerifyUnmutingWorks) { 432 MAYBE_EstablishAudioVideoCallAndVerifyUnmutingWorks) {
451 MakeAudioDetectingPeerConnectionCall(base::StringPrintf( 433 MakeAudioDetectingPeerConnectionCall(base::StringPrintf(
452 "callAndEnsureAudioTrackUnmutingWorks(%s);", kUseLenientAudioChecking)); 434 "callAndEnsureAudioTrackUnmutingWorks(%s);", kUseLenientAudioChecking));
453 } 435 }
454 436
455 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, CallAndVerifyVideoMutingWorks) { 437 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CallAndVerifyVideoMutingWorks) {
456 MakeTypicalPeerConnectionCall("callAndEnsureVideoTrackMutingWorks();"); 438 MakeTypicalPeerConnectionCall("callAndEnsureVideoTrackMutingWorks();");
457 } 439 }
458 440
459 #if defined(OS_WIN) 441 IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CreateOfferWithOfferOptions) {
460 #define IntToStringType base::IntToString16
461 #else
462 #define IntToStringType base::IntToString
463 #endif
464
465 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
466 // Timing out on ARM linux bot: http://crbug.com/238490
467 #define MAYBE_CallWithAecDump DISABLED_CallWithAecDump
468 #else
469 #define MAYBE_CallWithAecDump CallWithAecDump
470 #endif
471
472 // This tests will make a complete PeerConnection-based call, verify that
473 // video is playing for the call, and verify that a non-empty AEC dump file
474 // exists. The AEC dump is enabled through webrtc-internals. The HTML and
475 // Javascript is bypassed since it would trigger a file picker dialog. Instead,
476 // the dialog callback FileSelected() is invoked directly. In fact, there's
477 // never a webrtc-internals page opened at all since that's not needed.
478 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CallWithAecDump) {
479 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
480
481 // We must navigate somewhere first so that the render process is created.
482 NavigateToURL(shell(), GURL(""));
483
484 base::FilePath dump_file;
485 ASSERT_TRUE(CreateTemporaryFile(&dump_file));
486 base::DeleteFile(dump_file, false);
487
488 // This fakes the behavior of another open tab with webrtc-internals, and
489 // enabling AEC dump in that tab.
490 WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL);
491
492 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
493 NavigateToURL(shell(), url);
494 DisableOpusIfOnAndroid();
495 ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});");
496
497 EXPECT_FALSE(base::PathExists(dump_file));
498
499 // Add file extensions that we expect to be added. The dump name will be
500 // <temporary path>.<render process id>.<consumer id>, for example
501 // "/tmp/.com.google.Chrome.Z6UC3P.12345.0".
502 base::ProcessId render_process_id = base::kNullProcessId;
503 EXPECT_TRUE(GetRenderProcessHostId(&render_process_id));
504 dump_file = dump_file.AddExtension(IntToStringType(render_process_id))
505 .AddExtension(IntToStringType(kExpectedConsumerId));
506
507 EXPECT_TRUE(base::PathExists(dump_file));
508 int64 file_size = 0;
509 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size));
510 EXPECT_GT(file_size, 0);
511
512 base::DeleteFile(dump_file, false);
513 }
514
515 // TODO(grunell): Add test for multiple dumps when re-use of
516 // MediaStreamAudioProcessor in AudioCapturer has been removed.
517
518 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
519 // Timing out on ARM linux bot: http://crbug.com/238490
520 #define MAYBE_CallWithAecDumpEnabledThenDisabled DISABLED_CallWithAecDumpEnabled ThenDisabled
521 #else
522 #define MAYBE_CallWithAecDumpEnabledThenDisabled CallWithAecDumpEnabledThenDisab led
523 #endif
524
525 // As above, but enable and disable dump before starting a call. The file should
526 // be created, but should be empty.
527 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
528 MAYBE_CallWithAecDumpEnabledThenDisabled) {
529 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
530
531 // We must navigate somewhere first so that the render process is created.
532 NavigateToURL(shell(), GURL(""));
533
534 base::FilePath dump_file;
535 ASSERT_TRUE(CreateTemporaryFile(&dump_file));
536 base::DeleteFile(dump_file, false);
537
538 // This fakes the behavior of another open tab with webrtc-internals, and
539 // enabling AEC dump in that tab, then disabling it.
540 WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL);
541 WebRTCInternals::GetInstance()->DisableAecDump();
542
543 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
544 NavigateToURL(shell(), url);
545 DisableOpusIfOnAndroid();
546 ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});");
547
548 // Add file extensions that we expect to be added.
549 base::ProcessId render_process_id = base::kNullProcessId;
550 EXPECT_TRUE(GetRenderProcessHostId(&render_process_id));
551 dump_file = dump_file.AddExtension(IntToStringType(render_process_id))
552 .AddExtension(IntToStringType(kExpectedConsumerId));
553
554 EXPECT_FALSE(base::PathExists(dump_file));
555
556 base::DeleteFile(dump_file, false);
557 }
558
559 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
560 // Timing out on ARM linux bot: http://crbug.com/238490
561 #define MAYBE_TwoCallsWithAecDump DISABLED_TwoCallsWithAecDump
562 #else
563 #define MAYBE_TwoCallsWithAecDump TwoCallsWithAecDump
564 #endif
565
566 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_TwoCallsWithAecDump) {
567 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
568
569 // We must navigate somewhere first so that the render process is created.
570 NavigateToURL(shell(), GURL(""));
571
572 // Create a second window.
573 Shell* shell2 = CreateBrowser();
574 NavigateToURL(shell2, GURL(""));
575
576 base::FilePath dump_file;
577 ASSERT_TRUE(CreateTemporaryFile(&dump_file));
578 base::DeleteFile(dump_file, false);
579
580 // This fakes the behavior of another open tab with webrtc-internals, and
581 // enabling AEC dump in that tab.
582 WebRTCInternals::GetInstance()->FileSelected(dump_file, -1, NULL);
583
584 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
585
586 NavigateToURL(shell(), url);
587 NavigateToURL(shell2, url);
588 ExecuteJavascriptAndWaitForOk("call({video: true, audio: true});");
589 std::string result;
590 EXPECT_TRUE(ExecuteScriptAndExtractString(
591 shell2->web_contents(),
592 "call({video: true, audio: true});",
593 &result));
594 ASSERT_STREQ("OK", result.c_str());
595
596 EXPECT_FALSE(base::PathExists(dump_file));
597
598 RenderProcessHost::iterator it =
599 content::RenderProcessHost::AllHostsIterator();
600 for (; !it.IsAtEnd(); it.Advance()) {
601 base::ProcessId render_process_id =
602 base::GetProcId(it.GetCurrentValue()->GetHandle());
603 EXPECT_NE(base::kNullProcessId, render_process_id);
604
605 // Add file extensions that we expect to be added.
606 base::FilePath unique_dump_file =
607 dump_file.AddExtension(IntToStringType(render_process_id))
608 .AddExtension(IntToStringType(kExpectedConsumerId));
609
610 EXPECT_TRUE(base::PathExists(unique_dump_file));
611 int64 file_size = 0;
612 EXPECT_TRUE(base::GetFileSize(unique_dump_file, &file_size));
613 EXPECT_GT(file_size, 0);
614
615 base::DeleteFile(unique_dump_file, false);
616 }
617 }
618
619 IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, CreateOfferWithOfferOptions) {
620 MakeTypicalPeerConnectionCall("testCreateOfferOptions();"); 442 MakeTypicalPeerConnectionCall("testCreateOfferOptions();");
621 } 443 }
622 444
623 } // namespace content 445 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/webrtc_aecdump_browsertest.cc ('k') | content/browser/media/webrtc_internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698