Commit 5b84dd9c authored by Eugene But's avatar Eugene But Committed by Commit Bot

Revert "Fix testRepostFormAfterReload for slim-nav."

This reverts commit 137ad170.

Reason for revert: Fix did not help

Original change's description:
> Fix testRepostFormAfterReload for slim-nav.
> 
> crrev.com/c/1632591 changed test behavior to wait until reload is
> finished for slim nav, which broke the test.
> 
> This CL restores the original behavior, so the test does not wait until
> reload is finished.
> 
> Added -[ChromeEarlGreyImpl reloadAndWaitForCompletion:] to compliment
> existing -[ChromeEarlGreyImpl loadURL:waitForCompletion:]
> 
> Bug: 968296
> Change-Id: I86d1d982424ee4f56c64ac4cae522f1070d116ab
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1636570
> Commit-Queue: Eugene But <eugenebut@chromium.org>
> Reviewed-by: Justin Cohen <justincohen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#664544}

TBR=justincohen@chromium.org,eugenebut@chromium.org

Change-Id: Iaedd550ba2dde2abca2c52849a41951f8ba2c336
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 968296
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1636921Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664609}
parent a2a6febd
...@@ -225,7 +225,7 @@ id<GREYMatcher> ResendPostButtonMatcher() { ...@@ -225,7 +225,7 @@ id<GREYMatcher> ResendPostButtonMatcher() {
// WKBasedNavigationManager presents repost confirmation dialog before loading // WKBasedNavigationManager presents repost confirmation dialog before loading
// stops. // stops.
if (web::GetWebClient()->IsSlimNavigationManagerEnabled()) { if (web::GetWebClient()->IsSlimNavigationManagerEnabled()) {
[ChromeEarlGrey reloadAndWaitForCompletion:NO]; [ChromeEarlGrey reload];
} else { } else {
// Legacy navigation manager presents repost confirmation dialog after // Legacy navigation manager presents repost confirmation dialog after
// loading stops. // loading stops.
...@@ -262,7 +262,7 @@ id<GREYMatcher> ResendPostButtonMatcher() { ...@@ -262,7 +262,7 @@ id<GREYMatcher> ResendPostButtonMatcher() {
// [ChromeEarlGrey reload] because WKBasedNavigationManager presents repost // [ChromeEarlGrey reload] because WKBasedNavigationManager presents repost
// confirmation dialog before loading stops. // confirmation dialog before loading stops.
if (web::GetWebClient()->IsSlimNavigationManagerEnabled()) { if (web::GetWebClient()->IsSlimNavigationManagerEnabled()) {
[ChromeEarlGrey reloadAndWaitForCompletion:NO]; [ChromeEarlGrey reload];
} }
[self confirmResendWarning]; [self confirmResendWarning];
...@@ -294,7 +294,7 @@ id<GREYMatcher> ResendPostButtonMatcher() { ...@@ -294,7 +294,7 @@ id<GREYMatcher> ResendPostButtonMatcher() {
// [ChromeEarlGrey reload] because WKBasedNavigationManager presents repost // [ChromeEarlGrey reload] because WKBasedNavigationManager presents repost
// confirmation dialog before loading stops. // confirmation dialog before loading stops.
if (web::GetWebClient()->IsSlimNavigationManagerEnabled()) { if (web::GetWebClient()->IsSlimNavigationManagerEnabled()) {
[ChromeEarlGrey reloadAndWaitForCompletion:NO]; [ChromeEarlGrey reload];
} }
[self confirmResendWarning]; [self confirmResendWarning];
...@@ -360,7 +360,7 @@ id<GREYMatcher> ResendPostButtonMatcher() { ...@@ -360,7 +360,7 @@ id<GREYMatcher> ResendPostButtonMatcher() {
// [ChromeEarlGrey reload] because WKBasedNavigationManager presents repost // [ChromeEarlGrey reload] because WKBasedNavigationManager presents repost
// confirmation dialog before loading stops. // confirmation dialog before loading stops.
if (web::GetWebClient()->IsSlimNavigationManagerEnabled()) { if (web::GetWebClient()->IsSlimNavigationManagerEnabled()) {
[ChromeEarlGrey reloadAndWaitForCompletion:NO]; [ChromeEarlGrey reload];
} }
[[EarlGrey selectElementWithMatcher:ElementToDismissAlert(@"Cancel")] [[EarlGrey selectElementWithMatcher:ElementToDismissAlert(@"Cancel")]
...@@ -408,7 +408,7 @@ id<GREYMatcher> ResendPostButtonMatcher() { ...@@ -408,7 +408,7 @@ id<GREYMatcher> ResendPostButtonMatcher() {
// WKBasedNavigationManager presents repost confirmation dialog before loading // WKBasedNavigationManager presents repost confirmation dialog before loading
// stops. // stops.
if (web::GetWebClient()->IsSlimNavigationManagerEnabled()) { if (web::GetWebClient()->IsSlimNavigationManagerEnabled()) {
[ChromeEarlGrey reloadAndWaitForCompletion:NO]; [ChromeEarlGrey reload];
} else { } else {
// Legacy navigation manager presents repost confirmation dialog after // Legacy navigation manager presents repost confirmation dialog after
// loading stops. // loading stops.
......
...@@ -64,10 +64,6 @@ id ExecuteJavaScript(NSString* javascript, NSError* __autoreleasing* out_error); ...@@ -64,10 +64,6 @@ id ExecuteJavaScript(NSString* javascript, NSError* __autoreleasing* out_error);
// Returns YES if the current WebState is loading. // Returns YES if the current WebState is loading.
- (BOOL)isLoading WARN_UNUSED_RESULT; - (BOOL)isLoading WARN_UNUSED_RESULT;
// If |wait| is YES, waits for the loading to complete within a timeout, or a
// GREYAssert is induced.
- (void)reloadAndWaitForCompletion:(BOOL)wait;
// Reloads the page and waits for the loading to complete within a timeout, or a // Reloads the page and waits for the loading to complete within a timeout, or a
// GREYAssert is induced. // GREYAssert is induced.
// TODO(crbug.com/963613): Change return type to void when // TODO(crbug.com/963613): Change return type to void when
......
...@@ -80,15 +80,9 @@ GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(ChromeEarlGreyAppInterface) ...@@ -80,15 +80,9 @@ GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(ChromeEarlGreyAppInterface)
return nil; return nil;
} }
- (void)reloadAndWaitForCompletion:(BOOL)wait {
[ChromeEarlGreyAppInterface startReloading];
if (wait) {
[self waitForPageToFinishLoading];
}
}
- (NSError*)reload { - (NSError*)reload {
[self reloadAndWaitForCompletion:YES]; [ChromeEarlGreyAppInterface startReloading];
[self waitForPageToFinishLoading];
return nil; return nil;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment