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