In end-to-end PeerConnection tests, allow video to be downscaled.

QualityScaler may scale down the resolution, so our tests shouldn't
expect the input resolution to exactly match the resolution received on
the other side. Instead, we now just check that the aspect ratio
matches.

BUG=webrtc:5907

Review-Url: https://codereview.webrtc.org/2547673002
Cr-Commit-Position: refs/heads/master@{#15373}
This commit is contained in:
deadbeef 2016-12-01 16:23:28 -08:00 committed by Commit bot
parent 897530eb48
commit b465980fd7

View File

@ -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.