| OLD | NEW | 
|    1 // Copyright 2016 The Chromium Authors. All rights reserved. |    1 // Copyright 2016 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 <EarlGrey/EarlGrey.h> |    5 #import <EarlGrey/EarlGrey.h> | 
|    6  |    6  | 
|    7 #include "base/strings/sys_string_conversions.h" |    7 #include "base/strings/sys_string_conversions.h" | 
|    8 #import "base/test/ios/wait_util.h" |    8 #import "base/test/ios/wait_util.h" | 
|    9 #include "ios/chrome/browser/autofill/form_input_accessory_view_controller.h" |    9 #include "ios/chrome/browser/autofill/form_input_accessory_view_controller.h" | 
|   10 #include "ios/chrome/browser/ui/ui_util.h" |   10 #include "ios/chrome/browser/ui/ui_util.h" | 
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   80   // the left and right of the QuickType suggestions). |   80   // the left and right of the QuickType suggestions). | 
|   81   if (IsIPadIdiom()) { |   81   if (IsIPadIdiom()) { | 
|   82     EARL_GREY_TEST_SKIPPED(@"Skipped for iPad (no hidden toolbar in tablet)"); |   82     EARL_GREY_TEST_SKIPPED(@"Skipped for iPad (no hidden toolbar in tablet)"); | 
|   83   } |   83   } | 
|   84  |   84  | 
|   85   web::test::SetUpFileBasedHttpServer(); |   85   web::test::SetUpFileBasedHttpServer(); | 
|   86   GURL URL = web::test::HttpServer::MakeUrl( |   86   GURL URL = web::test::HttpServer::MakeUrl( | 
|   87       "http://ios/testing/data/http_server_files/multi_field_form.html"); |   87       "http://ios/testing/data/http_server_files/multi_field_form.html"); | 
|   88   [ChromeEarlGrey loadURL:URL]; |   88   [ChromeEarlGrey loadURL:URL]; | 
|   89  |   89  | 
|   90   id<GREYMatcher> webViewMatcher = |   90   [ChromeEarlGrey waitForWebViewContainingText:"hello!"]; | 
|   91       chrome_test_util::WebViewContainingText("hello!"); |  | 
|   92   [[EarlGrey selectElementWithMatcher:webViewMatcher] |  | 
|   93       assertWithMatcher:grey_notNil()]; |  | 
|   94  |   91  | 
|   95   // Opening the keyboard from a webview blocks EarlGrey's synchronization. |   92   // Opening the keyboard from a webview blocks EarlGrey's synchronization. | 
|   96   [[GREYConfiguration sharedInstance] |   93   [[GREYConfiguration sharedInstance] | 
|   97           setValue:@NO |   94           setValue:@NO | 
|   98       forConfigKey:kGREYConfigKeySynchronizationEnabled]; |   95       forConfigKey:kGREYConfigKeySynchronizationEnabled]; | 
|   99  |   96  | 
|  100   // Brings up the keyboard by tapping on one of the form's field. |   97   // Brings up the keyboard by tapping on one of the form's field. | 
|  101   [[EarlGrey |   98   [[EarlGrey | 
|  102       selectElementWithMatcher:web::WebViewInWebState( |   99       selectElementWithMatcher:web::WebViewInWebState( | 
|  103                                    chrome_test_util::GetCurrentWebState())] |  100                                    chrome_test_util::GetCurrentWebState())] | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  155 // visible doesn't crash the browser. |  152 // visible doesn't crash the browser. | 
|  156 - (void)testCloseKeyboardWhenNotVisible { |  153 - (void)testCloseKeyboardWhenNotVisible { | 
|  157   FormInputAccessoryViewController* inputAccessoryViewController = |  154   FormInputAccessoryViewController* inputAccessoryViewController = | 
|  158       chrome_test_util::GetInputAccessoryViewController(); |  155       chrome_test_util::GetInputAccessoryViewController(); | 
|  159   GREYAssertNotNil(inputAccessoryViewController, |  156   GREYAssertNotNil(inputAccessoryViewController, | 
|  160                    @"The tab's input accessory view should not be non nil."); |  157                    @"The tab's input accessory view should not be non nil."); | 
|  161   [inputAccessoryViewController closeKeyboardWithoutButtonPress]; |  158   [inputAccessoryViewController closeKeyboardWithoutButtonPress]; | 
|  162 } |  159 } | 
|  163  |  160  | 
|  164 @end |  161 @end | 
| OLD | NEW |