| 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 <XCTest/XCTest.h> | 5 #import <XCTest/XCTest.h> |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 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_dependency_factory.h" | 9 #import "ios/chrome/browser/ui/browser_view_controller_dependency_factory.h" |
| 10 #import "ios/chrome/browser/ui/uikit_ui_util.h" | 10 #import "ios/chrome/browser/ui/uikit_ui_util.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 web::test::SetUpHttpServer( | 66 web::test::SetUpHttpServer( |
| 67 base::MakeUnique<ErrorPageResponseProvider>(responses)); | 67 base::MakeUnique<ErrorPageResponseProvider>(responses)); |
| 68 | 68 |
| 69 // Open a regular page and verify that you can share. | 69 // Open a regular page and verify that you can share. |
| 70 [ChromeEarlGrey loadURL:regularPageURL]; | 70 [ChromeEarlGrey loadURL:regularPageURL]; |
| 71 [ChromeEarlGreyUI openShareMenu]; | 71 [ChromeEarlGreyUI openShareMenu]; |
| 72 AssertActivityServiceVisible(); | 72 AssertActivityServiceVisible(); |
| 73 | 73 |
| 74 // Open an error page. | 74 // Open an error page. |
| 75 [ChromeEarlGrey loadURL:ErrorPageResponseProvider::GetDnsFailureUrl()]; | 75 [ChromeEarlGrey loadURL:ErrorPageResponseProvider::GetDnsFailureUrl()]; |
| 76 NSString* const kError = | 76 [ChromeEarlGrey waitForErrorPage]; |
| 77 l10n_util::GetNSString(IDS_ERRORPAGES_HEADING_NOT_AVAILABLE); | |
| 78 [[EarlGrey | |
| 79 selectElementWithMatcher:chrome_test_util::StaticHtmlViewContainingText( | |
| 80 kError)] assertWithMatcher:grey_notNil()]; | |
| 81 | 77 |
| 82 // Execute the Print action. | 78 // Execute the Print action. |
| 83 [[EarlGrey selectElementWithMatcher:PrintButton()] performAction:grey_tap()]; | 79 [[EarlGrey selectElementWithMatcher:PrintButton()] performAction:grey_tap()]; |
| 84 | 80 |
| 85 // Verify that a toast notification appears. | 81 // Verify that a toast notification appears. |
| 86 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel( | 82 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel( |
| 87 @"This page cannot be printed.")] | 83 @"This page cannot be printed.")] |
| 88 assertWithMatcher:grey_interactable()]; | 84 assertWithMatcher:grey_interactable()]; |
| 89 | 85 |
| 90 // Dismiss the snackbar. | 86 // Dismiss the snackbar. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 assertWithMatcher:grey_interactable()]; | 134 assertWithMatcher:grey_interactable()]; |
| 139 | 135 |
| 140 // Start the Copy action and verify that the share menu gets dismissed. | 136 // Start the Copy action and verify that the share menu gets dismissed. |
| 141 [[EarlGrey | 137 [[EarlGrey |
| 142 selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabel( | 138 selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabel( |
| 143 @"Copy")] performAction:grey_tap()]; | 139 @"Copy")] performAction:grey_tap()]; |
| 144 AssertActivityServiceNotVisible(); | 140 AssertActivityServiceNotVisible(); |
| 145 } | 141 } |
| 146 | 142 |
| 147 @end | 143 @end |
| OLD | NEW |