OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/gfx/size_base.h" |
| 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "ui/gfx/size.h" |
| 9 #include "ui/gfx/size_f.h" |
| 10 |
| 11 namespace ui { |
| 12 |
| 13 static int test_sizef(const gfx::SizeF& s) { |
| 14 return s.width(); |
| 15 } |
| 16 |
| 17 TEST(SizeTest, ToSizeF) { |
| 18 // Check that implicit conversion from integer to float compiles. |
| 19 gfx::Size a(10, 20); |
| 20 float width = test_sizef(a); |
| 21 EXPECT_EQ(width, a.width()); |
| 22 |
| 23 gfx::SizeF b(10, 20); |
| 24 bool equals = a == b; |
| 25 EXPECT_EQ(true, equals); |
| 26 |
| 27 equals = b == a; |
| 28 EXPECT_EQ(true, equals); |
| 29 } |
| 30 |
| 31 } // namespace ui |
OLD | NEW |