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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnection_unittest.cc
diff --git a/webrtc/api/peerconnection_unittest.cc b/webrtc/api/peerconnection_unittest.cc
index 6a909b6b1be0fd9a2cf505b14255ef246dbe8f69..50e2c3dc6b3eb08f6c4b3b91fc6fed3b98d0de0a 100644
--- a/webrtc/api/peerconnection_unittest.cc
+++ b/webrtc/api/peerconnection_unittest.cc
@@ -1301,11 +1301,17 @@ class P2PTestConductor : public testing::Test {
void VerifyRenderedSize(int width,
int height,
webrtc::VideoRotation rotation) {
- EXPECT_EQ(width, receiving_client()->rendered_width());
- EXPECT_EQ(height, receiving_client()->rendered_height());
+ double expected_aspect_ratio = static_cast<double>(width) / height;
+ double receiving_client_rendered_aspect_ratio =
+ static_cast<double>(receiving_client()->rendered_width()) /
+ receiving_client()->rendered_height();
+ double initializing_client_rendered_aspect_ratio =
+ static_cast<double>(initializing_client()->rendered_width()) /
+ initializing_client()->rendered_height();
+ EXPECT_EQ(expected_aspect_ratio, receiving_client_rendered_aspect_ratio);
+ EXPECT_EQ(expected_aspect_ratio, initializing_client_rendered_aspect_ratio);
+
EXPECT_EQ(rotation, receiving_client()->rendered_rotation());
- EXPECT_EQ(width, initializing_client()->rendered_width());
- EXPECT_EQ(height, initializing_client()->rendered_height());
EXPECT_EQ(rotation, initializing_client()->rendered_rotation());
// Verify size of the local preview.
« 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