| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/ui/tabs/dock_info.h" | 6 #include "chrome/browser/ui/tabs/dock_info.h" |
| 7 #include "gfx/point.h" | 7 #include "gfx/point.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 for (size_t i = 0; i < arraysize(expected_result); ++i) { | 119 for (size_t i = 0; i < arraysize(expected_result); ++i) { |
| 120 EXPECT_EQ(expected_result[i], d.IsValidForPoint(screen_point[i])); | 120 EXPECT_EQ(expected_result[i], d.IsValidForPoint(screen_point[i])); |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 | 123 |
| 124 TEST(DockInfoTest, equals) { | 124 TEST(DockInfoTest, equals) { |
| 125 DockInfo d; | 125 DockInfo d; |
| 126 DockInfo dd; | 126 DockInfo dd; |
| 127 EXPECT_EQ(true, d.equals(dd)); | 127 EXPECT_TRUE(d.equals(dd)); |
| 128 d.set_type(DockInfo::MAXIMIZE); | 128 d.set_type(DockInfo::MAXIMIZE); |
| 129 EXPECT_FALSE(d.equals(dd)); | 129 EXPECT_FALSE(d.equals(dd)); |
| 130 } | 130 } |
| 131 | 131 |
| 132 TEST(DockInfoTest, CheckMonitorPoint) { | 132 TEST(DockInfoTest, CheckMonitorPoint) { |
| 133 DockInfo d; | 133 DockInfo d; |
| 134 gfx::Point screen_loc[] = { | 134 gfx::Point screen_loc[] = { |
| 135 gfx::Point(0, 0), | 135 gfx::Point(0, 0), |
| 136 gfx::Point(2 * kHotSpotDeltaX, kHotSpotDeltaY), | 136 gfx::Point(2 * kHotSpotDeltaX, kHotSpotDeltaY), |
| 137 gfx::Point(2 * kHotSpotDeltaX, kHotSpotDeltaY), | 137 gfx::Point(2 * kHotSpotDeltaX, kHotSpotDeltaY), |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 for (size_t i = 0; i < arraysize(type); ++i) { | 183 for (size_t i = 0; i < arraysize(type); ++i) { |
| 184 d.set_type(type[i]); | 184 d.set_type(type[i]); |
| 185 gfx::Rect result = d.GetPopupRect(); | 185 gfx::Rect result = d.GetPopupRect(); |
| 186 EXPECT_EQ(expected_x[i], result.x()); | 186 EXPECT_EQ(expected_x[i], result.x()); |
| 187 EXPECT_EQ(expected_y[i], result.y()); | 187 EXPECT_EQ(expected_y[i], result.y()); |
| 188 EXPECT_EQ(kPopupWidth, result.width()); | 188 EXPECT_EQ(kPopupWidth, result.width()); |
| 189 EXPECT_EQ(kPopupHeight, result.height()); | 189 EXPECT_EQ(kPopupHeight, result.height()); |
| 190 } | 190 } |
| 191 } | 191 } |
| OLD | NEW |