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

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

Issue 11377068: ui: Make gfx::Size::Scale() mutate the class. Add gfx::ScaleSize() similar to Rect/Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
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/size_base.h" 5 #include "ui/gfx/size_base.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/gfx/size.h" 8 #include "ui/gfx/size.h"
9 #include "ui/gfx/size_conversions.h" 9 #include "ui/gfx/size_conversions.h"
10 #include "ui/gfx/size_f.h" 10 #include "ui/gfx/size_f.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 TEST(SizeTest, ClampToZero) { 94 TEST(SizeTest, ClampToZero) {
95 EXPECT_EQ(Size().ToString(), Size(-1, -1).ToString()); 95 EXPECT_EQ(Size().ToString(), Size(-1, -1).ToString());
96 EXPECT_EQ(Size().ToString(), Size(0, -1).ToString()); 96 EXPECT_EQ(Size().ToString(), Size(0, -1).ToString());
97 EXPECT_EQ(Size().ToString(), Size(-1, 0).ToString()); 97 EXPECT_EQ(Size().ToString(), Size(-1, 0).ToString());
98 98
99 EXPECT_EQ(SizeF().ToString(), SizeF(-1, -1).ToString()); 99 EXPECT_EQ(SizeF().ToString(), SizeF(-1, -1).ToString());
100 EXPECT_EQ(SizeF().ToString(), SizeF(0, -1).ToString()); 100 EXPECT_EQ(SizeF().ToString(), SizeF(0, -1).ToString());
101 EXPECT_EQ(SizeF().ToString(), SizeF(-1, 0).ToString()); 101 EXPECT_EQ(SizeF().ToString(), SizeF(-1, 0).ToString());
102 102
103 EXPECT_EQ(SizeF().ToString(), SizeF(1, 1).Scale(-1).ToString()); 103 EXPECT_EQ(SizeF().ToString(), ScaleSize(Size(1, 1), -1).ToString());
104 } 104 }
105 105
106 } // namespace gfx 106 } // namespace gfx
OLDNEW
« ui/gfx/size_f.h ('K') | « ui/gfx/size_f.cc ('k') | webkit/glue/webcursor_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698