OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/ui/views/tabs/tab_strip_layout.h" | 5 #include "chrome/browser/ui/views/tabs/tab_strip_layout.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 9 #include "base/macros.h" |
7 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
10 | 13 |
11 namespace { | 14 namespace { |
12 | 15 |
13 // Returns a string with the x-coordinate and width of each gfx::Rect in | 16 // Returns a string with the x-coordinate and width of each gfx::Rect in |
14 // |tabs_bounds|. Each gfx::Rect is separated by a ','. | 17 // |tabs_bounds|. Each gfx::Rect is separated by a ','. |
15 std::string TabsBoundsToString(const std::vector<gfx::Rect>& tabs_bounds) { | 18 std::string TabsBoundsToString(const std::vector<gfx::Rect>& tabs_bounds) { |
16 std::string result; | 19 std::string result; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 EXPECT_EQ(test_cases[i].expected_sizes, TabsBoundsToString(tabs_bounds)) | 103 EXPECT_EQ(test_cases[i].expected_sizes, TabsBoundsToString(tabs_bounds)) |
101 << i; | 104 << i; |
102 EXPECT_EQ(test_cases[i].expected_active_width, active_width) << i; | 105 EXPECT_EQ(test_cases[i].expected_active_width, active_width) << i; |
103 EXPECT_EQ(test_cases[i].expected_inactive_width, inactive_width) << i; | 106 EXPECT_EQ(test_cases[i].expected_inactive_width, inactive_width) << i; |
104 for (const auto& bounds : tabs_bounds) { | 107 for (const auto& bounds : tabs_bounds) { |
105 EXPECT_EQ(0, bounds.y()) << i; | 108 EXPECT_EQ(0, bounds.y()) << i; |
106 EXPECT_EQ(tab_size_info.max_size.height(), bounds.height()) << i; | 109 EXPECT_EQ(tab_size_info.max_size.height(), bounds.height()) << i; |
107 } | 110 } |
108 } | 111 } |
109 } | 112 } |
OLD | NEW |