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

Unified Diff: ios/web/public/test/earl_grey/web_view_matchers.mm

Issue 1950323002: Refactor web shell integration tests utilities. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: alphabetize Created 4 years, 7 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/public/test/earl_grey/web_view_matchers.mm
diff --git a/ios/web/shell/test/web_view_matchers.mm b/ios/web/public/test/earl_grey/web_view_matchers.mm
similarity index 83%
rename from ios/web/shell/test/web_view_matchers.mm
rename to ios/web/public/test/earl_grey/web_view_matchers.mm
index eb40c310e1df1a445fa1a019e2204f2a16bd467c..43007befe8c2c33985a398f9c5de6635173c1b6b 100644
--- a/ios/web/shell/test/web_view_matchers.mm
+++ b/ios/web/public/test/earl_grey/web_view_matchers.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import "ios/web/shell/test/web_view_matchers.h"
+#import "ios/web/public/test/earl_grey/web_view_matchers.h"
#import <WebKit/WebKit.h>
@@ -11,9 +11,8 @@
#include "base/strings/utf_string_conversions.h"
#include "base/test/ios/wait_util.h"
#include "base/values.h"
+#include "ios/web/public/test/navigation_test_util.h"
#include "ios/web/public/web_state/web_state.h"
-#include "ios/web/shell/test/navigation_test_util.h"
-#include "ios/web/shell/test/web_shell_test_util.h"
namespace {
@@ -30,24 +29,22 @@ char kGetDocumentBodyJavaScript[] =
namespace web {
-id<GREYMatcher> webViewContainingText(NSString* text) {
- return [GREYMatchers matcherForWebViewContainingText:text];
+id<GREYMatcher> webViewContainingText(NSString* text, web::WebState* webState) {
+ return
+ [GREYMatchers matcherForWebViewContainingText:text inWebState:webState];
}
} // namespace web
@implementation GREYMatchers (WebViewAdditions)
-+ (id<GREYMatcher>)matcherForWebViewContainingText:(NSString*)text {
++ (id<GREYMatcher>)matcherForWebViewContainingText:(NSString*)text
+ inWebState:(web::WebState*)webState {
MatchesBlock matches = ^BOOL(UIView* view) {
if (![view isKindOfClass:[WKWebView class]]) {
return NO;
}
Eugene But (OOO till 7-30) 2016/05/05 18:01:11 Check that |view| is descendant of |webState->GetV
baxley 2016/05/05 21:13:53 Done.
- ViewController* viewController =
- web::web_shell_test_util::GetCurrentViewController();
- web::WebState* webState = [viewController webState];
-
__block BOOL didSucceed = NO;
NSDate* deadline =
[NSDate dateWithTimeIntervalSinceNow:kWaitForWebElementTimeout];
@@ -79,4 +76,4 @@ id<GREYMatcher> webViewContainingText(NSString* text) {
autorelease];
}
-@end
+@end

Powered by Google App Engine
This is Rietveld 408576698