OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ash/test/ash_test_base.h" | 5 #include "ash/test/ash_test_base.h" |
6 #include "ash/wm/image_grid.h" | 6 #include "ash/wm/image_grid.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
9 #include "ui/gfx/image/image.h" | 9 #include "ui/gfx/image/image.h" |
10 | 10 |
11 using ash::internal::ImageGrid; | 11 using ash::internal::ImageGrid; |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 namespace test { | 14 namespace test { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 // Creates a gfx::Image with the requested dimensions. | 18 // Creates a gfx::Image with the requested dimensions. |
19 gfx::Image* CreateImage(const gfx::Size& size) { | 19 gfx::Image* CreateImage(const gfx::Size& size) { |
20 SkBitmap* bitmap = new SkBitmap(); | 20 SkBitmap bitmap; |
21 bitmap->setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height()); | 21 bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height()); |
22 return new gfx::Image(bitmap); | 22 return new gfx::Image(bitmap); |
23 } | 23 } |
24 | 24 |
25 } // namespace | 25 } // namespace |
26 | 26 |
27 typedef ash::test::AshTestBase ImageGridTest; | 27 typedef ash::test::AshTestBase ImageGridTest; |
28 | 28 |
29 // Test that an ImageGrid's layers are transformed correctly when SetSize() is | 29 // Test that an ImageGrid's layers are transformed correctly when SetSize() is |
30 // called. | 30 // called. |
31 TEST_F(ImageGridTest, Basic) { | 31 TEST_F(ImageGridTest, Basic) { |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 333 |
334 // We shouldn't be clipping the corner images anymore. | 334 // We shouldn't be clipping the corner images anymore. |
335 EXPECT_TRUE(test_api.top_left_clip_rect().IsEmpty()); | 335 EXPECT_TRUE(test_api.top_left_clip_rect().IsEmpty()); |
336 EXPECT_TRUE(test_api.top_right_clip_rect().IsEmpty()); | 336 EXPECT_TRUE(test_api.top_right_clip_rect().IsEmpty()); |
337 EXPECT_TRUE(test_api.bottom_left_clip_rect().IsEmpty()); | 337 EXPECT_TRUE(test_api.bottom_left_clip_rect().IsEmpty()); |
338 EXPECT_TRUE(test_api.bottom_right_clip_rect().IsEmpty()); | 338 EXPECT_TRUE(test_api.bottom_right_clip_rect().IsEmpty()); |
339 } | 339 } |
340 | 340 |
341 } // namespace test | 341 } // namespace test |
342 } // namespace ash | 342 } // namespace ash |
OLD | NEW |