Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: ui/gfx/transform_util_unittest.cc

Issue 11087093: Migrate ui::Transform to gfx::Transform (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Should pass trybots this time Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/transform_util.cc ('k') | ui/views/view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/gfx/transform_util.h" 5 #include "ui/gfx/transform_util.h"
6 6
7 #include "ui/gfx/point.h" 7 #include "ui/gfx/point.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 TEST(TransformUtilTest, GetScaleTransform) { 10 TEST(TransformUtilTest, GetScaleTransform) {
11 const gfx::Point kAnchor(20, 40); 11 const gfx::Point kAnchor(20, 40);
12 const float kScale = 0.5f; 12 const float kScale = 0.5f;
13 13
14 ui::Transform scale = ui::GetScaleTransform(kAnchor, kScale); 14 gfx::Transform scale = gfx::GetScaleTransform(kAnchor, kScale);
15 15
16 const int kOffset = 10; 16 const int kOffset = 10;
17 for (int sign_x = -1; sign_x <= 1; ++sign_x) { 17 for (int sign_x = -1; sign_x <= 1; ++sign_x) {
18 for (int sign_y = -1; sign_y <= 1; ++sign_y) { 18 for (int sign_y = -1; sign_y <= 1; ++sign_y) {
19 gfx::Point test(kAnchor.x() + sign_x * kOffset, 19 gfx::Point test(kAnchor.x() + sign_x * kOffset,
20 kAnchor.y() + sign_y * kOffset); 20 kAnchor.y() + sign_y * kOffset);
21 scale.TransformPoint(test); 21 scale.TransformPoint(test);
22 22
23 EXPECT_EQ(gfx::Point(kAnchor.x() + sign_x * kOffset * kScale, 23 EXPECT_EQ(gfx::Point(kAnchor.x() + sign_x * kOffset * kScale,
24 kAnchor.y() + sign_y * kOffset * kScale), 24 kAnchor.y() + sign_y * kOffset * kScale),
25 test); 25 test);
26 } 26 }
27 } 27 }
28 } 28 }
OLDNEW
« no previous file with comments | « ui/gfx/transform_util.cc ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698