| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ui/base/cocoa/three_part_image.h" | 5 #include "ui/base/cocoa/three_part_image.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "testing/gtest_mac.h" | 9 #include "testing/gtest_mac.h" |
| 10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
| 11 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
| 12 #include "third_party/skia/include/core/SkRect.h" | 12 #include "third_party/skia/include/core/SkRect.h" |
| 13 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
| 14 #include "ui/gfx/image/image.h" | 14 #include "ui/gfx/image/image.h" |
| 15 #include "ui/gfx/image/image_unittest_util.h" | 15 #include "ui/gfx/image/image_unittest_util.h" |
| 16 #import "ui/gfx/test/ui_cocoa_test_helper.h" | 16 #import "ui/gfx/test/ui_cocoa_test_helper.h" |
| 17 #include "ui/resources/grit/ui_resources.h" | |
| 18 | 17 |
| 19 namespace ui { | 18 namespace ui { |
| 20 namespace test { | 19 namespace test { |
| 21 | 20 |
| 22 TEST(ThreePartImageTest, GetRects) { | 21 TEST(ThreePartImageTest, GetRects) { |
| 23 const int kHeight = 11; | 22 const int kHeight = 11; |
| 24 const int kLeftWidth = 3; | 23 const int kLeftWidth = 3; |
| 25 const int kMiddleWidth = 5; | 24 const int kMiddleWidth = 5; |
| 26 const int kRightWidth = 7; | 25 const int kRightWidth = 7; |
| 27 base::scoped_nsobject<NSImage> leftImage( | 26 base::scoped_nsobject<NSImage> leftImage( |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 75 |
| 77 // The corners are transparent. | 76 // The corners are transparent. |
| 78 EXPECT_FALSE(image.HitTest(NSMakePoint(0, 0), bounds)); | 77 EXPECT_FALSE(image.HitTest(NSMakePoint(0, 0), bounds)); |
| 79 EXPECT_FALSE(image.HitTest(NSMakePoint(0, size - 1), bounds)); | 78 EXPECT_FALSE(image.HitTest(NSMakePoint(0, size - 1), bounds)); |
| 80 EXPECT_FALSE(image.HitTest(NSMakePoint(4 * size - 1, 0), bounds)); | 79 EXPECT_FALSE(image.HitTest(NSMakePoint(4 * size - 1, 0), bounds)); |
| 81 EXPECT_FALSE(image.HitTest(NSMakePoint(4 * size - 1, size - 1), bounds)); | 80 EXPECT_FALSE(image.HitTest(NSMakePoint(4 * size - 1, size - 1), bounds)); |
| 82 } | 81 } |
| 83 | 82 |
| 84 } // namespace test | 83 } // namespace test |
| 85 } // namespace ui | 84 } // namespace ui |
| OLD | NEW |