Commit 480ee2d1 authored by François Beaufort's avatar François Beaufort Committed by Commit Bot

[Picture-in-Picture] Test aspect ratio in web platform tests.

Change-Id: Ic0ab988927938f42234895d68e65779b9fbb4c5e
Reviewed-on: https://chromium-review.googlesource.com/c/1288430Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#602325}
parent 44f4279a
......@@ -606,9 +606,9 @@ bool Shell::ShouldAllowRunningInsecureContent(
gfx::Size Shell::EnterPictureInPicture(const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) {
// During tests, returning a fake window size to pretent the window was
// created and allow tests to run accordingly.
return switches::IsRunWebTestsSwitchPresent() ? gfx::Size(42, 42)
// During tests, returning a fake window size (same aspect ratio) to pretend
// the window was created and allow tests to run accordingly.
return switches::IsRunWebTestsSwitchPresent() ? natural_size
: gfx::Size(0, 0);
}
......
......@@ -14,6 +14,9 @@ promise_test(async t => {
.then(pipWindow => {
assert_not_equals(pipWindow.width, 0);
assert_not_equals(pipWindow.height, 0);
const videoAspectRatio = video.videoWidth / video.videoHeight;
const pipWindowAspectRatio = pipWindow.width / pipWindow.height;
assert_equals(videoAspectRatio, pipWindowAspectRatio);
});
}, 'Picture-in-Picture window dimensions are set after entering Picture-in-Picture');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment