forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS][MF][EG2] Migrate keyboard observer test
Remove deprecate test that would require new code to be migrated. Update and enable keyboard disappear test. Create app interface to interact with a shared instance of the observer in the app. Remove OCMock usage in the test. TBR=eugenebut@chromium.org Change-Id: Iaa5384f241e63b95ee516d4666b2e2adf65b7da6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1881566 Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org> Reviewed-by: Javier Ernesto Flores Robles <javierrobles@chromium.org> Reviewed-by: Stepan Khapugin <stkhapugin@chromium.org> Cr-Commit-Position: refs/heads/master@{#709939}
- Loading branch information
Javier Ernesto Flores Robles
authored and
Commit Bot
committed
Oct 28, 2019
1 parent
c117648
commit 959cddb
Showing
6 changed files
with
140 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
ios/chrome/browser/ui/util/keyboard_observer_helper_app_interface.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2019 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef IOS_CHROME_BROWSER_UI_UTIL_KEYBOARD_OBSERVER_HELPER_APP_INTERFACE_H_ | ||
#define IOS_CHROME_BROWSER_UI_UTIL_KEYBOARD_OBSERVER_HELPER_APP_INTERFACE_H_ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class KeyboardObserverHelper; | ||
|
||
// Utility to interact with a KeyboardObserverInstance on Earl Grey 2 tests. | ||
@interface KeyboardObserverHelperAppInterface : NSObject | ||
|
||
// Returns a shared instance of the observer. | ||
+ (KeyboardObserverHelper*)appSharedInstance; | ||
|
||
@end | ||
|
||
#endif // IOS_CHROME_BROWSER_UI_UTIL_KEYBOARD_OBSERVER_HELPER_APP_INTERFACE_H_ |
24 changes: 24 additions & 0 deletions
24
ios/chrome/browser/ui/util/keyboard_observer_helper_app_interface.mm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2019 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#import "ios/chrome/browser/ui/util/keyboard_observer_helper_app_interface.h" | ||
|
||
#import "ios/chrome/browser/ui/util/keyboard_observer_helper.h" | ||
|
||
#if !defined(__has_feature) || !__has_feature(objc_arc) | ||
#error "This file requires ARC support." | ||
#endif | ||
|
||
@implementation KeyboardObserverHelperAppInterface | ||
|
||
+ (KeyboardObserverHelper*)appSharedInstance { | ||
static KeyboardObserverHelper* sharedInstance; | ||
static dispatch_once_t onceToken; | ||
dispatch_once(&onceToken, ^{ | ||
sharedInstance = [[KeyboardObserverHelper alloc] init]; | ||
}); | ||
return sharedInstance; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters