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/picture_layer_tiling_set.h" | 5 #include "cc/picture_layer_tiling_set.h" |
6 | 6 |
7 #include "cc/test/fake_picture_layer_tiling_client.h" | 7 #include "cc/test/fake_picture_layer_tiling_client.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "ui/gfx/size_conversions.h" | 9 #include "ui/gfx/size_conversions.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
| 12 namespace { |
12 | 13 |
13 TEST(PictureLayerTilingSetTest, NoResources) { | 14 TEST(PictureLayerTilingSetTest, NoResources) { |
14 FakePictureLayerTilingClient client; | 15 FakePictureLayerTilingClient client; |
15 PictureLayerTilingSet set(&client); | 16 PictureLayerTilingSet set(&client); |
16 gfx::Size default_tile_size(256, 256); | 17 gfx::Size default_tile_size(256, 256); |
17 | 18 |
18 gfx::Size layer_bounds(1000, 800); | 19 gfx::Size layer_bounds(1000, 800); |
19 set.SetLayerBounds(layer_bounds); | 20 set.SetLayerBounds(layer_bounds); |
20 | 21 |
21 set.AddTiling(1.0, default_tile_size); | 22 set.AddTiling(1.0, default_tile_size); |
(...skipping 12 matching lines...) Expand all Loading... |
34 EXPECT_TRUE(content_rect.Contains(geometry_rect)); | 35 EXPECT_TRUE(content_rect.Contains(geometry_rect)); |
35 ASSERT_TRUE(remaining.Contains(geometry_rect)); | 36 ASSERT_TRUE(remaining.Contains(geometry_rect)); |
36 remaining.Subtract(geometry_rect); | 37 remaining.Subtract(geometry_rect); |
37 | 38 |
38 // No tiles have resources, so no iter represents a real tile. | 39 // No tiles have resources, so no iter represents a real tile. |
39 EXPECT_FALSE(*iter); | 40 EXPECT_FALSE(*iter); |
40 } | 41 } |
41 EXPECT_TRUE(remaining.IsEmpty()); | 42 EXPECT_TRUE(remaining.IsEmpty()); |
42 } | 43 } |
43 | 44 |
| 45 } // namespace |
44 } // namespace cc | 46 } // namespace cc |
OLD | NEW |