| 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/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 ASSERT_TRUE(embedded_test_server()->Start()); | 113 ASSERT_TRUE(embedded_test_server()->Start()); |
| 114 | 114 |
| 115 content::WebContents* left_tab = | 115 content::WebContents* left_tab = |
| 116 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 116 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
| 117 content::WebContents* right_tab = | 117 content::WebContents* right_tab = |
| 118 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 118 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
| 119 | 119 |
| 120 SetupPeerconnectionWithLocalStream(left_tab); | 120 SetupPeerconnectionWithLocalStream(left_tab); |
| 121 SetupPeerconnectionWithLocalStream(right_tab); | 121 SetupPeerconnectionWithLocalStream(right_tab); |
| 122 | 122 |
| 123 NegotiateCall(left_tab, right_tab, "VP8"); | 123 SetDefaultVideoCodec(left_tab, "VP8"); |
| 124 SetDefaultVideoCodec(right_tab, "VP8"); |
| 125 NegotiateCall(left_tab, right_tab); |
| 124 | 126 |
| 125 StartDetectingVideo(left_tab, "remote-view"); | 127 StartDetectingVideo(left_tab, "remote-view"); |
| 126 StartDetectingVideo(right_tab, "remote-view"); | 128 StartDetectingVideo(right_tab, "remote-view"); |
| 127 | 129 |
| 128 // Start the event log. | 130 // Start the event log. |
| 129 const int seconds = 0; | 131 const int seconds = 0; |
| 130 base::ListValue start_params; | 132 base::ListValue start_params; |
| 131 AppendTabIdAndUrl(&start_params, left_tab); | 133 AppendTabIdAndUrl(&start_params, left_tab); |
| 132 start_params.AppendInteger(seconds); | 134 start_params.AppendInteger(seconds); |
| 133 scoped_refptr<WebrtcLoggingPrivateStartWebRtcEventLoggingFunction> | 135 scoped_refptr<WebrtcLoggingPrivateStartWebRtcEventLoggingFunction> |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 ASSERT_TRUE(embedded_test_server()->Start()); | 208 ASSERT_TRUE(embedded_test_server()->Start()); |
| 207 | 209 |
| 208 content::WebContents* left_tab = | 210 content::WebContents* left_tab = |
| 209 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 211 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
| 210 content::WebContents* right_tab = | 212 content::WebContents* right_tab = |
| 211 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); | 213 OpenTestPageAndGetUserMediaInNewTab(kMainWebrtcTestHtmlPage); |
| 212 | 214 |
| 213 SetupPeerconnectionWithLocalStream(left_tab); | 215 SetupPeerconnectionWithLocalStream(left_tab); |
| 214 SetupPeerconnectionWithLocalStream(right_tab); | 216 SetupPeerconnectionWithLocalStream(right_tab); |
| 215 | 217 |
| 216 NegotiateCall(left_tab, right_tab, "VP8"); | 218 SetDefaultVideoCodec(left_tab, "VP8"); |
| 219 SetDefaultVideoCodec(right_tab, "VP8"); |
| 220 NegotiateCall(left_tab, right_tab); |
| 217 | 221 |
| 218 StartDetectingVideo(left_tab, "remote-view"); | 222 StartDetectingVideo(left_tab, "remote-view"); |
| 219 StartDetectingVideo(right_tab, "remote-view"); | 223 StartDetectingVideo(right_tab, "remote-view"); |
| 220 | 224 |
| 221 // Start the event log. RunFunctionAndReturnSingleResult will block until a | 225 // Start the event log. RunFunctionAndReturnSingleResult will block until a |
| 222 // result is available, which happens when the logging stops after 1 second. | 226 // result is available, which happens when the logging stops after 1 second. |
| 223 const int seconds = 1; | 227 const int seconds = 1; |
| 224 base::ListValue start_params; | 228 base::ListValue start_params; |
| 225 AppendTabIdAndUrl(&start_params, left_tab); | 229 AppendTabIdAndUrl(&start_params, left_tab); |
| 226 start_params.AppendInteger(seconds); | 230 start_params.AppendInteger(seconds); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 VLOG(1) << "Waiting for logfile to become available..."; | 270 VLOG(1) << "Waiting for logfile to become available..."; |
| 267 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100)); | 271 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100)); |
| 268 } | 272 } |
| 269 ASSERT_TRUE(base::PathExists(full_file_name)); | 273 ASSERT_TRUE(base::PathExists(full_file_name)); |
| 270 EXPECT_TRUE(base::GetFileSize(full_file_name, &file_size)); | 274 EXPECT_TRUE(base::GetFileSize(full_file_name, &file_size)); |
| 271 EXPECT_GT(file_size, 0); | 275 EXPECT_GT(file_size, 0); |
| 272 | 276 |
| 273 // Clean up. | 277 // Clean up. |
| 274 base::DeleteFile(full_file_name, false); | 278 base::DeleteFile(full_file_name, false); |
| 275 } | 279 } |
| OLD | NEW |