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

Side by Side Diff: webrtc/api/peerconnection_unittest.cc

Issue 2547673002: In end-to-end PeerConnection tests, allow video to be downscaled. (Closed)
Patch Set: Created 4 years 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 EXPECT_EQ(pc2_video_received, receiving_client_->video_frames_received()); 1294 EXPECT_EQ(pc2_video_received, receiving_client_->video_frames_received());
1295 } 1295 }
1296 1296
1297 void VerifyRenderedSize(int width, int height) { 1297 void VerifyRenderedSize(int width, int height) {
1298 VerifyRenderedSize(width, height, webrtc::kVideoRotation_0); 1298 VerifyRenderedSize(width, height, webrtc::kVideoRotation_0);
1299 } 1299 }
1300 1300
1301 void VerifyRenderedSize(int width, 1301 void VerifyRenderedSize(int width,
1302 int height, 1302 int height,
1303 webrtc::VideoRotation rotation) { 1303 webrtc::VideoRotation rotation) {
1304 EXPECT_EQ(width, receiving_client()->rendered_width()); 1304 double expected_aspect_ratio = static_cast<double>(width) / height;
1305 EXPECT_EQ(height, receiving_client()->rendered_height()); 1305 double receiving_client_rendered_aspect_ratio =
1306 static_cast<double>(receiving_client()->rendered_width()) /
1307 receiving_client()->rendered_height();
1308 double initializing_client_rendered_aspect_ratio =
1309 static_cast<double>(initializing_client()->rendered_width()) /
1310 initializing_client()->rendered_height();
1311 EXPECT_EQ(expected_aspect_ratio, receiving_client_rendered_aspect_ratio);
1312 EXPECT_EQ(expected_aspect_ratio, initializing_client_rendered_aspect_ratio);
1313
1306 EXPECT_EQ(rotation, receiving_client()->rendered_rotation()); 1314 EXPECT_EQ(rotation, receiving_client()->rendered_rotation());
1307 EXPECT_EQ(width, initializing_client()->rendered_width());
1308 EXPECT_EQ(height, initializing_client()->rendered_height());
1309 EXPECT_EQ(rotation, initializing_client()->rendered_rotation()); 1315 EXPECT_EQ(rotation, initializing_client()->rendered_rotation());
1310 1316
1311 // Verify size of the local preview. 1317 // Verify size of the local preview.
1312 EXPECT_EQ(width, initializing_client()->local_rendered_width()); 1318 EXPECT_EQ(width, initializing_client()->local_rendered_width());
1313 EXPECT_EQ(height, initializing_client()->local_rendered_height()); 1319 EXPECT_EQ(height, initializing_client()->local_rendered_height());
1314 } 1320 }
1315 1321
1316 void VerifySessionDescriptions() { 1322 void VerifySessionDescriptions() {
1317 initiating_client_->VerifyRejectedMediaInSessionDescription(); 1323 initiating_client_->VerifyRejectedMediaInSessionDescription();
1318 receiving_client_->VerifyRejectedMediaInSessionDescription(); 1324 receiving_client_->VerifyRejectedMediaInSessionDescription();
(...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after
2802 server.urls.push_back("turn:hostname2"); 2808 server.urls.push_back("turn:hostname2");
2803 servers.push_back(server); 2809 servers.push_back(server);
2804 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_)); 2810 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_));
2805 EXPECT_EQ(2U, turn_servers_.size()); 2811 EXPECT_EQ(2U, turn_servers_.size());
2806 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority); 2812 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority);
2807 } 2813 }
2808 2814
2809 #endif // if !defined(THREAD_SANITIZER) 2815 #endif // if !defined(THREAD_SANITIZER)
2810 2816
2811 } // namespace 2817 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698