Chromium Code Reviews| 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 3da12faab80a7ca48ea1ee9960e95c7c27417c40..0dee49093045da8bb83921ac4a28796d888a9023 100644 |
| --- a/ios/web/navigation/window_location_inttest.mm |
| +++ b/ios/web/navigation/window_location_inttest.mm |
| @@ -41,6 +41,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. |
| const char kUpdateURLScriptFormat[] = "updateUrlToLoadText('%s')"; |
| @@ -285,3 +286,17 @@ NSInteger GetIndexOfNavigationItem(const web::NavigationItem* item) { |
| 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. |
| + ExpectPageLoad(window_location_url()); |
| + ASSERT_TRUE( |
| + web::test::TapWebViewElementWithId(web_state(), kWindowLocationReloadID)); |
| + WaitForPageToLoad(); |
| + |
| + // Verify that |kOnLoadText| is displayed and that no additional |
| + // NavigationItems are added. |
| + EXPECT_TRUE(IsOnLoadTextVisible()); |
| + EXPECT_EQ(1, (NSInteger)navigation_manager()->GetItemCount()); |
|
Eugene But (OOO till 7-30)
2016/12/23 01:57:34
Please don't use C-style casting, also this would
kkhorimoto
2017/01/20 00:38:20
Done.
|
| +} |