OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/memory/scoped_vector.h" | 5 #include "base/memory/scoped_vector.h" |
6 #include "cc/test/geometry_test_utils.h" | 6 #include "cc/test/geometry_test_utils.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformOperati
ons.h" | 8 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformOperati
ons.h" |
9 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformationMa
trix.h" | 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformationMa
trix.h" |
10 | 10 |
11 using namespace WebKit; | 11 using namespace WebKit; |
12 | 12 |
| 13 #ifndef WEB_TRANSFORM_OPERATIONS_IS_VIRTUAL |
| 14 |
13 TEST(WebTransformOperationTest, transformTypesAreUnique) | 15 TEST(WebTransformOperationTest, transformTypesAreUnique) |
14 { | 16 { |
15 ScopedVector<WebTransformOperations> transforms; | 17 ScopedVector<WebTransformOperations> transforms; |
16 | 18 |
17 WebTransformOperations* toAdd = new WebTransformOperations(); | 19 WebTransformOperations* toAdd = new WebTransformOperations(); |
18 toAdd->appendTranslate(1, 0, 0); | 20 toAdd->appendTranslate(1, 0, 0); |
19 transforms.push_back(toAdd); | 21 transforms.push_back(toAdd); |
20 | 22 |
21 toAdd = new WebTransformOperations(); | 23 toAdd = new WebTransformOperations(); |
22 toAdd->appendRotate(0, 0, 1, 2); | 24 toAdd->appendRotate(0, 0, 1, 2); |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 operations.appendPerspective(1000); | 603 operations.appendPerspective(1000); |
602 | 604 |
603 double progress = 0.5; | 605 double progress = 0.5; |
604 | 606 |
605 WebTransformationMatrix expected; | 607 WebTransformationMatrix expected; |
606 expected.applyPerspective(500 + 0.5 * std::numeric_limits<double>::max()
); | 608 expected.applyPerspective(500 + 0.5 * std::numeric_limits<double>::max()
); |
607 | 609 |
608 EXPECT_TRANSFORMATION_MATRIX_EQ(expected, identityOperations[i]->blend(o
perations, progress)); | 610 EXPECT_TRANSFORMATION_MATRIX_EQ(expected, identityOperations[i]->blend(o
perations, progress)); |
609 } | 611 } |
610 } | 612 } |
| 613 |
| 614 #endif |
OLD | NEW |