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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 #include "ui/gfx/insets.h" | 7 #include "ui/gfx/insets.h" |
8 #include "ui/gfx/shadow_value.h" | 8 #include "ui/gfx/shadow_value.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 Insets(-4, -3, -5, -4), | 45 Insets(-4, -3, -5, -4), |
46 2, | 46 2, |
47 { | 47 { |
48 ShadowValue(gfx::Point(-1, -2), 4, 0), | 48 ShadowValue(gfx::Point(-1, -2), 4, 0), |
49 ShadowValue(gfx::Point(2, 3), 4, 0), | 49 ShadowValue(gfx::Point(2, 3), 4, 0), |
50 }, | 50 }, |
51 }, | 51 }, |
52 }; | 52 }; |
53 | 53 |
54 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) { | 54 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) { |
55 std::vector<ShadowValue> shadows( | 55 Insets margin = ShadowValue::GetMargin( |
56 &kTestCases[i].shadows[0], | 56 ShadowValues(kTestCases[i].shadows, |
57 &kTestCases[i].shadows[kTestCases[i].shadow_count]); | 57 kTestCases[i].shadows + kTestCases[i].shadow_count)); |
58 | |
59 Insets margin = ShadowValue::GetMargin(shadows); | |
60 | 58 |
61 EXPECT_EQ(kTestCases[i].expected_margin, margin) << " i=" << i; | 59 EXPECT_EQ(kTestCases[i].expected_margin, margin) << " i=" << i; |
62 } | 60 } |
63 } | 61 } |
64 | 62 |
65 } // namespace gfx | 63 } // namespace gfx |
OLD | NEW |