| 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 CCLayerTreeTestCommon_h | 5 #ifndef CCGeometryTestUtils_h |
| 6 #define CCLayerTreeTestCommon_h | 6 #define CCGeometryTestUtils_h |
| 7 | 7 |
| 8 #include <public/WebTransformationMatrix.h> | 8 namespace WebKit { |
| 9 class WebTransformationMatrix; |
| 10 } |
| 9 | 11 |
| 10 namespace WebKitTests { | 12 namespace WebKitTests { |
| 11 | 13 |
| 12 // These are macros instead of functions so that we get useful line numbers wher
e a test failed. | 14 // These are macros instead of functions so that we get useful line numbers wher
e a test failed. |
| 13 #define EXPECT_FLOAT_RECT_EQ(expected, actual) \ | 15 #define EXPECT_FLOAT_RECT_EQ(expected, actual) \ |
| 14 EXPECT_FLOAT_EQ((expected).location().x(), (actual).location().x()); \ | 16 EXPECT_FLOAT_EQ((expected).location().x(), (actual).location().x()); \ |
| 15 EXPECT_FLOAT_EQ((expected).location().y(), (actual).location().y()); \ | 17 EXPECT_FLOAT_EQ((expected).location().y(), (actual).location().y()); \ |
| 16 EXPECT_FLOAT_EQ((expected).size().width(), (actual).size().width()); \ | 18 EXPECT_FLOAT_EQ((expected).size().width(), (actual).size().width()); \ |
| 17 EXPECT_FLOAT_EQ((expected).size().height(), (actual).size().height()) | 19 EXPECT_FLOAT_EQ((expected).size().height(), (actual).size().height()) |
| 18 | 20 |
| 19 #define EXPECT_INT_RECT_EQ(expected, actual) \ | 21 #define EXPECT_RECT_EQ(expected, actual) \ |
| 20 EXPECT_EQ((expected).location().x(), (actual).location().x()); \ | 22 EXPECT_EQ((expected).location().x(), (actual).location().x()); \ |
| 21 EXPECT_EQ((expected).location().y(), (actual).location().y()); \ | 23 EXPECT_EQ((expected).location().y(), (actual).location().y()); \ |
| 22 EXPECT_EQ((expected).size().width(), (actual).size().width()); \ | 24 EXPECT_EQ((expected).size().width(), (actual).size().width()); \ |
| 23 EXPECT_EQ((expected).size().height(), (actual).size().height()) | 25 EXPECT_EQ((expected).size().height(), (actual).size().height()) |
| 24 | 26 |
| 25 // This is a function rather than a macro because when this is included as a mac
ro | 27 // This is a function rather than a macro because when this is included as a mac
ro |
| 26 // in bulk, it causes a significant slow-down in compilation time. This problem | 28 // in bulk, it causes a significant slow-down in compilation time. This problem |
| 27 // exists with both gcc and clang, and bugs have been filed at | 29 // exists with both gcc and clang, and bugs have been filed at |
| 28 // http://llvm.org/bugs/show_bug.cgi?id=13651 and http://gcc.gnu.org/bugzilla/sh
ow_bug.cgi?id=54337 | 30 // http://llvm.org/bugs/show_bug.cgi?id=13651 and http://gcc.gnu.org/bugzilla/sh
ow_bug.cgi?id=54337 |
| 29 void ExpectTransformationMatrixEq(WebKit::WebTransformationMatrix expected, | 31 void ExpectTransformationMatrixEq(const WebKit::WebTransformationMatrix& expecte
d, |
| 30 WebKit::WebTransformationMatrix actual); | 32 const WebKit::WebTransformationMatrix& actual)
; |
| 31 | 33 |
| 32 #define EXPECT_TRANSFORMATION_MATRIX_EQ(expected, actual) \ | 34 #define EXPECT_TRANSFORMATION_MATRIX_EQ(expected, actual) \ |
| 33 { \ | 35 { \ |
| 34 SCOPED_TRACE(""); \ | 36 SCOPED_TRACE(""); \ |
| 35 WebKitTests::ExpectTransformationMatrixEq(expected, actual); \ | 37 WebKitTests::ExpectTransformationMatrixEq(expected, actual); \ |
| 36 } | 38 } |
| 37 | 39 |
| 38 } // namespace | 40 } // namespace WebKitTests |
| 39 | 41 |
| 40 #endif // CCLayerTreeTestCommon_h | 42 #endif // CCGeometryTestUtils_h |
| OLD | NEW |