| 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 4e91f776861af486943e0b7012180303fd2da6e2..e5a16fba5ce8822ab9b2e9f6bed3340cc6dca4e4 100644
|
| --- a/ios/web/navigation/window_location_inttest.mm
|
| +++ b/ios/web/navigation/window_location_inttest.mm
|
| @@ -121,6 +121,23 @@ bool IsOnLoadTextVisible() {
|
| EXPECT_EQ(NSNotFound, GetIndexOfNavigationItem(about_blank_item));
|
| }
|
|
|
| +// Tests that calling window.location.assign() with an unresolvable URL loads
|
| +// about:blank.
|
| +TEST_F(WindowLocationTest, WindowLocationAssignUnresolvable) {
|
| + // 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(),
|
| + kWindowLocationAssignID));
|
| + });
|
| +
|
| + // Verify that about:blank was actually loaded.
|
| + EXPECT_EQ(about_blank,
|
| + navigation_manager()->GetLastCommittedItem()->GetURL());
|
| +}
|
| +
|
| // Tests that calling window.location.replace() doesn't create a new
|
| // NavigationItem.
|
| // TODO(crbug.com/307072): Enable test when location.replace is fixed.
|
|
|