Commit 42eac8bb authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Chromium LUCI CQ

[iOS] Add test for error pages

This CL adds a test to navigate back/forward to an error page and check
that the page correctly reloads.

Bug: none
Change-Id: I758c2cb5734fbbca9eb075e86e4ab3d44834ecdb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2615159Reviewed-by: default avatarAli Juma <ajuma@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841420}
parent 7e6890e7
......@@ -101,6 +101,27 @@ std::string GetErrorMessage() {
[ChromeEarlGrey waitForWebStateContainingText:"bar"];
}
// Loads the URL which fails to load, then sucessfully navigates back/forward to
// the page.
- (void)testNavigateForwardToErrorPage {
self.serverRespondsWithContent = YES;
[ChromeEarlGrey loadURL:self.testServer->GetURL("/echo-query?bar")];
[ChromeEarlGrey waitForWebStateContainingText:"bar"];
// No response leads to ERR_CONNECTION_CLOSED error.
self.serverRespondsWithContent = NO;
[ChromeEarlGrey loadURL:self.testServer->GetURL("/echo-query?foo")];
[ChromeEarlGrey waitForWebStateContainingText:GetErrorMessage()];
self.serverRespondsWithContent = YES;
[ChromeEarlGrey goBack];
[ChromeEarlGrey waitForWebStateContainingText:"bar"];
// Navigate forward to the error page, which should load without errors.
[ChromeEarlGrey goForward];
[ChromeEarlGrey waitForWebStateContainingText:"foo"];
}
// Loads the URL which fails to load, then sucessfully reloads the page.
- (void)testReloadErrorPage {
// No response leads to ERR_CONNECTION_CLOSED error.
......
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