summaryrefslogtreecommitdiffstats
path: root/cc/tile_priority_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/tile_priority_unittest.cc')
-rw-r--r--cc/tile_priority_unittest.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/cc/tile_priority_unittest.cc b/cc/tile_priority_unittest.cc
index bcca044..5eea2b4 100644
--- a/cc/tile_priority_unittest.cc
+++ b/cc/tile_priority_unittest.cc
@@ -10,6 +10,7 @@ namespace cc {
namespace {
TEST(TilePriorityTest, TimeForBoundsToIntersectWithScroll) {
+ const float inf = std::numeric_limits<float>::infinity();
gfx::Rect target(0, 0, 800, 600);
gfx::Rect current(100, 100, 100, 100);
EXPECT_EQ(0, TilePriority::TimeForBoundsToIntersect(
@@ -20,15 +21,16 @@ TEST(TilePriorityTest, TimeForBoundsToIntersectWithScroll) {
gfx::Rect(400, 400, 100, 100), current, 1, target));
current = gfx::Rect(-300, -300, 100, 100);
- EXPECT_EQ(1000, TilePriority::TimeForBoundsToIntersect(
+ EXPECT_EQ(inf, TilePriority::TimeForBoundsToIntersect(
gfx::Rect(0, 0, 100, 100), current, 1, target));
- EXPECT_EQ(1000, TilePriority::TimeForBoundsToIntersect(
+ EXPECT_EQ(inf, TilePriority::TimeForBoundsToIntersect(
gfx::Rect(-200, -200, 100, 100), current, 1, target));
EXPECT_EQ(2, TilePriority::TimeForBoundsToIntersect(
gfx::Rect(-400, -400, 100, 100), current, 1, target));
}
TEST(TilePriorityTest, TimeForBoundsToIntersectWithScale) {
+ const float inf = std::numeric_limits<float>::infinity();
gfx::Rect target(0, 0, 800, 600);
gfx::Rect current(100, 100, 100, 100);
EXPECT_EQ(0, TilePriority::TimeForBoundsToIntersect(
@@ -39,7 +41,7 @@ TEST(TilePriorityTest, TimeForBoundsToIntersectWithScale) {
gfx::Rect(400, 400, 400, 400), current, 1, target));
current = gfx::Rect(-300, -300, 100, 100);
- EXPECT_EQ(1000, TilePriority::TimeForBoundsToIntersect(
+ EXPECT_EQ(inf, TilePriority::TimeForBoundsToIntersect(
gfx::Rect(-400, -400, 300, 300), current, 1, target));
EXPECT_EQ(8, TilePriority::TimeForBoundsToIntersect(
gfx::Rect(-275, -275, 50, 50), current, 1, target));