Index: base/test/test_support_ios.mm |
diff --git a/base/test/test_support_ios.mm b/base/test/test_support_ios.mm |
index 0d9b0379b9b84ae7871c29d674ce53aa5833861c..cbc6465dc59f705647df36cddc3c5049040d81cb 100644 |
--- a/base/test/test_support_ios.mm |
+++ b/base/test/test_support_ios.mm |
@@ -34,6 +34,17 @@ static char** g_argv; |
- (void) _terminateWithStatus:(int)status; |
@end |
+#ifdef TARGET_IPHONE_SIMULATOR |
+// Xcode 6 introduced behavior in the iOS Simulator where the software |
+// keyboard does not appear if a hardware keyboard is connected. The following |
+// declaration allows this behavior to be overriden when the app starts up. |
+@interface UIKeyboardImpl |
++ (instancetype)sharedInstance; |
+- (void)setAutomaticMinimizationEnabled:(BOOL)enabled; |
+- (void)setSoftwareKeyboardShownByTouch:(BOOL)enabled; |
+@end |
+#endif // TARGET_IPHONE_SIMULATOR |
+ |
@interface ChromeUnitTestDelegate : NSObject { |
@private |
base::scoped_nsobject<UIWindow> window_; |
@@ -46,6 +57,15 @@ static char** g_argv; |
- (BOOL)application:(UIApplication *)application |
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { |
+#ifdef TARGET_IPHONE_SIMULATOR |
+ // Xcode 6 introduced behavior in the iOS Simulator where the software |
+ // keyboard does not appear if a hardware keyboard is connected. The following |
+ // calls override this behavior by ensuring that the software keyboard is |
+ // always shown. |
+ [[UIKeyboardImpl sharedInstance] setAutomaticMinimizationEnabled:NO]; |
+ [[UIKeyboardImpl sharedInstance] setSoftwareKeyboardShownByTouch:YES]; |
+#endif // TARGET_IPHONE_SIMULATOR |
+ |
CGRect bounds = [[UIScreen mainScreen] bounds]; |
// Yes, this is leaked, it's just to make what's running visible. |