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

Side by Side Diff: ui/gfx/test/gfx_util.cc

Issue 2966723003: Add support for bounds animations (Closed)
Patch Set: address reviewer feedback Created 3 years, 5 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/test/gfx_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/test/gfx_util.h" 5 #include "ui/gfx/test/gfx_util.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 #include <sstream> 8 #include <sstream>
9 #include <string> 9 #include <string>
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 SkColor rhs) { 113 SkColor rhs) {
114 if (lhs == rhs) { 114 if (lhs == rhs) {
115 return ::testing::AssertionSuccess(); 115 return ::testing::AssertionSuccess();
116 } 116 }
117 return ::testing::AssertionFailure() << "Value of: " << rhs_expr 117 return ::testing::AssertionFailure() << "Value of: " << rhs_expr
118 << "\n Actual: " << ColorAsString(rhs) 118 << "\n Actual: " << ColorAsString(rhs)
119 << "\nExpected: " << lhs_expr 119 << "\nExpected: " << lhs_expr
120 << "\nWhich is: " << ColorAsString(lhs); 120 << "\nWhich is: " << ColorAsString(lhs);
121 } 121 }
122 122
123 ::testing::AssertionResult AssertSizeFFloatEqual(const char* lhs_expr,
124 const char* rhs_expr,
125 const SizeF& lhs,
126 const SizeF& rhs) {
127 if (FloatAlmostEqual(lhs.width(), rhs.width()) &&
128 FloatAlmostEqual(lhs.height(), rhs.height())) {
129 return ::testing::AssertionSuccess();
130 }
131 return ::testing::AssertionFailure()
132 << "Value of: " << rhs_expr << "\n Actual: " << rhs.ToString()
133 << "\nExpected: " << lhs_expr << "\nWhich is: " << lhs.ToString();
134 }
135
123 void PrintTo(const AxisTransform2d& transform, ::std::ostream* os) { 136 void PrintTo(const AxisTransform2d& transform, ::std::ostream* os) {
124 *os << transform.ToString(); 137 *os << transform.ToString();
125 } 138 }
126 139
127 void PrintTo(const BoxF& box, ::std::ostream* os) { 140 void PrintTo(const BoxF& box, ::std::ostream* os) {
128 *os << box.ToString(); 141 *os << box.ToString();
129 } 142 }
130 143
131 void PrintTo(const Point& point, ::std::ostream* os) { 144 void PrintTo(const Point& point, ::std::ostream* os) {
132 *os << point.ToString(); 145 *os << point.ToString();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 187
175 void PrintTo(const Vector2dF& vector, ::std::ostream* os) { 188 void PrintTo(const Vector2dF& vector, ::std::ostream* os) {
176 *os << vector.ToString(); 189 *os << vector.ToString();
177 } 190 }
178 191
179 void PrintTo(const Vector3dF& vector, ::std::ostream* os) { 192 void PrintTo(const Vector3dF& vector, ::std::ostream* os) {
180 *os << vector.ToString(); 193 *os << vector.ToString();
181 } 194 }
182 195
183 } // namespace gfx 196 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/test/gfx_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698