| 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 <UIKit/UIKit.h> | 6 #import <UIKit/UIKit.h> |
| 7 #import <XCTest/XCTest.h> | 7 #import <XCTest/XCTest.h> |
| 8 | 8 |
| 9 #import "ios/chrome/browser/ui/uikit_ui_util.h" | 9 #import "ios/chrome/browser/ui/uikit_ui_util.h" |
| 10 #include "ios/chrome/grit/ios_strings.h" | 10 #include "ios/chrome/grit/ios_strings.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // loaded. | 41 // loaded. |
| 42 - (void)testPrintNormalPage { | 42 - (void)testPrintNormalPage { |
| 43 GURL url = web::test::HttpServer::MakeUrl(kHTMLURL); | 43 GURL url = web::test::HttpServer::MakeUrl(kHTMLURL); |
| 44 std::map<GURL, std::string> responses; | 44 std::map<GURL, std::string> responses; |
| 45 std::string response = "Test"; | 45 std::string response = "Test"; |
| 46 responses[url] = response; | 46 responses[url] = response; |
| 47 web::test::SetUpSimpleHttpServer(responses); | 47 web::test::SetUpSimpleHttpServer(responses); |
| 48 | 48 |
| 49 chrome_test_util::LoadUrl(url); | 49 chrome_test_util::LoadUrl(url); |
| 50 id<GREYMatcher> response1Matcher = | 50 id<GREYMatcher> response1Matcher = |
| 51 chrome_test_util::webViewContainingText(response); | 51 chrome_test_util::WebViewContainingText(response); |
| 52 [[EarlGrey selectElementWithMatcher:response1Matcher] | 52 [[EarlGrey selectElementWithMatcher:response1Matcher] |
| 53 assertWithMatcher:grey_notNil()]; | 53 assertWithMatcher:grey_notNil()]; |
| 54 | 54 |
| 55 [self printCurrentPage]; | 55 [self printCurrentPage]; |
| 56 } | 56 } |
| 57 | 57 |
| 58 // Tests that the AirPrint menu successfully loads when a PDF is loaded. | 58 // Tests that the AirPrint menu successfully loads when a PDF is loaded. |
| 59 - (void)testPrintPDF { | 59 - (void)testPrintPDF { |
| 60 web::test::SetUpFileBasedHttpServer(); | 60 web::test::SetUpFileBasedHttpServer(); |
| 61 GURL url = web::test::HttpServer::MakeUrl(kPDFURL); | 61 GURL url = web::test::HttpServer::MakeUrl(kPDFURL); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 73 [[EarlGrey selectElementWithMatcher:printButton] performAction:grey_tap()]; | 73 [[EarlGrey selectElementWithMatcher:printButton] performAction:grey_tap()]; |
| 74 | 74 |
| 75 id<GREYMatcher> printerOptionButton = grey_allOf( | 75 id<GREYMatcher> printerOptionButton = grey_allOf( |
| 76 grey_accessibilityLabel(@"Printer Options"), | 76 grey_accessibilityLabel(@"Printer Options"), |
| 77 grey_not(grey_accessibilityTrait(UIAccessibilityTraitHeader)), nil); | 77 grey_not(grey_accessibilityTrait(UIAccessibilityTraitHeader)), nil); |
| 78 [[EarlGrey selectElementWithMatcher:printerOptionButton] | 78 [[EarlGrey selectElementWithMatcher:printerOptionButton] |
| 79 assertWithMatcher:grey_sufficientlyVisible()]; | 79 assertWithMatcher:grey_sufficientlyVisible()]; |
| 80 } | 80 } |
| 81 | 81 |
| 82 @end | 82 @end |
| OLD | NEW |