Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: ash/system/toast/toast_manager_unittest.cc

Issue 2391823004: Use EXPECT_NEAR to compare float values (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/toast/toast_manager_unittest.cc
diff --git a/ash/system/toast/toast_manager_unittest.cc b/ash/system/toast/toast_manager_unittest.cc
index 04d5355a6c373dbe5905adeefb4c91cacdfbd57b..84d97d3e61d81e638d16b1f8f1983599bb5f7b7e 100644
--- a/ash/system/toast/toast_manager_unittest.cc
+++ b/ash/system/toast/toast_manager_unittest.cc
@@ -233,9 +233,9 @@ TEST_F(ToastManagerTest, PositionWithVisibleLeftShelf) {
gfx::Rect shelf_bounds = shelf->GetIdealBounds();
EXPECT_FALSE(toast_bounds.Intersects(shelf_bounds));
- EXPECT_EQ(round(shelf_bounds.right() +
- (root_bounds.width() - shelf_bounds.width()) / 2.0),
- round(precise_toast_bounds.CenterPoint().x()));
+ EXPECT_NEAR(
+ shelf_bounds.right() + (root_bounds.width() - shelf_bounds.width()) / 2.0,
+ precise_toast_bounds.CenterPoint().x(), 1.f /* accepted error */);
}
TEST_F(ToastManagerTest, PositionWithUnifiedDesktop) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698