| 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 #import "ios/web/web_state/ui/crw_web_controller_container_view.h" |
| 6 |
| 5 #import "base/mac/scoped_nsobject.h" | 7 #import "base/mac/scoped_nsobject.h" |
| 6 #import "ios/web/web_state/crw_web_view_proxy_impl.h" | 8 #import "ios/web/web_state/ui/crw_web_view_proxy_impl.h" |
| 7 #import "ios/web/web_state/ui/crw_web_controller_container_view.h" | |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #import "testing/gtest_mac.h" | 10 #import "testing/gtest_mac.h" |
| 10 #include "testing/platform_test.h" | 11 #include "testing/platform_test.h" |
| 12 #import "third_party/ocmock/OCMock/OCMock.h" |
| 11 #include "third_party/ocmock/gtest_support.h" | 13 #include "third_party/ocmock/gtest_support.h" |
| 12 #import "third_party/ocmock/OCMock/OCMock.h" | |
| 13 | 14 |
| 14 namespace { | 15 namespace { |
| 15 // The frame of CRWWebControllerContainerViewTest's |container_view_|. | 16 // The frame of CRWWebControllerContainerViewTest's |container_view_|. |
| 16 const CGRect kContainerViewFrame = CGRectMake(0.0f, 0.0f, 200.0f, 300.0f); | 17 const CGRect kContainerViewFrame = CGRectMake(0.0f, 0.0f, 200.0f, 300.0f); |
| 17 // TestToolbarView's frame height. | 18 // TestToolbarView's frame height. |
| 18 const CGFloat kTestToolbarViewHeight = 50.0f; | 19 const CGFloat kTestToolbarViewHeight = 50.0f; |
| 19 } | 20 } |
| 20 | 21 |
| 21 // Test view to use as a toolbar. | 22 // Test view to use as a toolbar. |
| 22 @interface TestToolbarView : UIView | 23 @interface TestToolbarView : UIView |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // Check the toolbar's frame. | 92 // Check the toolbar's frame. |
| 92 CGRect expected_toolbar_frame = CGRectMake( | 93 CGRect expected_toolbar_frame = CGRectMake( |
| 93 CGRectGetMinX([container_view_ bounds]), | 94 CGRectGetMinX([container_view_ bounds]), |
| 94 CGRectGetMaxY([container_view_ bounds]) - kTestToolbarViewHeight, | 95 CGRectGetMaxY([container_view_ bounds]) - kTestToolbarViewHeight, |
| 95 CGRectGetWidth(kContainerViewFrame), kTestToolbarViewHeight); | 96 CGRectGetWidth(kContainerViewFrame), kTestToolbarViewHeight); |
| 96 CGRect toolbar_container_frame = | 97 CGRect toolbar_container_frame = |
| 97 [container_view_ convertRect:[toolbar bounds] fromView:toolbar]; | 98 [container_view_ convertRect:[toolbar bounds] fromView:toolbar]; |
| 98 EXPECT_TRUE(CGRectEqualToRect(expected_toolbar_frame, | 99 EXPECT_TRUE(CGRectEqualToRect(expected_toolbar_frame, |
| 99 toolbar_container_frame)); | 100 toolbar_container_frame)); |
| 100 } | 101 } |
| OLD | NEW |