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

Unified Diff: ios/web/shell/test/plugin_placeholder_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/web/shell/test/plugin_placeholder_egtest.mm
diff --git a/ios/web/shell/test/plugin_placeholder_egtest.mm b/ios/web/shell/test/plugin_placeholder_egtest.mm
index 5c8941c82ce1e8b4a69a028b853d9b60d3db00ca..9f4e54977b07ac12c1f7230819e78154eb88314c 100644
--- a/ios/web/shell/test/plugin_placeholder_egtest.mm
+++ b/ios/web/shell/test/plugin_placeholder_egtest.mm
@@ -8,6 +8,7 @@
#import <EarlGrey/EarlGrey.h>
#include "base/strings/stringprintf.h"
+#include "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
#import "ios/web/public/test/http_server.h"
#include "ios/web/public/test/http_server_util.h"
@@ -20,7 +21,7 @@
#error "This file requires ARC support."
#endif
-using web::WebViewContainingText;
+using base::SysUTF8ToNSString;
using web::WebViewCssSelector;
namespace {
@@ -57,10 +58,9 @@ void LoadPage(const std::string& page_content) {
LoadPage(page);
// Verify that placeholder image is not displayed.
- [[EarlGrey selectElementWithMatcher:WebViewContainingText(kPageDescription)]
- assertWithMatcher:grey_notNil()];
- [[EarlGrey selectElementWithMatcher:WebViewContainingText(kFallbackText)]
- assertWithMatcher:grey_notNil()];
+ [ShellEarlGrey
+ waitForWebViewContainingText:SysUTF8ToNSString(kPageDescription)];
+ [ShellEarlGrey waitForWebViewContainingText:SysUTF8ToNSString(kFallbackText)];
[[EarlGrey selectElementWithMatcher:WebViewCssSelector("img")]
assertWithMatcher:grey_nil()];
}
@@ -78,8 +78,8 @@ void LoadPage(const std::string& page_content) {
LoadPage(page);
// Verify that plugin object is replaced with placeholder image.
- [[EarlGrey selectElementWithMatcher:WebViewContainingText(kPageDescription)]
- assertWithMatcher:grey_notNil()];
+ [ShellEarlGrey
+ waitForWebViewContainingText:SysUTF8ToNSString(kPageDescription)];
[[EarlGrey selectElementWithMatcher:WebViewCssSelector("img[src*='data']")]
assertWithMatcher:grey_notNil()];
}
@@ -101,8 +101,8 @@ void LoadPage(const std::string& page_content) {
LoadPage(page);
// Verify that plugin object is replaced with placeholder image.
- [[EarlGrey selectElementWithMatcher:WebViewContainingText(kPageDescription)]
- assertWithMatcher:grey_notNil()];
+ [ShellEarlGrey
+ waitForWebViewContainingText:SysUTF8ToNSString(kPageDescription)];
[[EarlGrey selectElementWithMatcher:WebViewCssSelector("img[src*='data']")]
assertWithMatcher:grey_notNil()];
}
@@ -124,10 +124,9 @@ void LoadPage(const std::string& page_content) {
LoadPage(page);
// Verify that placeholder image is not displayed.
- [[EarlGrey selectElementWithMatcher:WebViewContainingText(kPageDescription)]
- assertWithMatcher:grey_notNil()];
- [[EarlGrey selectElementWithMatcher:WebViewContainingText(kFallbackText)]
- assertWithMatcher:grey_notNil()];
+ [ShellEarlGrey
+ waitForWebViewContainingText:SysUTF8ToNSString(kPageDescription)];
+ [ShellEarlGrey waitForWebViewContainingText:SysUTF8ToNSString(kFallbackText)];
[[EarlGrey selectElementWithMatcher:WebViewCssSelector("img")]
assertWithMatcher:grey_nil()];
}
@@ -146,8 +145,8 @@ void LoadPage(const std::string& page_content) {
LoadPage(page);
// Verify that plugin object is replaced with placeholder image.
- [[EarlGrey selectElementWithMatcher:WebViewContainingText(kPageDescription)]
- assertWithMatcher:grey_notNil()];
+ [ShellEarlGrey
+ waitForWebViewContainingText:SysUTF8ToNSString(kPageDescription)];
[[EarlGrey selectElementWithMatcher:WebViewCssSelector("img[src*='data']")]
assertWithMatcher:grey_notNil()];
}
@@ -165,8 +164,8 @@ void LoadPage(const std::string& page_content) {
LoadPage(page);
// Verify that placeholder image is not displayed.
- [[EarlGrey selectElementWithMatcher:WebViewContainingText(kPageDescription)]
- assertWithMatcher:grey_notNil()];
+ [ShellEarlGrey
+ waitForWebViewContainingText:SysUTF8ToNSString(kPageDescription)];
[[EarlGrey selectElementWithMatcher:WebViewCssSelector("img")]
assertWithMatcher:grey_nil()];
}
@@ -203,8 +202,8 @@ void LoadPage(const std::string& page_content) {
LoadPage(page);
// Verify that placeholder image is not displayed.
- [[EarlGrey selectElementWithMatcher:WebViewContainingText(kPageDescription)]
- assertWithMatcher:grey_notNil()];
+ [ShellEarlGrey
+ waitForWebViewContainingText:SysUTF8ToNSString(kPageDescription)];
[[EarlGrey selectElementWithMatcher:WebViewCssSelector("img")]
assertWithMatcher:grey_nil()];
}

Powered by Google App Engine
This is Rietveld 408576698