OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef CC_TEST_GEOMETRY_TEST_UTILS_H_ | 5 #ifndef CC_TEST_GEOMETRY_TEST_UTILS_H_ |
6 #define CC_TEST_GEOMETRY_TEST_UTILS_H_ | 6 #define CC_TEST_GEOMETRY_TEST_UTILS_H_ |
7 | 7 |
| 8 namespace gfx { |
| 9 class Transform; |
| 10 } |
| 11 |
8 namespace WebKit { | 12 namespace WebKit { |
9 class WebTransformationMatrix; | 13 class WebTransformationMatrix; |
10 } | 14 } |
11 | 15 |
12 namespace WebKitTests { | 16 namespace WebKitTests { |
13 | 17 |
14 // These are macros instead of functions so that we get useful line numbers wher
e a test failed. | 18 // These are macros instead of functions so that we get useful line numbers wher
e a test failed. |
15 #define EXPECT_FLOAT_RECT_EQ(expected, actual) \ | 19 #define EXPECT_FLOAT_RECT_EQ(expected, actual) \ |
16 do { \ | 20 do { \ |
17 EXPECT_FLOAT_EQ((expected).x(), (actual).x()); \ | 21 EXPECT_FLOAT_EQ((expected).x(), (actual).x()); \ |
(...skipping 25 matching lines...) Expand all Loading... |
43 #define EXPECT_VECTOR_EQ(expected, actual) \ | 47 #define EXPECT_VECTOR_EQ(expected, actual) \ |
44 do { \ | 48 do { \ |
45 EXPECT_EQ((expected).x(), (actual).x()); \ | 49 EXPECT_EQ((expected).x(), (actual).x()); \ |
46 EXPECT_EQ((expected).y(), (actual).y()); \ | 50 EXPECT_EQ((expected).y(), (actual).y()); \ |
47 } while (false) | 51 } while (false) |
48 | 52 |
49 // This is a function rather than a macro because when this is included as a mac
ro | 53 // This is a function rather than a macro because when this is included as a mac
ro |
50 // in bulk, it causes a significant slow-down in compilation time. This problem | 54 // in bulk, it causes a significant slow-down in compilation time. This problem |
51 // exists with both gcc and clang, and bugs have been filed at | 55 // exists with both gcc and clang, and bugs have been filed at |
52 // http://llvm.org/bugs/show_bug.cgi?id=13651 and http://gcc.gnu.org/bugzilla/sh
ow_bug.cgi?id=54337 | 56 // http://llvm.org/bugs/show_bug.cgi?id=13651 and http://gcc.gnu.org/bugzilla/sh
ow_bug.cgi?id=54337 |
| 57 void ExpectTransformationMatrixEq(const gfx::Transform& expected, |
| 58 const gfx::Transform& actual); |
| 59 |
53 void ExpectTransformationMatrixEq(const WebKit::WebTransformationMatrix& expecte
d, | 60 void ExpectTransformationMatrixEq(const WebKit::WebTransformationMatrix& expecte
d, |
54 const WebKit::WebTransformationMatrix& actual)
; | 61 const WebKit::WebTransformationMatrix& actual)
; |
55 | 62 |
56 #define EXPECT_TRANSFORMATION_MATRIX_EQ(expected, actual) \ | 63 #define EXPECT_TRANSFORMATION_MATRIX_EQ(expected, actual) \ |
57 { \ | 64 { \ |
58 SCOPED_TRACE(""); \ | 65 SCOPED_TRACE(""); \ |
59 WebKitTests::ExpectTransformationMatrixEq(expected, actual); \ | 66 WebKitTests::ExpectTransformationMatrixEq(expected, actual); \ |
60 } | 67 } |
61 | 68 |
62 } // namespace WebKitTests | 69 } // namespace WebKitTests |
63 | 70 |
64 #endif // CC_TEST_GEOMETRY_TEST_UTILS_H_ | 71 #endif // CC_TEST_GEOMETRY_TEST_UTILS_H_ |
OLD | NEW |