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

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

Issue 15233003: ui: ToEnclosingRect(empty rect) should return an empty rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/rect_conversions.cc ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 #include "ui/gfx/rect.h" 7 #include "ui/gfx/rect.h"
8 #include "ui/gfx/rect_conversions.h" 8 #include "ui/gfx/rect_conversions.h"
9 #include "ui/gfx/skia_util.h" 9 #include "ui/gfx/skia_util.h"
10 10
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 float y1; 512 float y1;
513 float w1; 513 float w1;
514 float h1; 514 float h1;
515 int x2; // target 515 int x2; // target
516 int y2; 516 int y2;
517 int w2; 517 int w2;
518 int h2; 518 int h2;
519 } tests [] = { 519 } tests [] = {
520 { 0.0f, 0.0f, 0.0f, 0.0f, 520 { 0.0f, 0.0f, 0.0f, 0.0f,
521 0, 0, 0, 0 }, 521 0, 0, 0, 0 },
522 { 5.5f, 5.5f, 0.0f, 0.0f,
523 5, 5, 0, 0 },
522 { -1.5f, -1.5f, 3.0f, 3.0f, 524 { -1.5f, -1.5f, 3.0f, 3.0f,
523 -2, -2, 4, 4 }, 525 -2, -2, 4, 4 },
524 { -1.5f, -1.5f, 3.5f, 3.5f, 526 { -1.5f, -1.5f, 3.5f, 3.5f,
525 -2, -2, 4, 4 }, 527 -2, -2, 4, 4 },
526 { std::numeric_limits<float>::max(), 528 { std::numeric_limits<float>::max(),
527 std::numeric_limits<float>::max(), 529 std::numeric_limits<float>::max(),
528 2.0f, 2.0f, 530 2.0f, 2.0f,
529 std::numeric_limits<int>::max(), 531 std::numeric_limits<int>::max(),
530 std::numeric_limits<int>::max(), 532 std::numeric_limits<int>::max(),
531 0, 0 }, 533 0, 0 },
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 EXPECT_EQ(Point(1, 6).ToString(), i.bottom_left().ToString()); 751 EXPECT_EQ(Point(1, 6).ToString(), i.bottom_left().ToString());
750 EXPECT_EQ(Point(4, 6).ToString(), i.bottom_right().ToString()); 752 EXPECT_EQ(Point(4, 6).ToString(), i.bottom_right().ToString());
751 753
752 EXPECT_EQ(PointF(1.1f, 2.1f).ToString(), f.origin().ToString()); 754 EXPECT_EQ(PointF(1.1f, 2.1f).ToString(), f.origin().ToString());
753 EXPECT_EQ(PointF(4.2f, 2.1f).ToString(), f.top_right().ToString()); 755 EXPECT_EQ(PointF(4.2f, 2.1f).ToString(), f.top_right().ToString());
754 EXPECT_EQ(PointF(1.1f, 6.2f).ToString(), f.bottom_left().ToString()); 756 EXPECT_EQ(PointF(1.1f, 6.2f).ToString(), f.bottom_left().ToString());
755 EXPECT_EQ(PointF(4.2f, 6.2f).ToString(), f.bottom_right().ToString()); 757 EXPECT_EQ(PointF(4.2f, 6.2f).ToString(), f.bottom_right().ToString());
756 } 758 }
757 759
758 } // namespace gfx 760 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/rect_conversions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698