Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(588)

Unified Diff: ios/web/navigation/window_location_inttest.mm

Issue 2597133003: Created a test for window.location.reload(). (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698