| 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 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" | 9 #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" |
| 10 #import "ios/chrome/test/earl_grey/chrome_matchers.h" | 10 #import "ios/chrome/test/earl_grey/chrome_matchers.h" |
| 11 #import "ios/chrome/test/earl_grey/chrome_test_case.h" | 11 #import "ios/chrome/test/earl_grey/chrome_test_case.h" |
| 12 #import "ios/web/public/test/http_server.h" | 12 #import "ios/web/public/test/http_server.h" |
| 13 #import "ios/web/public/test/http_server_util.h" | 13 #import "ios/web/public/test/http_server_util.h" |
| 14 | 14 |
| 15 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 16 #error "This file requires ARC support." |
| 17 #endif |
| 18 |
| 15 // Test case for bringing up the print dialog when a web site's JavaScript runs | 19 // Test case for bringing up the print dialog when a web site's JavaScript runs |
| 16 // "window.print". | 20 // "window.print". |
| 17 @interface JSPrintTestCase : ChromeTestCase | 21 @interface JSPrintTestCase : ChromeTestCase |
| 18 @end | 22 @end |
| 19 | 23 |
| 20 @implementation JSPrintTestCase | 24 @implementation JSPrintTestCase |
| 21 | 25 |
| 22 // Tests that tapping a button with onclick='window.print' brings up the | 26 // Tests that tapping a button with onclick='window.print' brings up the |
| 23 // print dialog. | 27 // print dialog. |
| 24 - (void)testWebPrintButton { | 28 - (void)testWebPrintButton { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 45 assertWithMatcher:grey_sufficientlyVisible()]; | 49 assertWithMatcher:grey_sufficientlyVisible()]; |
| 46 | 50 |
| 47 // Clean up and close print dialog. | 51 // Clean up and close print dialog. |
| 48 id<GREYMatcher> cancelButton = | 52 id<GREYMatcher> cancelButton = |
| 49 grey_allOf(grey_accessibilityLabel(@"Cancel"), | 53 grey_allOf(grey_accessibilityLabel(@"Cancel"), |
| 50 grey_accessibilityTrait(UIAccessibilityTraitButton), nil); | 54 grey_accessibilityTrait(UIAccessibilityTraitButton), nil); |
| 51 [[EarlGrey selectElementWithMatcher:cancelButton] performAction:grey_tap()]; | 55 [[EarlGrey selectElementWithMatcher:cancelButton] performAction:grey_tap()]; |
| 52 } | 56 } |
| 53 | 57 |
| 54 @end | 58 @end |
| OLD | NEW |