Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "platform/transforms/AffineTransform.h" | |
| 6 | |
| 7 #include "testing/gtest/include/gtest/gtest.h" | |
| 8 #include "wtf/text/WTFString.h" | |
| 9 | |
| 10 namespace blink { | |
| 11 | |
| 12 TEST(AffineTransformTest, ToString) | |
| 13 { | |
| 14 AffineTransform identity; | |
| 15 EXPECT_EQ(String("identity"), identity.toString()); | |
|
jbroman
2016/08/21 16:21:07
nit: You shouldn't need the String() wrapper on th
pdr.
2016/08/22 17:27:35
Done. I should remove these from the other tests i
| |
| 16 EXPECT_EQ(String("[1,0,0,\n0,1,0]"), identity.toString(true)); | |
| 17 | |
| 18 AffineTransform translation = AffineTransform::translation(7, 9); | |
| 19 EXPECT_EQ(String("translation(7,9)"), translation.toString()); | |
| 20 EXPECT_EQ(String("[1,0,7,\n0,1,9]"), translation.toString(true)); | |
| 21 | |
| 22 AffineTransform rotation; | |
| 23 rotation.rotate(180); | |
| 24 EXPECT_EQ(String("translation(0,0), scale(1,1), angle(3.14159rad), remainder (1,0,0,1)"), rotation.toString()); | |
| 25 EXPECT_EQ(String("[-1,-1.22465e-16,0,\n1.22465e-16,-1,0]"), rotation.toStrin g(true)); | |
| 26 | |
| 27 AffineTransform columnMajorConstructor(1, 4, 2, 5, 3, 6); | |
| 28 EXPECT_EQ(String("[1,2,3,\n4,5,6]"), columnMajorConstructor.toString(true)); | |
| 29 } | |
| 30 | |
| 31 } // namespace blink | |
| OLD | NEW |