OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <UIKit/UIKit.h> | 5 #import <UIKit/UIKit.h> |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #import "base/test/ios/wait_util.h" | 10 #import "base/test/ios/wait_util.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 [OCMockObject niceMockForProtocol:@protocol(WebToolbarDelegate)]; | 100 [OCMockObject niceMockForProtocol:@protocol(WebToolbarDelegate)]; |
101 [[[webToolbarDelegate stub] andReturnValue:OCMOCK_VALUE(model_for_mock)] | 101 [[[webToolbarDelegate stub] andReturnValue:OCMOCK_VALUE(model_for_mock)] |
102 toolbarModelIOS]; | 102 toolbarModelIOS]; |
103 [[[webToolbarDelegate stub] andReturnValue:OCMOCK_VALUE(web_state_for_mock)] | 103 [[[webToolbarDelegate stub] andReturnValue:OCMOCK_VALUE(web_state_for_mock)] |
104 currentWebState]; | 104 currentWebState]; |
105 id urlLoader = [OCMockObject niceMockForProtocol:@protocol(UrlLoader)]; | 105 id urlLoader = [OCMockObject niceMockForProtocol:@protocol(UrlLoader)]; |
106 toolbar_ = [[WebToolbarController alloc] | 106 toolbar_ = [[WebToolbarController alloc] |
107 initWithDelegate:webToolbarDelegate | 107 initWithDelegate:webToolbarDelegate |
108 urlLoader:urlLoader | 108 urlLoader:urlLoader |
109 browserState:chrome_browser_state_.get() | 109 browserState:chrome_browser_state_.get() |
110 preloadProvider:nil]; | 110 preloadProvider:nil |
| 111 dispatcher:nil]; |
111 UIView* toolbarView = [toolbar_ view]; | 112 UIView* toolbarView = [toolbar_ view]; |
112 CGRect toolbarFrame = toolbarView.frame; | 113 CGRect toolbarFrame = toolbarView.frame; |
113 toolbarFrame.origin = CGPointZero; | 114 toolbarFrame.origin = CGPointZero; |
114 toolbarFrame.size.width = screenBounds.size.width; | 115 toolbarFrame.size.width = screenBounds.size.width; |
115 toolbarView.frame = toolbarFrame; | 116 toolbarView.frame = toolbarFrame; |
116 // Add toolbar to window. | 117 // Add toolbar to window. |
117 [window_ addSubview:toolbarView]; | 118 [window_ addSubview:toolbarView]; |
118 base::test::ios::WaitUntilCondition(^bool() { | 119 base::test::ios::WaitUntilCondition(^bool() { |
119 return IsToolbarLoaded(window_); | 120 return IsToolbarLoaded(window_); |
120 }); | 121 }); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 } | 277 } |
277 NSLog(@"%2d: %@", index, logMessage); | 278 NSLog(@"%2d: %@", index, logMessage); |
278 return elapsed; | 279 return elapsed; |
279 }, | 280 }, |
280 ^() { | 281 ^() { |
281 [textField setText:@""]; | 282 [textField setText:@""]; |
282 DisableKeyboard(textField); | 283 DisableKeyboard(textField); |
283 }); | 284 }); |
284 } | 285 } |
285 } | 286 } |
OLD | NEW |