OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/tile_priority.h" | 5 #include "cc/tile_priority.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
| 10 namespace { |
10 | 11 |
11 TEST(TilePriorityTest, TimeForBoundsToIntersectWithScroll) { | 12 TEST(TilePriorityTest, TimeForBoundsToIntersectWithScroll) { |
12 gfx::Rect target(0, 0, 800, 600); | 13 gfx::Rect target(0, 0, 800, 600); |
13 gfx::Rect current(100, 100, 100, 100); | 14 gfx::Rect current(100, 100, 100, 100); |
14 EXPECT_EQ(0, TilePriority::TimeForBoundsToIntersect( | 15 EXPECT_EQ(0, TilePriority::TimeForBoundsToIntersect( |
15 gfx::Rect(-200, 0, 100, 100), current, 1, target)); | 16 gfx::Rect(-200, 0, 100, 100), current, 1, target)); |
16 EXPECT_EQ(0, TilePriority::TimeForBoundsToIntersect( | 17 EXPECT_EQ(0, TilePriority::TimeForBoundsToIntersect( |
17 gfx::Rect(-100, 0, 100, 100), current, 1, target)); | 18 gfx::Rect(-100, 0, 100, 100), current, 1, target)); |
18 EXPECT_EQ(0, TilePriority::TimeForBoundsToIntersect( | 19 EXPECT_EQ(0, TilePriority::TimeForBoundsToIntersect( |
19 gfx::Rect(400, 400, 100, 100), current, 1, target)); | 20 gfx::Rect(400, 400, 100, 100), current, 1, target)); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 EXPECT_EQ(2, TilePriority::manhattanDistance( | 54 EXPECT_EQ(2, TilePriority::manhattanDistance( |
54 gfx::Rect(0, 0, 400, 400), gfx::Rect(-100, -100, 100, 100))); | 55 gfx::Rect(0, 0, 400, 400), gfx::Rect(-100, -100, 100, 100))); |
55 | 56 |
56 EXPECT_EQ(1, TilePriority::manhattanDistance( | 57 EXPECT_EQ(1, TilePriority::manhattanDistance( |
57 gfx::Rect(0, 0, 400, 400), gfx::Rect(0, -100, 100, 100))); | 58 gfx::Rect(0, 0, 400, 400), gfx::Rect(0, -100, 100, 100))); |
58 | 59 |
59 EXPECT_EQ(202, TilePriority::manhattanDistance( | 60 EXPECT_EQ(202, TilePriority::manhattanDistance( |
60 gfx::Rect(0, 0, 100, 100), gfx::Rect(200, 200, 100, 100))); | 61 gfx::Rect(0, 0, 100, 100), gfx::Rect(200, 200, 100, 100))); |
61 } | 62 } |
62 | 63 |
| 64 } // namespace |
63 } // namespace cc | 65 } // namespace cc |
OLD | NEW |