OLD | NEW |
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/canvas.h" | 5 #include "ui/gfx/canvas.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "ui/gfx/font_list.h" | 12 #include "ui/gfx/font_list.h" |
12 #include "ui/gfx/geometry/rect.h" | 13 #include "ui/gfx/geometry/rect.h" |
13 #include "ui/gfx/geometry/rect_f.h" | 14 #include "ui/gfx/geometry/rect_f.h" |
14 #include "ui/gfx/skia_util.h" | 15 #include "ui/gfx/skia_util.h" |
15 | 16 |
16 namespace gfx { | 17 namespace gfx { |
17 | 18 |
18 class CanvasTest : public testing::Test { | 19 class CanvasTest : public testing::Test { |
19 protected: | 20 protected: |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 #endif | 79 #endif |
79 | 80 |
80 TEST_F(CanvasTest, MAYBE_StringSizeWithLineHeight) { | 81 TEST_F(CanvasTest, MAYBE_StringSizeWithLineHeight) { |
81 gfx::Size one_line_size = SizeStringInt("Q", 0, 0); | 82 gfx::Size one_line_size = SizeStringInt("Q", 0, 0); |
82 gfx::Size four_line_size = SizeStringInt("Q\nQ\nQ\nQ", 1000000, 1000); | 83 gfx::Size four_line_size = SizeStringInt("Q\nQ\nQ\nQ", 1000000, 1000); |
83 EXPECT_EQ(one_line_size.width(), four_line_size.width()); | 84 EXPECT_EQ(one_line_size.width(), four_line_size.width()); |
84 EXPECT_EQ(3 * 1000 + one_line_size.height(), four_line_size.height()); | 85 EXPECT_EQ(3 * 1000 + one_line_size.height(), four_line_size.height()); |
85 } | 86 } |
86 | 87 |
87 } // namespace gfx | 88 } // namespace gfx |
OLD | NEW |