Commit 3bbd8eff authored by Wan-Teh Chang's avatar Wan-Teh Chang Committed by Commit Bot

Use bits::Align(x, 2) instead of (x + 1) & ~1.

Compare coded_size directly instead of its width and height components.

Bug: N/A
Change-Id: I372335275d2f41ef8a0d98045f6fa87074cdf66c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2058068Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Cr-Commit-Position: refs/heads/master@{#742231}
parent f3de5b01
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <memory> #include <memory>
#include <tuple> #include <tuple>
#include "base/bits.h"
#include "base/test/simple_test_tick_clock.h" #include "base/test/simple_test_tick_clock.h"
#include "media/base/video_frame_pool.h" #include "media/base/video_frame_pool.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
...@@ -37,11 +38,11 @@ class VideoFramePoolTest ...@@ -37,11 +38,11 @@ class VideoFramePoolTest
EXPECT_EQ(base::TimeDelta::FromMilliseconds(timestamp_ms), EXPECT_EQ(base::TimeDelta::FromMilliseconds(timestamp_ms),
frame->timestamp()); frame->timestamp());
if (format == PIXEL_FORMAT_ARGB) { if (format == PIXEL_FORMAT_ARGB) {
EXPECT_EQ(coded_size.width(), frame->coded_size().width()); EXPECT_EQ(coded_size, frame->coded_size());
EXPECT_EQ(coded_size.height(), frame->coded_size().height());
} else { } else {
EXPECT_EQ((coded_size.width() + 1) & ~1, frame->coded_size().width()); const gfx::Size adjusted(base::bits::Align(coded_size.width(), 2),
EXPECT_EQ((coded_size.height() + 1) & ~1, frame->coded_size().height()); base::bits::Align(coded_size.height(), 2));
EXPECT_EQ(adjusted, frame->coded_size());
} }
EXPECT_EQ(visible_rect, frame->visible_rect()); EXPECT_EQ(visible_rect, frame->visible_rect());
EXPECT_EQ(natural_size, frame->natural_size()); EXPECT_EQ(natural_size, frame->natural_size());
......
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