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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/transform_util.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/transform_util_unittest.cc
diff --git a/ui/gfx/transform_util_unittest.cc b/ui/gfx/transform_util_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..06ef062efa402ab39636f5d798487fc0031a66f8
--- /dev/null
+++ b/ui/gfx/transform_util_unittest.cc
@@ -0,0 +1,28 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gfx/transform_util.h"
+
+#include "ui/gfx/point.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(TransformUtilTest, GetScaleTransform) {
+ const gfx::Point kAnchor(20, 40);
+ const float kScale = 0.5f;
+
+ ui::Transform scale = ui::GetScaleTransform(kAnchor, kScale);
+
+ const int kOffset = 10;
+ for (int sign_x = -1; sign_x <= 1; ++sign_x) {
+ for (int sign_y = -1; sign_y <= 1; ++sign_y) {
+ gfx::Point test(kAnchor.x() + sign_x * kOffset,
+ kAnchor.y() + sign_y * kOffset);
+ scale.TransformPoint(test);
+
+ EXPECT_EQ(gfx::Point(kAnchor.x() + sign_x * kOffset * kScale,
+ kAnchor.y() + sign_y * kOffset * kScale),
+ test);
+ }
+ }
+}
« 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