| Index: ios/web/web_state/ui/crw_web_controller_unittest.mm
|
| diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm
|
| index ab1d48b7fc201fa8394b516c9a7df9ab36ca1e3f..1bacb81bfa8c43fc8b30ae5d73835ad8793f2323 100644
|
| --- a/ios/web/web_state/ui/crw_web_controller_unittest.mm
|
| +++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
|
| @@ -335,6 +335,14 @@ class WebControllerTest : public WebTestT {
|
| WebTestT::TearDown();
|
| }
|
|
|
| + // The value for web view OCMock objects to expect for |-setFrame:|.
|
| + CGRect ExpectedWebViewFrame() const {
|
| + CGSize containerViewSize = [UIScreen mainScreen].bounds.size;
|
| + containerViewSize.height -=
|
| + CGRectGetHeight([UIApplication sharedApplication].statusBarFrame);
|
| + return {CGPointZero, containerViewSize};
|
| + }
|
| +
|
| // Creates WebView mock.
|
| virtual UIView* CreateMockWebView() const = 0;
|
|
|
| @@ -354,6 +362,7 @@ class CRWUIWebViewWebControllerTest
|
| id result = [[OCMockObject mockForClass:[UIWebView class]] retain];
|
| [[[result stub] andReturn:nil] request];
|
| [[result stub] setDelegate:OCMOCK_ANY]; // Called by resetInjectedWebView
|
| + [[result stub] setFrame:ExpectedWebViewFrame()];
|
| // Stub out the injection process.
|
| [[[result stub] andReturn:@"object"]
|
| stringByEvaluatingJavaScriptFromString:
|
| @@ -388,6 +397,7 @@ class CRWWKWebViewWebControllerTest
|
| [[[result stub] andReturn:[NSURL URLWithString:kTestURLString]] URL];
|
| [[result stub] setNavigationDelegate:OCMOCK_ANY];
|
| [[result stub] setUIDelegate:OCMOCK_ANY];
|
| + [[result stub] setFrame:ExpectedWebViewFrame()];
|
| [[result stub] addObserver:webController_
|
| forKeyPath:OCMOCK_ANY
|
| options:0
|
|
|