| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // the left and right of the QuickType suggestions). | 76 // the left and right of the QuickType suggestions). |
| 77 if (IsIPadIdiom()) { | 77 if (IsIPadIdiom()) { |
| 78 EARL_GREY_TEST_SKIPPED(@"Skipped for iPad (no hidden toolbar in tablet)"); | 78 EARL_GREY_TEST_SKIPPED(@"Skipped for iPad (no hidden toolbar in tablet)"); |
| 79 } | 79 } |
| 80 | 80 |
| 81 web::test::SetUpFileBasedHttpServer(); | 81 web::test::SetUpFileBasedHttpServer(); |
| 82 GURL URL = web::test::HttpServer::MakeUrl( | 82 GURL URL = web::test::HttpServer::MakeUrl( |
| 83 "http://ios/testing/data/http_server_files/multi_field_form.html"); | 83 "http://ios/testing/data/http_server_files/multi_field_form.html"); |
| 84 [ChromeEarlGrey loadURL:URL]; | 84 [ChromeEarlGrey loadURL:URL]; |
| 85 | 85 |
| 86 id<GREYMatcher> webViewMatcher = | 86 [ChromeEarlGrey waitForWebViewContainingText:@"hello"]; |
| 87 chrome_test_util::WebViewContainingText("hello!"); | |
| 88 [[EarlGrey selectElementWithMatcher:webViewMatcher] | |
| 89 assertWithMatcher:grey_notNil()]; | |
| 90 | 87 |
| 91 // Opening the keyboard from a webview blocks EarlGrey's synchronization. | 88 // Opening the keyboard from a webview blocks EarlGrey's synchronization. |
| 92 [[GREYConfiguration sharedInstance] | 89 [[GREYConfiguration sharedInstance] |
| 93 setValue:@NO | 90 setValue:@NO |
| 94 forConfigKey:kGREYConfigKeySynchronizationEnabled]; | 91 forConfigKey:kGREYConfigKeySynchronizationEnabled]; |
| 95 | 92 |
| 96 // Brings up the keyboard by tapping on one of the form's field. | 93 // Brings up the keyboard by tapping on one of the form's field. |
| 97 [[EarlGrey | 94 [[EarlGrey |
| 98 selectElementWithMatcher:web::WebViewInWebState( | 95 selectElementWithMatcher:web::WebViewInWebState( |
| 99 chrome_test_util::GetCurrentWebState())] | 96 chrome_test_util::GetCurrentWebState())] |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 // visible doesn't crash the browser. | 148 // visible doesn't crash the browser. |
| 152 - (void)testCloseKeyboardWhenNotVisible { | 149 - (void)testCloseKeyboardWhenNotVisible { |
| 153 FormInputAccessoryViewController* inputAccessoryViewController = | 150 FormInputAccessoryViewController* inputAccessoryViewController = |
| 154 chrome_test_util::GetInputAccessoryViewController(); | 151 chrome_test_util::GetInputAccessoryViewController(); |
| 155 GREYAssertNotNil(inputAccessoryViewController, | 152 GREYAssertNotNil(inputAccessoryViewController, |
| 156 @"The tab's input accessory view should not be non nil."); | 153 @"The tab's input accessory view should not be non nil."); |
| 157 [inputAccessoryViewController closeKeyboardWithoutButtonPress]; | 154 [inputAccessoryViewController closeKeyboardWithoutButtonPress]; |
| 158 } | 155 } |
| 159 | 156 |
| 160 @end | 157 @end |
| OLD | NEW |