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

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

Issue 9677065: ash: Update app list UI to match latest crwm. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/transform_util.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/gfx/transform_util.h"
6
7 #include "ui/gfx/point.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 TEST(TransformUtilTest, GetScaleTransform) {
11 const gfx::Point kAnchor(20, 40);
12 const float kScale = 0.5f;
13
14 ui::Transform scale = ui::GetScaleTransform(kAnchor, kScale);
15
16 const int kOffset = 10;
17 for (int sign_x = -1; sign_x <= 1; ++sign_x) {
18 for (int sign_y = -1; sign_y <= 1; ++sign_y) {
19 gfx::Point test(kAnchor.x() + sign_x * kOffset,
20 kAnchor.y() + sign_y * kOffset);
21 scale.TransformPoint(test);
22
23 EXPECT_EQ(gfx::Point(kAnchor.x() + sign_x * kOffset * kScale,
24 kAnchor.y() + sign_y * kOffset * kScale),
25 test);
26 }
27 }
28 }
OLDNEW
« no previous file with comments | « ui/gfx/transform_util.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698