| Index: ios/web/shell/test/web_shell_navigation_egtest.mm
|
| diff --git a/ios/web/shell/test/web_shell_navigation_egtest.mm b/ios/web/shell/test/web_shell_navigation_egtest.mm
|
| index d48ba1903da9cb3156aad17879903ce16dcf7c2c..174597e826888a1f83b705b320dc89ad771608dc 100644
|
| --- a/ios/web/shell/test/web_shell_navigation_egtest.mm
|
| +++ b/ios/web/shell/test/web_shell_navigation_egtest.mm
|
| @@ -9,11 +9,12 @@
|
| #import <EarlGrey/EarlGrey.h>
|
|
|
| #include "base/strings/sys_string_conversions.h"
|
| +#import "ios/web/public/test/earl_grey/web_view_matchers.h"
|
| #import "ios/web/public/test/http_server.h"
|
| #include "ios/web/public/test/http_server_util.h"
|
| -#include "ios/web/shell/test/navigation_test_util.h"
|
| -#import "ios/web/shell/test/shell_matchers.h"
|
| -#import "ios/web/shell/test/web_view_matchers.h"
|
| +#include "ios/web/public/test/navigation_test_util.h"
|
| +#include "ios/web/shell/test/app/web_shell_test_util.h"
|
| +#import "ios/web/shell/test/earl_grey/shell_matchers.h"
|
|
|
| // Navigation test cases for the web shell. These are Earl Grey integration
|
| // tests, which are based on XCTest.
|
| @@ -26,7 +27,9 @@
|
| // Set up called once for the class.
|
| + (void)setUp {
|
| [super setUp];
|
| - [[EarlGrey selectElementWithMatcher:web::webViewContainingText(@"Chromium")]
|
| + web::WebState* webState = web::web_shell_test_util::GetCurrentWebState();
|
| + [[EarlGrey selectElementWithMatcher:web::webViewContainingText(@"Chromium",
|
| + webState)]
|
| assertWithMatcher:grey_notNil()];
|
| web::test::HttpServer& server = web::test::HttpServer::GetSharedInstance();
|
| server.StartOrDie();
|
| @@ -62,26 +65,34 @@
|
|
|
| web::test::SetUpSimpleHttpServer(responses);
|
|
|
| - web::navigation_test_util::LoadUrl(URL1);
|
| + web::WebState* webState = web::web_shell_test_util::GetCurrentWebState();
|
|
|
| - [[EarlGrey selectElementWithMatcher:web::webViewContainingText(response1)]
|
| + web::navigation_test_util::LoadUrl(webState, URL1);
|
| +
|
| + [[EarlGrey
|
| + selectElementWithMatcher:web::webViewContainingText(response1, webState)]
|
| assertWithMatcher:grey_notNil()];
|
|
|
| - web::navigation_test_util::LoadUrl(URL2);
|
| + web::navigation_test_util::LoadUrl(webState, URL2);
|
|
|
| - [[EarlGrey selectElementWithMatcher:web::webViewContainingText(response2)]
|
| + [[EarlGrey
|
| + selectElementWithMatcher:web::webViewContainingText(response2, webState)]
|
| assertWithMatcher:grey_notNil()];
|
|
|
| - [[EarlGrey selectElementWithMatcher:web::backButton()]
|
| + //[[EarlGrey selectElementWithMatcher:web::backButton()]
|
| + [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Back")]
|
| performAction:grey_tap()];
|
|
|
| - [[EarlGrey selectElementWithMatcher:web::webViewContainingText(response1)]
|
| + [[EarlGrey
|
| + selectElementWithMatcher:web::webViewContainingText(response1, webState)]
|
| assertWithMatcher:grey_notNil()];
|
|
|
| - [[EarlGrey selectElementWithMatcher:web::forwardButton()]
|
| + //[[EarlGrey selectElementWithMatcher:web::forwardButton()]
|
| + [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Forward")]
|
| performAction:grey_tap()];
|
|
|
| - [[EarlGrey selectElementWithMatcher:web::webViewContainingText(response2)]
|
| + [[EarlGrey
|
| + selectElementWithMatcher:web::webViewContainingText(response2, webState)]
|
| assertWithMatcher:grey_notNil()];
|
| }
|
|
|
|
|