Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: ios/chrome/browser/ui/settings/settings_egtest.mm

Issue 2798773002: Create ChromeEarlGrey waitForWebViewContainingText. (Closed)
Patch Set: better formatting Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/settings/settings_egtest.mm
diff --git a/ios/chrome/browser/ui/settings/settings_egtest.mm b/ios/chrome/browser/ui/settings/settings_egtest.mm
index cdab355450c6cc485a42af301fd31d888e96fed9..7872cd23bcba9560ced94bf25a5752dbdfc62606 100644
--- a/ios/chrome/browser/ui/settings/settings_egtest.mm
+++ b/ios/chrome/browser/ui/settings/settings_egtest.mm
@@ -55,6 +55,7 @@
#error "This file requires ARC support."
#endif
+using base::SysUTF8ToNSString;
using chrome_test_util::ButtonWithAccessibilityLabelId;
using chrome_test_util::NavigationBarDoneButton;
@@ -649,9 +650,7 @@ bool IsCertificateCleared() {
// Load |kUrl| and check that cookie is not set.
[ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl(kUrl)];
- [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewContainingText(
- kResponse)]
- assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey waitForWebViewContainingText:SysUTF8ToNSString(kResponse)];
NSDictionary* cookies = [ChromeEarlGrey cookies];
GREYAssertEqual(0U, cookies.count, @"No cookie should be found.");
@@ -659,13 +658,10 @@ bool IsCertificateCleared() {
// Visit |kUrlWithSetCookie| to set a cookie and then load |kUrl| to check it
// is still set.
[ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl(kUrlWithSetCookie)];
- [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewContainingText(
- kResponseWithSetCookie)]
- assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey
+ waitForWebViewContainingText:SysUTF8ToNSString(kResponseWithSetCookie)];
[ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl(kUrl)];
- [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewContainingText(
- kResponse)]
- assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey waitForWebViewContainingText:SysUTF8ToNSString(kResponse)];
cookies = [ChromeEarlGrey cookies];
GREYAssertEqualObjects(kCookieValue, cookies[kCookieName],
@@ -684,9 +680,7 @@ bool IsCertificateCleared() {
// Reload and test that there are no cookies left.
[ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl(kUrl)];
- [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewContainingText(
- kResponse)]
- assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey waitForWebViewContainingText:SysUTF8ToNSString(kResponse)];
cookies = [ChromeEarlGrey cookies];
GREYAssertEqual(0U, cookies.count, @"No cookie should be found.");

Powered by Google App Engine
This is Rietveld 408576698