| 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/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "components/strings/grit/components_strings.h" | 8 #include "components/strings/grit/components_strings.h" |
| 9 #import "ios/chrome/browser/find_in_page/find_in_page_controller.h" | 9 #import "ios/chrome/browser/find_in_page/find_in_page_controller.h" |
| 10 #import "ios/chrome/browser/ui/find_bar/find_bar_controller_ios.h" | 10 #import "ios/chrome/browser/ui/find_bar/find_bar_controller_ios.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #error "This file requires ARC support." | 26 #error "This file requires ARC support." |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 // Test web page content. | 31 // Test web page content. |
| 32 const std::string kFindInPageResponse = "Find in page. Find in page."; | 32 const std::string kFindInPageResponse = "Find in page. Find in page."; |
| 33 | 33 |
| 34 } // namespace | 34 } // namespace |
| 35 | 35 |
| 36 using chrome_test_util::WebViewContainingText; | |
| 37 | |
| 38 // Tests for Find in Page. | 36 // Tests for Find in Page. |
| 39 @interface FindInPageTestCase : ChromeTestCase | 37 @interface FindInPageTestCase : ChromeTestCase |
| 40 | 38 |
| 41 // URL for a test page with |kFindInPageResponse|. | 39 // URL for a test page with |kFindInPageResponse|. |
| 42 @property(nonatomic, assign) GURL testURL; | 40 @property(nonatomic, assign) GURL testURL; |
| 43 | 41 |
| 44 // Opens Find in Page. | 42 // Opens Find in Page. |
| 45 - (void)openFindInPage; | 43 - (void)openFindInPage; |
| 46 // Closes Find in page. | 44 // Closes Find in page. |
| 47 - (void)closeFindInPage; | 45 - (void)closeFindInPage; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 [[EarlGrey selectElementWithMatcher:grey_accessibilityID( | 214 [[EarlGrey selectElementWithMatcher:grey_accessibilityID( |
| 217 kFindInPagePreviousButtonId)] | 215 kFindInPagePreviousButtonId)] |
| 218 performAction:grey_tap()]; | 216 performAction:grey_tap()]; |
| 219 } | 217 } |
| 220 | 218 |
| 221 - (void)navigateToTestPage { | 219 - (void)navigateToTestPage { |
| 222 // Navigate to a page with some text. | 220 // Navigate to a page with some text. |
| 223 [ChromeEarlGrey loadURL:self.testURL]; | 221 [ChromeEarlGrey loadURL:self.testURL]; |
| 224 | 222 |
| 225 // Verify web page finished loading. | 223 // Verify web page finished loading. |
| 226 [[EarlGrey | 224 [ChromeEarlGrey waitForWebViewContainingText:kFindInPageResponse]; |
| 227 selectElementWithMatcher:WebViewContainingText(kFindInPageResponse)] | |
| 228 assertWithMatcher:grey_notNil()]; | |
| 229 } | 225 } |
| 230 | 226 |
| 231 @end | 227 @end |
| OLD | NEW |