| 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/logging.h" | 5 #include "base/logging.h" |
| 6 #include "testing/gmock/include/gmock/gmock.h" | 6 #include "testing/gmock/include/gmock/gmock.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "views/controls/single_split_view.h" | 8 #include "views/controls/single_split_view.h" |
| 9 | 9 |
| 10 using ::testing::_; | 10 using ::testing::_; |
| 11 using ::testing::Return; | 11 using ::testing::Return; |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 static void VerifySplitViewLayout(const views::SingleSplitView& split) { | 15 static void VerifySplitViewLayout(const views::SingleSplitView& split) { |
| 16 ASSERT_EQ(2, split.GetChildViewCount()); | 16 ASSERT_EQ(2, split.child_count()); |
| 17 | 17 |
| 18 views::View* leading = split.GetChildViewAt(0); | 18 const views::View* leading = split.GetChildViewAt(0); |
| 19 views::View* trailing = split.GetChildViewAt(1); | 19 const views::View* trailing = split.GetChildViewAt(1); |
| 20 | 20 |
| 21 if (split.bounds().IsEmpty()) { | 21 if (split.bounds().IsEmpty()) { |
| 22 EXPECT_TRUE(leading->bounds().IsEmpty()); | 22 EXPECT_TRUE(leading->bounds().IsEmpty()); |
| 23 EXPECT_TRUE(trailing->bounds().IsEmpty()); | 23 EXPECT_TRUE(trailing->bounds().IsEmpty()); |
| 24 return; | 24 return; |
| 25 } | 25 } |
| 26 | 26 |
| 27 EXPECT_FALSE(leading->bounds().IsEmpty()); | 27 EXPECT_FALSE(leading->bounds().IsEmpty()); |
| 28 EXPECT_FALSE(trailing->bounds().IsEmpty()); | 28 EXPECT_FALSE(trailing->bounds().IsEmpty()); |
| 29 EXPECT_FALSE(leading->bounds().Intersects(trailing->bounds())); | 29 EXPECT_FALSE(leading->bounds().Intersects(trailing->bounds())); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 MouseEvent mouse_released( | 166 MouseEvent mouse_released( |
| 167 Event::ET_MOUSE_RELEASED, 7, | 167 Event::ET_MOUSE_RELEASED, 7, |
| 168 kInitialDividerOffset + kMouseOffset + kMouseMoveDelta * 2, 0); | 168 kInitialDividerOffset + kMouseOffset + kMouseMoveDelta * 2, 0); |
| 169 split.OnMouseReleased(mouse_released, false); | 169 split.OnMouseReleased(mouse_released, false); |
| 170 EXPECT_EQ(kInitialDividerOffset + kMouseMoveDelta * 2, | 170 EXPECT_EQ(kInitialDividerOffset + kMouseMoveDelta * 2, |
| 171 split.divider_offset()); | 171 split.divider_offset()); |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace views | 174 } // namespace views |
| OLD | NEW |