diff options
author | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-12 08:48:08 +0000 |
---|---|---|
committer | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-12 08:48:08 +0000 |
commit | 1b8ab39ac687e1dbb14cde751cc462288147de41 (patch) | |
tree | 0de8afc8662995bbd671c18d57b42ff6583b24ed /remoting/base | |
parent | de5763fbe4e20d3f8c917d797eae57767343ab01 (diff) | |
download | chromium_src-1b8ab39ac687e1dbb14cde751cc462288147de41.zip chromium_src-1b8ab39ac687e1dbb14cde751cc462288147de41.tar.gz chromium_src-1b8ab39ac687e1dbb14cde751cc462288147de41.tar.bz2 |
Make top and left a multiple of 2 for testing clip.
BUG=327872,306876
TEST=valgrind out/Debug/remoting_unittests --single-process-tests --gtest_filter=*Rgb*
R=sergeyu@chromium.org
Review URL: https://codereview.chromium.org/103533005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base')
-rw-r--r-- | remoting/base/util_unittest.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/remoting/base/util_unittest.cc b/remoting/base/util_unittest.cc index 1dad9aa..28fd1a7 100644 --- a/remoting/base/util_unittest.cc +++ b/remoting/base/util_unittest.cc @@ -152,12 +152,13 @@ TEST(YuvToRgbTest, Clipping) { webrtc::DesktopSize dest_size = webrtc::DesktopSize(kWidth, kHeight); webrtc::DesktopRect rect = webrtc::DesktopRect::MakeLTRB(0, 0, kWidth - 1, kHeight - 1); + // TODO(fbarchard): Allow top/left clipping to odd boundary. for (int i = 0; i < 16; ++i) { webrtc::DesktopRect dest_rect = webrtc::DesktopRect::MakeLTRB( - rect.left() + ((i & 1) ? 1 : 0), - rect.top() + ((i & 2) ? 1 : 0), - rect.right() + ((i & 4) ? 1 : 0), - rect.bottom() + ((i & 8) ? 1 : 0)); + rect.left() + ((i & 1) ? 2 : 0), + rect.top() + ((i & 2) ? 2 : 0), + rect.right() - ((i & 4) ? 1 : 0), + rect.bottom() - ((i & 8) ? 1 : 0)); tester.RunTest(dest_size, dest_rect); } @@ -169,13 +170,13 @@ TEST(YuvToRgbTest, ClippingAndScaling) { webrtc::DesktopSize dest_size = webrtc::DesktopSize(kWidth - 10, kHeight - 10); webrtc::DesktopRect rect = - webrtc::DesktopRect::MakeLTRB(5, 5, kWidth - 11, kHeight - 11); + webrtc::DesktopRect::MakeLTRB(6, 6, kWidth - 11, kHeight - 11); for (int i = 0; i < 16; ++i) { webrtc::DesktopRect dest_rect = webrtc::DesktopRect::MakeLTRB( - rect.left() + ((i & 1) ? 1 : 0), - rect.top() + ((i & 2) ? 1 : 0), - rect.right() + ((i & 4) ? 1 : 0), - rect.bottom() + ((i & 8) ? 1 : 0)); + rect.left() + ((i & 1) ? 2 : 0), + rect.top() + ((i & 2) ? 2 : 0), + rect.right() - ((i & 4) ? 1 : 0), + rect.bottom() - ((i & 8) ? 1 : 0)); tester.RunTest(dest_size, dest_rect); } |