Commit ec602d0e authored by Mike Baxley's avatar Mike Baxley Committed by Commit Bot

Update cache_egtests.mm to use shared helpers.

ChromeEarlGrey has utilities to navigate back and reload.

Bug: 638674
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I78f7dc7af7e2f9e8a7d1585cafc91987ff6ec2aa
Reviewed-on: https://chromium-review.googlesource.com/777603Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Mike Baxley <baxley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517872}
parent a32f9906
...@@ -155,22 +155,6 @@ class ScopedBlockPopupsPref { ...@@ -155,22 +155,6 @@ class ScopedBlockPopupsPref {
@implementation CacheTestCase @implementation CacheTestCase
// Reloads the web view and waits for the loading to complete.
// TODO(crbug.com/638674): Evaluate if this can move to shared code
- (void)reloadPage {
[chrome_test_util::BrowserCommandDispatcherForMainBVC() reload];
[ChromeEarlGrey waitForPageToFinishLoading];
}
// Navigates back to the previous webpage.
// TODO(crbug.com/638674): Evaluate if this can move to shared code.
- (void)goBack {
[chrome_test_util::BrowserCommandDispatcherForMainBVC() goBack];
[ChromeEarlGrey waitForPageToFinishLoading];
}
// Tests caching behavior on navigate back and page reload. Navigate back should // Tests caching behavior on navigate back and page reload. Navigate back should
// use the cached page. Page reload should use cache-control in the request // use the cached page. Page reload should use cache-control in the request
// header and show updated page. // header and show updated page.
...@@ -196,12 +180,12 @@ class ScopedBlockPopupsPref { ...@@ -196,12 +180,12 @@ class ScopedBlockPopupsPref {
// Navigate back. This should not hit the server. Verify the page has been // Navigate back. This should not hit the server. Verify the page has been
// loaded from cache. The serverHitCounter will remain the same. // loaded from cache. The serverHitCounter will remain the same.
[self goBack]; [ChromeEarlGrey goBack];
[ChromeEarlGrey waitForWebViewContainingText:"serverHitCounter: 1"]; [ChromeEarlGrey waitForWebViewContainingText:"serverHitCounter: 1"];
// Reload page. 3rd hit to server. Verify that page reload causes the // Reload page. 3rd hit to server. Verify that page reload causes the
// hitCounter to show updated value. // hitCounter to show updated value.
[self reloadPage]; [ChromeEarlGrey reload];
[ChromeEarlGrey waitForWebViewContainingText:"serverHitCounter: 3"]; [ChromeEarlGrey waitForWebViewContainingText:"serverHitCounter: 3"];
// Verify that page reload causes Cache-Control value to be sent with request. // Verify that page reload causes Cache-Control value to be sent with request.
......
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