Commit f18506ab authored by Christian Biesinger's avatar Christian Biesinger Committed by Chromium LUCI CQ

Make canvas-aspect-ratio not use async_test

No need for this test to be async; I think this was copy-pasted
from the video or img test which do need async.

R=masonfreed@chromium.org

Change-Id: I0f9a6e651fa3914fb8ae35ec8cd856cc839a8e25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643071
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846281}
parent 4543daf5
......@@ -11,20 +11,17 @@
</style>
<body>
<script>
let t = async_test("Canvas width and height attributes are used as the surface size");
function assert_ratio(img, expected) {
let epsilon = 0.001;
assert_approx_equals(parseInt(getComputedStyle(img).width, 10) / parseInt(getComputedStyle(img).height, 10), expected, epsilon);
}
// Create and append a new canvas and immediately check the ratio.
t.step(function() {
test(function() {
var canvas = document.createElement("canvas");
canvas.setAttribute("width", "250");
canvas.setAttribute("height", "100");
document.body.appendChild(canvas);
// Canvases always use the aspect ratio from their surface size.
assert_ratio(canvas, 2.5);
t.done();
});
}, "Canvas width and height attributes are used as the surface size");
</script>
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