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

Unified Diff: ui/gfx/transform_util_unittest.cc

Issue 694743002: Fix folder icon animation in app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@launcher_page_api_do_actual_thing
Patch Set: Created 6 years, 1 month 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
« ui/gfx/transform_util.cc ('K') | « ui/gfx/transform_util.cc ('k') | no next file » | 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
index 41bfc40783a805caa8ce78fc0cd36b29c034b7b1..06a3fcb2b59a5e5c0dc865b8651bfbb9d68e15fe 100644
--- a/ui/gfx/transform_util_unittest.cc
+++ b/ui/gfx/transform_util_unittest.cc
@@ -4,6 +4,7 @@
#include "ui/gfx/transform_util.h"
+#include "base/logging.h"
Matt Giuca 2014/11/04 01:05:18 Don't think you need this.
calamity 2014/11/04 01:40:30 Done.
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/point.h"
#include "ui/gfx/point3_f.h"
@@ -32,6 +33,24 @@ TEST(TransformUtilTest, GetScaleTransform) {
}
}
+TEST(TransformUtilTest, GetRectTransform) {
Matt Giuca 2014/11/04 01:05:18 Good test.
+ gfx::Rect from(20, 40, 40, 40);
+ gfx::Rect to(-10, 20, 80, 20);
+
+ Transform transform = GetRectTransform(from, to);
+
+ std::vector<std::pair<gfx::Point, gfx::Point> > test_data;
+ test_data.push_back(std::make_pair(from.origin(), to.origin()));
+ test_data.push_back(std::make_pair(from.bottom_right(), to.bottom_right()));
+ test_data.push_back(std::make_pair(from.CenterPoint(), to.CenterPoint()));
+
+ for (const auto& data : test_data) {
+ Point test = data.first;
+ transform.TransformPoint(&test);
+ EXPECT_EQ(data.second, test);
+ }
+}
+
TEST(TransformUtilTest, SnapRotation) {
Transform result(Transform::kSkipInitialization);
Transform transform;
« ui/gfx/transform_util.cc ('K') | « ui/gfx/transform_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698