Chromium Code Reviews| 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 11 matching lines...) Expand all Loading... | |
| 22 #import "ios/web/public/test/http_server_util.h" | 22 #import "ios/web/public/test/http_server_util.h" |
| 23 #include "ui/base/l10n/l10n_util_mac.h" | 23 #include "ui/base/l10n/l10n_util_mac.h" |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // Test web page content. | 27 // Test web page content. |
| 28 const std::string kFindInPageResponse = "Find in page. Find in page."; | 28 const std::string kFindInPageResponse = "Find in page. Find in page."; |
| 29 | 29 |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| 32 using chrome_test_util::buttonWithAccessibilityLabel; | 32 using chrome_test_util::ButtonWithAccessibilityLabel; |
|
Eugene But (OOO till 7-30)
2017/01/23 19:39:03
Is this used?
baxley
2017/01/24 22:18:49
Done.
| |
| 33 using chrome_test_util::webViewContainingText; | 33 using chrome_test_util::WebViewContainingText; |
| 34 | 34 |
| 35 // Tests for Find in Page. | 35 // Tests for Find in Page. |
| 36 @interface FindInPageTestCase : ChromeTestCase | 36 @interface FindInPageTestCase : ChromeTestCase |
| 37 | 37 |
| 38 // URL for a test page with |kFindInPageResponse|. | 38 // URL for a test page with |kFindInPageResponse|. |
| 39 @property(nonatomic, assign) GURL testURL; | 39 @property(nonatomic, assign) GURL testURL; |
| 40 | 40 |
| 41 // Opens Find in Page. | 41 // Opens Find in Page. |
| 42 - (void)openFindInPage; | 42 - (void)openFindInPage; |
| 43 // Closes Find in page. | 43 // Closes Find in page. |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 214 kFindInPagePreviousButtonId)] | 214 kFindInPagePreviousButtonId)] |
| 215 performAction:grey_tap()]; | 215 performAction:grey_tap()]; |
| 216 } | 216 } |
| 217 | 217 |
| 218 - (void)navigateToTestPage { | 218 - (void)navigateToTestPage { |
| 219 // Navigate to a page with some text. | 219 // Navigate to a page with some text. |
| 220 [ChromeEarlGrey loadURL:self.testURL]; | 220 [ChromeEarlGrey loadURL:self.testURL]; |
| 221 | 221 |
| 222 // Verify web page finished loading. | 222 // Verify web page finished loading. |
| 223 [[EarlGrey | 223 [[EarlGrey |
| 224 selectElementWithMatcher:webViewContainingText(kFindInPageResponse)] | 224 selectElementWithMatcher:WebViewContainingText(kFindInPageResponse)] |
| 225 assertWithMatcher:grey_notNil()]; | 225 assertWithMatcher:grey_notNil()]; |
| 226 } | 226 } |
| 227 | 227 |
| 228 @end | 228 @end |
| OLD | NEW |