Commit 2514eb9b authored by tedchoc's avatar tedchoc Committed by Commit bot

Fix splash screen tests by adding rounding slop.

BUG=529543

Review URL: https://codereview.chromium.org/1310663007

Cr-Commit-Position: refs/heads/master@{#347869}
parent 02d87791
......@@ -558,7 +558,11 @@ public class AppBannerManagerTest extends ChromeTabbedActivityTestBase {
// Test that bitmap sizes match expectations.
int idealSize = getActivity().getResources().getDimensionPixelSize(
R.dimen.webapp_splash_image_size);
assertEquals(idealSize, dataStorageFactory.mSplashImage.getWidth());
assertEquals(idealSize, dataStorageFactory.mSplashImage.getHeight());
assertTrue("Expected width: " + idealSize + ", Actual: "
+ dataStorageFactory.mSplashImage.getWidth(),
Math.abs(idealSize - dataStorageFactory.mSplashImage.getWidth()) <= 1);
assertTrue("Expected height: " + idealSize + ", Actual: "
+ dataStorageFactory.mSplashImage.getHeight(),
Math.abs(idealSize - dataStorageFactory.mSplashImage.getHeight()) <= 1);
}
}
......@@ -212,8 +212,12 @@ public class AddToHomescreenDialogHelperTest extends ChromeActivityTestCaseBase<
// Test that bitmap sizes match expectations.
int idealSize = mActivity.getResources().getDimensionPixelSize(
R.dimen.webapp_splash_image_size);
assertEquals(idealSize, dataStorageFactory.mSplashImage.getWidth());
assertEquals(idealSize, dataStorageFactory.mSplashImage.getHeight());
assertTrue("Expected width: " + idealSize + ", Actual: "
+ dataStorageFactory.mSplashImage.getWidth(),
Math.abs(idealSize - dataStorageFactory.mSplashImage.getWidth()) <= 1);
assertTrue("Expected height: " + idealSize + ", Actual: "
+ dataStorageFactory.mSplashImage.getHeight(),
Math.abs(idealSize - dataStorageFactory.mSplashImage.getHeight()) <= 1);
}
private void addShortcutToURL(String url, final String expectedPageTitle, final String title)
......
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