| Index: ios/web/navigation/window_location_inttest.mm
|
| diff --git a/ios/web/navigation/window_location_inttest.mm b/ios/web/navigation/window_location_inttest.mm
|
| index e5a16fba5ce8822ab9b2e9f6bed3340cc6dca4e4..e6d7aee417a09ab9470346fe662b8792ae44b258 100644
|
| --- a/ios/web/navigation/window_location_inttest.mm
|
| +++ b/ios/web/navigation/window_location_inttest.mm
|
| @@ -169,3 +169,20 @@ bool IsOnLoadTextVisible() {
|
| EXPECT_EQ(GetIndexOfNavigationItem(current_item) + 1,
|
| GetIndexOfNavigationItem(about_blank_item));
|
| }
|
| +
|
| +// Tests that calling window.location.replace() with an unresolvable URL loads
|
| +// about:blank.
|
| +TEST_F(WindowLocationTest, WindowLocationReplaceUnresolvable) {
|
| + // Attempt to call window.location.assign() using an unresolvable URL.
|
| + GURL about_blank("about:blank");
|
| + GURL unresolvable_url("http:https:not a url");
|
| + SetWindowLocationUrl(unresolvable_url);
|
| + ExecuteBlockAndWaitForLoad(about_blank, ^{
|
| + ASSERT_TRUE(web::test::TapWebViewElementWithId(web_state(),
|
| + kWindowLocationReplaceID));
|
| + });
|
| +
|
| + // Verify that about:blank was actually loaded.
|
| + EXPECT_EQ(about_blank,
|
| + navigation_manager()->GetLastCommittedItem()->GetURL());
|
| +}
|
|
|