| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/mac/scoped_nsobject.h" | 5 #include "base/mac/scoped_nsobject.h" |
| 6 #import "ios/chrome/browser/ui/fullscreen_controller.h" | 6 #import "ios/chrome/browser/ui/fullscreen_controller.h" |
| 7 #import "ios/web/public/test/test_web_view_content_view.h" | 7 #import "ios/web/public/test/test_web_view_content_view.h" |
| 8 #import "ios/web/public/web_state/crw_web_view_scroll_view_proxy.h" | 8 #import "ios/web/public/web_state/crw_web_view_scroll_view_proxy.h" |
| 9 #import "ios/web/public/web_state/ui/crw_web_view_content_view.h" | 9 #import "ios/web/public/web_state/ui/crw_web_view_content_view.h" |
| 10 #import "ios/web/web_state/crw_web_view_proxy_impl.h" | 10 #import "ios/web/web_state/crw_web_view_proxy_impl.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 namespace { | 69 namespace { |
| 70 | 70 |
| 71 NSString* const kFakeSessionId = @"fake-session-id"; | 71 NSString* const kFakeSessionId = @"fake-session-id"; |
| 72 | 72 |
| 73 class FullscreenControllerTest : public PlatformTest { | 73 class FullscreenControllerTest : public PlatformTest { |
| 74 protected: | 74 protected: |
| 75 void SetUp() override { | 75 void SetUp() override { |
| 76 CGRect frame = CGRectMake(0.0, 0.0, 300.0, 900.0); | 76 CGRect frame = CGRectMake(0.0, 0.0, 300.0, 900.0); |
| 77 PlatformTest::SetUp(); | 77 PlatformTest::SetUp(); |
| 78 | 78 |
| 79 [FullScreenController setHideOmniboxDelaySeconds:0.0]; | |
| 80 | |
| 81 scrollview_.reset([[UIScrollView alloc] initWithFrame:frame]); | 79 scrollview_.reset([[UIScrollView alloc] initWithFrame:frame]); |
| 82 scrollview_.get().contentInset = UIEdgeInsetsZero; | 80 scrollview_.get().contentInset = UIEdgeInsetsZero; |
| 83 [GetWindow() addSubview:scrollview_]; | 81 [GetWindow() addSubview:scrollview_]; |
| 84 | 82 |
| 85 CGRect contentSize = CGRectMake(0.0, 0.0, frame.size.width, kContentHeight); | 83 CGRect contentSize = CGRectMake(0.0, 0.0, frame.size.width, kContentHeight); |
| 86 scrollview_.get().contentSize = contentSize.size; | 84 scrollview_.get().contentSize = contentSize.size; |
| 87 mockWebController_.reset( | 85 mockWebController_.reset( |
| 88 [[OCMockObject niceMockForClass:[CRWWebController class]] retain]); | 86 [[OCMockObject niceMockForClass:[CRWWebController class]] retain]); |
| 89 mockDelegate_.reset([[MockFullScreenControllerDelegate alloc] init]); | 87 mockDelegate_.reset([[MockFullScreenControllerDelegate alloc] init]); |
| 90 mockWebView_.reset([[UIView alloc] init]); | 88 mockWebView_.reset([[UIView alloc] init]); |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 [controller_ webViewScrollViewDidEndDragging:webViewScrollViewProxy_ | 369 [controller_ webViewScrollViewDidEndDragging:webViewScrollViewProxy_ |
| 372 willDecelerate:NO]; | 370 willDecelerate:NO]; |
| 373 EXPECT_TRUE(IsHeaderVisible()); | 371 EXPECT_TRUE(IsHeaderVisible()); |
| 374 | 372 |
| 375 // Hide the keyboard. | 373 // Hide the keyboard. |
| 376 [textField resignFirstResponder]; | 374 [textField resignFirstResponder]; |
| 377 EXPECT_TRUE(IsHeaderVisible()); | 375 EXPECT_TRUE(IsHeaderVisible()); |
| 378 } | 376 } |
| 379 | 377 |
| 380 } // namespace | 378 } // namespace |
| OLD | NEW |