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

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

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more vector use fixes 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 "base/basictypes.h"
Peter Kasting 2012/10/30 01:14:14 Nit: Surprised this is necessary
danakj 2012/10/30 19:21:21 Oh, this was for the macro to give the size of an
7 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/gfx/size.h" 9 #include "ui/gfx/size.h"
9 #include "ui/gfx/size_conversions.h" 10 #include "ui/gfx/size_conversions.h"
10 #include "ui/gfx/size_f.h" 11 #include "ui/gfx/size_f.h"
11 12
12 namespace ui { 13 namespace ui {
13 14
14 namespace { 15 namespace {
15 16
16 int TestSizeF(const gfx::SizeF& s) { 17 int TestSizeF(const gfx::SizeF& s) {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 gfx::ToRoundedSize(gfx::SizeF(-10.0001f, -10.0001f))); 131 gfx::ToRoundedSize(gfx::SizeF(-10.0001f, -10.0001f)));
131 EXPECT_EQ(gfx::Size(-10, -10), 132 EXPECT_EQ(gfx::Size(-10, -10),
132 gfx::ToRoundedSize(gfx::SizeF(-10.4999f, -10.4999f))); 133 gfx::ToRoundedSize(gfx::SizeF(-10.4999f, -10.4999f)));
133 EXPECT_EQ(gfx::Size(-11, -11), 134 EXPECT_EQ(gfx::Size(-11, -11),
134 gfx::ToRoundedSize(gfx::SizeF(-10.5f, -10.5f))); 135 gfx::ToRoundedSize(gfx::SizeF(-10.5f, -10.5f)));
135 EXPECT_EQ(gfx::Size(-11, -11), 136 EXPECT_EQ(gfx::Size(-11, -11),
136 gfx::ToRoundedSize(gfx::SizeF(-10.9999f, -10.9999f))); 137 gfx::ToRoundedSize(gfx::SizeF(-10.9999f, -10.9999f)));
137 } 138 }
138 139
139 } // namespace ui 140 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698