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 #import <XCTest/XCTest.h> | 6 #import <XCTest/XCTest.h> |
7 | 7 |
8 #include "components/strings/grit/components_strings.h" | 8 #include "components/strings/grit/components_strings.h" |
9 #import "ios/chrome/browser/ui/browser_view_controller.h" | 9 #import "ios/chrome/browser/ui/browser_view_controller.h" |
10 #import "ios/chrome/browser/ui/commands/generic_chrome_command.h" | 10 #import "ios/chrome/browser/ui/commands/generic_chrome_command.h" |
11 #include "ios/chrome/browser/ui/commands/ios_command_ids.h" | 11 #include "ios/chrome/browser/ui/commands/ios_command_ids.h" |
12 #import "ios/chrome/browser/ui/ntp/new_tab_page_controller.h" | 12 #import "ios/chrome/browser/ui/ntp/new_tab_page_controller.h" |
13 #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.h" | 13 #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.h" |
14 #include "ios/chrome/browser/ui/ui_util.h" | 14 #include "ios/chrome/browser/ui/ui_util.h" |
15 #import "ios/chrome/browser/ui/uikit_ui_util.h" | 15 #import "ios/chrome/browser/ui/uikit_ui_util.h" |
16 #include "ios/chrome/grit/ios_strings.h" | 16 #include "ios/chrome/grit/ios_strings.h" |
17 #import "ios/chrome/test/app/bookmarks_test_util.h" | 17 #import "ios/chrome/test/app/bookmarks_test_util.h" |
18 #import "ios/chrome/test/app/chrome_test_util.h" | 18 #import "ios/chrome/test/app/chrome_test_util.h" |
19 #import "ios/chrome/test/app/tab_test_util.h" | 19 #import "ios/chrome/test/app/tab_test_util.h" |
20 #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" | 20 #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" |
21 #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" | 21 #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" |
22 #import "ios/chrome/test/earl_grey/chrome_matchers.h" | 22 #import "ios/chrome/test/earl_grey/chrome_matchers.h" |
23 #import "ios/chrome/test/earl_grey/chrome_test_case.h" | 23 #import "ios/chrome/test/earl_grey/chrome_test_case.h" |
24 #import "ios/web/public/test/http_server.h" | 24 #import "ios/web/public/test/http_server.h" |
25 #include "ios/web/public/test/http_server_util.h" | 25 #include "ios/web/public/test/http_server_util.h" |
26 | 26 |
| 27 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 28 #error "This file requires ARC support." |
| 29 #endif |
| 30 |
27 const CGFloat kScrollDisplacement = 50.0; | 31 const CGFloat kScrollDisplacement = 50.0; |
28 | 32 |
29 // Test cases to verify that keyboard commands are and are not registered when | 33 // Test cases to verify that keyboard commands are and are not registered when |
30 // expected. | 34 // expected. |
31 @interface KeyboardCommandsTestCase : ChromeTestCase | 35 @interface KeyboardCommandsTestCase : ChromeTestCase |
32 @end | 36 @end |
33 | 37 |
34 @implementation KeyboardCommandsTestCase | 38 @implementation KeyboardCommandsTestCase |
35 | 39 |
36 #pragma mark - Helpers | 40 #pragma mark - Helpers |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 [self verifyKeyboardCommandsAreRegistered]; | 223 [self verifyKeyboardCommandsAreRegistered]; |
220 | 224 |
221 UIResponder* firstResponder = GetFirstResponder(); | 225 UIResponder* firstResponder = GetFirstResponder(); |
222 GREYAssert( | 226 GREYAssert( |
223 [firstResponder isKindOfClass:NSClassFromString(@"WKContentView")], | 227 [firstResponder isKindOfClass:NSClassFromString(@"WKContentView")], |
224 @"Expected first responder to be a WKContentView. Instead, is a %@", | 228 @"Expected first responder to be a WKContentView. Instead, is a %@", |
225 NSStringFromClass([firstResponder class])); | 229 NSStringFromClass([firstResponder class])); |
226 } | 230 } |
227 | 231 |
228 @end | 232 @end |
OLD | NEW |