Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay software keyboard minimization and DYLD_INSERT_LIBRARIES for Chrome. #1977

Open
wants to merge 1 commit into
base: earlgrey2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion AppFramework/AutomationSetup/GREYAutomationSetup.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ @implementation GREYAutomationSetup

+ (void)load {
// Force software keyboard.
[[UIKeyboardImpl sharedInstance] setAutomaticMinimizationEnabled:NO];
dispatch_async(dispatch_get_main_queue(), ^{
[[UIKeyboardImpl sharedInstance] setAutomaticMinimizationEnabled:NO];
});
}

@end
16 changes: 9 additions & 7 deletions TestLib/XCTestCase/XCUIApplication+GREYEnvironment.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ @implementation XCUIApplication (GREYEnvironment)

- (void)grey_configureApplicationForLaunch {
NSMutableDictionary<NSString *, NSString *> *mutableEnv = [self.launchEnvironment mutableCopy];
NSString *insertionKey = @"DYLD_INSERT_LIBRARIES";
NSString *insertionValue = @"@executable_path/Frameworks/AppFramework.framework/AppFramework";
NSString *alreadyExistingValue = [mutableEnv valueForKey:insertionKey];
NSArray<NSString *> *existingValues = [alreadyExistingValue componentsSeparatedByString:@":"];
if (existingValues && ![existingValues containsObject:insertionValue]) {
insertionValue = [NSString stringWithFormat:@"%@:%@", alreadyExistingValue, insertionValue];
if (![mutableEnv[@"EG_SKIP_INSERT_LIBRARIES"] isEqualToString:@"YES"]) {
NSString *insertionKey = @"DYLD_INSERT_LIBRARIES";
NSString *insertionValue = @"@executable_path/Frameworks/AppFramework.framework/AppFramework";
NSString *alreadyExistingValue = [mutableEnv valueForKey:insertionKey];
NSArray<NSString *> *existingValues = [alreadyExistingValue componentsSeparatedByString:@":"];
if (existingValues && ![existingValues containsObject:insertionValue]) {
insertionValue = [NSString stringWithFormat:@"%@:%@", alreadyExistingValue, insertionValue];
}
[mutableEnv setObject:insertionValue forKey:insertionKey];
}
[mutableEnv setObject:insertionValue forKey:insertionKey];

// Pass in this flag so logging is enabled for the application process for both NSLog and OSLog.
mutableEnv[@"OS_ACTIVITY_DT_MODE"] = @"YES";
Expand Down