| 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 e6d7aee417a09ab9470346fe662b8792ae44b258..b3e31d534be0f7bf7ad498715064de86463e9614 100644
|
| --- a/ios/web/navigation/window_location_inttest.mm
|
| +++ b/ios/web/navigation/window_location_inttest.mm
|
| @@ -38,6 +38,7 @@
|
| // Button IDs used in the window.location test page.
|
| const char kWindowLocationAssignID[] = "location-assign";
|
| const char kWindowLocationReplaceID[] = "location-replace";
|
| +const char kWindowLocationReloadID[] = "location-reload";
|
|
|
| // JavaScript functions on the window.location test page.
|
| NSString* const kUpdateURLScriptFormat = @"updateUrlToLoadText('%s')";
|
| @@ -186,3 +187,17 @@ bool IsOnLoadTextVisible() {
|
| EXPECT_EQ(about_blank,
|
| navigation_manager()->GetLastCommittedItem()->GetURL());
|
| }
|
| +
|
| +// Tests that calling window.location.reload() causes an onload event to occur.
|
| +TEST_F(WindowLocationTest, WindowLocationReload) {
|
| + // Tap the window.location.reload() button.
|
| + ExecuteBlockAndWaitForLoad(window_location_url(), ^{
|
| + ASSERT_TRUE(web::test::TapWebViewElementWithId(web_state(),
|
| + kWindowLocationReloadID));
|
| + });
|
| +
|
| + // Verify that |kOnLoadText| is displayed and that no additional
|
| + // NavigationItems are added.
|
| + EXPECT_TRUE(IsOnLoadTextVisible());
|
| + EXPECT_EQ(1, navigation_manager()->GetItemCount());
|
| +}
|
|
|