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/commands/generic_chrome_command.h" | 9 #import "ios/chrome/browser/ui/commands/generic_chrome_command.h" |
10 #include "ios/chrome/browser/ui/commands/ios_command_ids.h" | 10 #include "ios/chrome/browser/ui/commands/ios_command_ids.h" |
11 #import "ios/chrome/browser/ui/ntp/new_tab_page_controller.h" | 11 #import "ios/chrome/browser/ui/ntp/new_tab_page_controller.h" |
12 #include "ios/chrome/browser/ui/ui_util.h" | 12 #include "ios/chrome/browser/ui/ui_util.h" |
13 #include "ios/chrome/grit/ios_strings.h" | 13 #include "ios/chrome/grit/ios_strings.h" |
14 #import "ios/chrome/test/app/chrome_test_util.h" | 14 #import "ios/chrome/test/app/chrome_test_util.h" |
15 #import "ios/chrome/test/app/tab_test_util.h" | 15 #import "ios/chrome/test/app/tab_test_util.h" |
16 #import "ios/chrome/test/earl_grey/accessibility_util.h" | 16 #import "ios/chrome/test/earl_grey/accessibility_util.h" |
17 #import "ios/chrome/test/earl_grey/chrome_matchers.h" | 17 #import "ios/chrome/test/earl_grey/chrome_matchers.h" |
18 #import "ios/chrome/test/earl_grey/chrome_test_case.h" | 18 #import "ios/chrome/test/earl_grey/chrome_test_case.h" |
19 #import "ios/testing/wait_util.h" | 19 #import "ios/testing/wait_util.h" |
20 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
21 | 21 |
22 #if !defined(__has_feature) || !__has_feature(objc_arc) | 22 #if !defined(__has_feature) || !__has_feature(objc_arc) |
23 #error "This file requires ARC support." | 23 #error "This file requires ARC support." |
24 #endif | 24 #endif |
25 | 25 |
26 @implementation NewTabPageController (ExposedForTesting) | |
27 - (GoogleLandingViewController*)googleLandingController { | |
28 return googleLandingController_; | |
29 } | |
30 @end | |
31 | |
32 @interface GoogleLandingViewController (ExposedForTesting) | 26 @interface GoogleLandingViewController (ExposedForTesting) |
33 - (BOOL)scrolledToTop; | 27 - (BOOL)scrolledToTop; |
34 - (BOOL)animateHeader; | 28 - (BOOL)animateHeader; |
35 @end | 29 @end |
36 | 30 |
37 namespace { | 31 namespace { |
38 | 32 |
39 void DismissNewTabPagePanel() { | 33 void DismissNewTabPagePanel() { |
40 if (!IsIPadIdiom()) { | 34 if (!IsIPadIdiom()) { |
41 id<GREYMatcher> matcher = grey_allOf(grey_accessibilityID(@"Exit"), | 35 id<GREYMatcher> matcher = grey_allOf(grey_accessibilityID(@"Exit"), |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 AssertNTPScrolledToTop(YES); | 298 AssertNTPScrolledToTop(YES); |
305 | 299 |
306 // Check that tab switcher and tools menu buttons are not on screen. | 300 // Check that tab switcher and tools menu buttons are not on screen. |
307 [[EarlGrey selectElementWithMatcher:chrome_test_util::ShowTabsButton()] | 301 [[EarlGrey selectElementWithMatcher:chrome_test_util::ShowTabsButton()] |
308 assertWithMatcher:grey_notVisible()]; | 302 assertWithMatcher:grey_notVisible()]; |
309 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(toolsMenuLabel)] | 303 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(toolsMenuLabel)] |
310 assertWithMatcher:grey_notVisible()]; | 304 assertWithMatcher:grey_notVisible()]; |
311 } | 305 } |
312 | 306 |
313 @end | 307 @end |
OLD | NEW |