OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path_watcher.h" | 9 #include "base/files/file_path_watcher.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 ASSERT_TRUE(embedded_test_server()->Start()); | 154 ASSERT_TRUE(embedded_test_server()->Start()); |
155 | 155 |
156 content::WebContents* left_tab = | 156 content::WebContents* left_tab = |
157 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 157 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
158 content::WebContents* right_tab = | 158 content::WebContents* right_tab = |
159 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 159 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
160 | 160 |
161 SetupPeerconnectionWithLocalStream(left_tab); | 161 SetupPeerconnectionWithLocalStream(left_tab); |
162 SetupPeerconnectionWithLocalStream(right_tab); | 162 SetupPeerconnectionWithLocalStream(right_tab); |
163 | 163 |
164 SetDefaultVideoCodec(left_tab, "VP8"); | 164 NegotiateCall(left_tab, right_tab, "VP8"); |
165 SetDefaultVideoCodec(right_tab, "VP8"); | |
166 NegotiateCall(left_tab, right_tab); | |
167 | 165 |
168 StartDetectingVideo(left_tab, "remote-view"); | 166 StartDetectingVideo(left_tab, "remote-view"); |
169 StartDetectingVideo(right_tab, "remote-view"); | 167 StartDetectingVideo(right_tab, "remote-view"); |
170 | 168 |
171 // Start the event log. | 169 // Start the event log. |
172 const int seconds = 0; | 170 const int seconds = 0; |
173 base::ListValue start_params; | 171 base::ListValue start_params; |
174 AppendTabIdAndUrl(&start_params, left_tab); | 172 AppendTabIdAndUrl(&start_params, left_tab); |
175 start_params.AppendInteger(seconds); | 173 start_params.AppendInteger(seconds); |
176 scoped_refptr<WebrtcLoggingPrivateStartWebRtcEventLoggingFunction> | 174 scoped_refptr<WebrtcLoggingPrivateStartWebRtcEventLoggingFunction> |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 ASSERT_TRUE(embedded_test_server()->Start()); | 244 ASSERT_TRUE(embedded_test_server()->Start()); |
247 | 245 |
248 content::WebContents* left_tab = | 246 content::WebContents* left_tab = |
249 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 247 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
250 content::WebContents* right_tab = | 248 content::WebContents* right_tab = |
251 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 249 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
252 | 250 |
253 SetupPeerconnectionWithLocalStream(left_tab); | 251 SetupPeerconnectionWithLocalStream(left_tab); |
254 SetupPeerconnectionWithLocalStream(right_tab); | 252 SetupPeerconnectionWithLocalStream(right_tab); |
255 | 253 |
256 SetDefaultVideoCodec(left_tab, "VP8"); | 254 NegotiateCall(left_tab, right_tab, "VP8"); |
257 SetDefaultVideoCodec(right_tab, "VP8"); | |
258 NegotiateCall(left_tab, right_tab); | |
259 | 255 |
260 StartDetectingVideo(left_tab, "remote-view"); | 256 StartDetectingVideo(left_tab, "remote-view"); |
261 StartDetectingVideo(right_tab, "remote-view"); | 257 StartDetectingVideo(right_tab, "remote-view"); |
262 | 258 |
263 // Start the event log. RunFunctionAndReturnSingleResult will block until a | 259 // Start the event log. RunFunctionAndReturnSingleResult will block until a |
264 // result is available, which happens when the logging stops after 1 second. | 260 // result is available, which happens when the logging stops after 1 second. |
265 const int seconds = 1; | 261 const int seconds = 1; |
266 base::ListValue start_params; | 262 base::ListValue start_params; |
267 AppendTabIdAndUrl(&start_params, left_tab); | 263 AppendTabIdAndUrl(&start_params, left_tab); |
268 start_params.AppendInteger(seconds); | 264 start_params.AppendInteger(seconds); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 ASSERT_TRUE(waiter->Start()) << "ERROR watching for " | 303 ASSERT_TRUE(waiter->Start()) << "ERROR watching for " |
308 << full_file_name.value(); | 304 << full_file_name.value(); |
309 ASSERT_TRUE(waiter->WaitForFile()); | 305 ASSERT_TRUE(waiter->WaitForFile()); |
310 ASSERT_TRUE(base::PathExists(full_file_name)); | 306 ASSERT_TRUE(base::PathExists(full_file_name)); |
311 EXPECT_TRUE(base::GetFileSize(full_file_name, &file_size)); | 307 EXPECT_TRUE(base::GetFileSize(full_file_name, &file_size)); |
312 EXPECT_GT(file_size, 0); | 308 EXPECT_GT(file_size, 0); |
313 | 309 |
314 // Clean up. | 310 // Clean up. |
315 base::DeleteFile(full_file_name, false); | 311 base::DeleteFile(full_file_name, false); |
316 } | 312 } |
OLD | NEW |