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

Unified Diff: ios/chrome/browser/web/progress_indicator_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/web/progress_indicator_egtest.mm
diff --git a/ios/chrome/browser/web/progress_indicator_egtest.mm b/ios/chrome/browser/web/progress_indicator_egtest.mm
index 36f6a9885525d6fb6952f385f52853e514787d16..9919acccee4dc0fec0f2050e2d046f431f57de62 100644
--- a/ios/chrome/browser/web/progress_indicator_egtest.mm
+++ b/ios/chrome/browser/web/progress_indicator_egtest.mm
@@ -7,6 +7,7 @@
#include "base/mac/foundation_util.h"
#include "base/memory/ptr_util.h"
#include "base/strings/stringprintf.h"
+#include "base/strings/sys_string_conversions.h"
#include "base/time/time.h"
#include "ios/chrome/browser/ui/ui_util.h"
#include "ios/chrome/test/app/navigation_test_util.h"
@@ -21,6 +22,7 @@
#include "ios/web/public/test/response_providers/html_response_provider.h"
#include "url/gurl.h"
+using base::SysUTF8ToNSString;
using chrome_test_util::WebViewContainingText;
namespace {
@@ -149,8 +151,7 @@ class InfinitePendingResponseProvider : public HtmlResponseProvider {
chrome_test_util::LoadUrl(infinitePendingURL);
// Wait until the page is half loaded.
- [[EarlGrey selectElementWithMatcher:WebViewContainingText(kPageText)]
- assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey waitForWebViewContainingText:SysUTF8ToNSString(kPageText)];
// Verify progress view visible and halfway progress.
[[EarlGrey selectElementWithMatcher:ProgressViewWithProgress(0.5)]
@@ -182,12 +183,16 @@ class InfinitePendingResponseProvider : public HtmlResponseProvider {
// Load form first.
[ChromeEarlGrey loadURL:formURL];
+ // TODO(crbug.com/707009): Replace this matcher with
+ // [ChromeEarlGrey waitForWebViewContainingText].
[[EarlGrey selectElementWithMatcher:WebViewContainingText(kFormPageText)]
assertWithMatcher:grey_notNil()];
chrome_test_util::SubmitWebViewFormWithId(kFormID);
// Wait until the page is half loaded.
+ // TODO(crbug.com/707009): Replace this matcher with
+ // [ChromeEarlGrey waitForWebViewContainingText].
[[EarlGrey selectElementWithMatcher:WebViewContainingText(kPageText)]
assertWithMatcher:grey_notNil()];
@@ -215,14 +220,13 @@ class InfinitePendingResponseProvider : public HtmlResponseProvider {
[ChromeEarlGrey loadURL:formURL];
- [[EarlGrey selectElementWithMatcher:WebViewContainingText(kFormPageText)]
- assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey
+ waitForWebViewContainingText:SysUTF8ToNSString(kFormPageText)];
chrome_test_util::SubmitWebViewFormWithId(kFormID);
// Verify the new page has been loaded.
- [[EarlGrey selectElementWithMatcher:WebViewContainingText(kPageText)]
- assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey waitForWebViewContainingText:SysUTF8ToNSString(kPageText)];
// Verify progress view is not visible.
[[EarlGrey selectElementWithMatcher:ProgressView()]
@@ -245,8 +249,8 @@ class InfinitePendingResponseProvider : public HtmlResponseProvider {
[ChromeEarlGrey loadURL:formURL];
// Verify the form page has been loaded.
- [[EarlGrey selectElementWithMatcher:WebViewContainingText(kFormPageText)]
- assertWithMatcher:grey_notNil()];
+ [ChromeEarlGrey
+ waitForWebViewContainingText:SysUTF8ToNSString(kFormPageText)];
chrome_test_util::SubmitWebViewFormWithId(kFormID);

Powered by Google App Engine
This is Rietveld 408576698