| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 std::unique_ptr<WebStateList> web_state_list_; | 215 std::unique_ptr<WebStateList> web_state_list_; |
| 216 std::unique_ptr<ToolbarModelDelegateIOS> toolbar_model_delegate_; | 216 std::unique_ptr<ToolbarModelDelegateIOS> toolbar_model_delegate_; |
| 217 std::unique_ptr<ToolbarModelIOS> toolbar_model_ios_; | 217 std::unique_ptr<ToolbarModelIOS> toolbar_model_ios_; |
| 218 WebToolbarController* toolbar_; | 218 WebToolbarController* toolbar_; |
| 219 UIWindow* window_; | 219 UIWindow* window_; |
| 220 KeyboardAppearanceListener* keyboard_listener_; | 220 KeyboardAppearanceListener* keyboard_listener_; |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 // Measures the amount of time it takes the Omnibox text field to activate | 223 // Measures the amount of time it takes the Omnibox text field to activate |
| 224 // the on-screen keyboard. | 224 // the on-screen keyboard. |
| 225 // TODO(crbug.com/717300): Test disabled because of a DCHECK in Reading List. | 225 TEST_F(OmniboxPerfTest, TestTextFieldDidBeginEditing) { |
| 226 TEST_F(OmniboxPerfTest, DISABLED_TestTextFieldDidBeginEditing) { | |
| 227 LogPerfTiming("Keyboard preload", PreLoadKeyboard()); | 226 LogPerfTiming("Keyboard preload", PreLoadKeyboard()); |
| 228 OmniboxTextFieldIOS* textField = (OmniboxTextFieldIOS*)FindViewByClass( | 227 OmniboxTextFieldIOS* textField = (OmniboxTextFieldIOS*)FindViewByClass( |
| 229 [toolbar_ view], [OmniboxTextFieldIOS class]); | 228 [toolbar_ view], [OmniboxTextFieldIOS class]); |
| 230 | 229 |
| 231 // Time how long it takes to "focus" on omnibox. | 230 // Time how long it takes to "focus" on omnibox. |
| 232 RepeatTimedRuns("Begin editing", | 231 RepeatTimedRuns("Begin editing", |
| 233 ^base::TimeDelta(int index) { | 232 ^base::TimeDelta(int index) { |
| 234 return EnableKeyboard(textField); | 233 return EnableKeyboard(textField); |
| 235 }, | 234 }, |
| 236 ^() { | 235 ^() { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 } | 276 } |
| 278 NSLog(@"%2d: %@", index, logMessage); | 277 NSLog(@"%2d: %@", index, logMessage); |
| 279 return elapsed; | 278 return elapsed; |
| 280 }, | 279 }, |
| 281 ^() { | 280 ^() { |
| 282 [textField setText:@""]; | 281 [textField setText:@""]; |
| 283 DisableKeyboard(textField); | 282 DisableKeyboard(textField); |
| 284 }); | 283 }); |
| 285 } | 284 } |
| 286 } | 285 } |
| OLD | NEW |