| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/canvas.h" | 5 #include "ui/gfx/canvas.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| 11 #include "base/strings/sys_string_conversions.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/strings/sys_string_conversions.h" | |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "ui/gfx/font.h" | 14 #include "ui/gfx/font.h" |
| 15 #include "ui/gfx/font_list.h" | 15 #include "ui/gfx/font_list.h" |
| 16 | 16 |
| 17 namespace gfx { | 17 namespace gfx { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // Returns the pixel width of the string via calling the native method | 21 // Returns the pixel width of the string via calling the native method |
| 22 // -sizeWithAttributes. | 22 // -sizeWithAttributes. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 float height = kReallyLargeNumber; | 79 float height = kReallyLargeNumber; |
| 80 | 80 |
| 81 FontList font_list; | 81 FontList font_list; |
| 82 Canvas::SizeStringFloat( | 82 Canvas::SizeStringFloat( |
| 83 base::UTF8ToUTF16("Test"), font_list, &width, &height, 0, 0); | 83 base::UTF8ToUTF16("Test"), font_list, &width, &height, 0, 0); |
| 84 | 84 |
| 85 EXPECT_GT(width, static_cast<int>(width)); | 85 EXPECT_GT(width, static_cast<int>(width)); |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace gfx | 88 } // namespace gfx |
| OLD | NEW |