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

Unified Diff: content/browser/frame_host/navigation_controller_impl_unittest.cc

Issue 2275643003: Notify about PageState changes after an AUTO_SUBFRAME commit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch to ASSERT_TRUE. Created 4 years, 4 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 | « content/browser/frame_host/navigation_controller_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl_unittest.cc
diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc
index ca8034bbe636d9519d9f8a9fd2ecd0c183c3c7f1..45a1614b674a6af7ced90e278a722e5c563e4116 100644
--- a/content/browser/frame_host/navigation_controller_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc
@@ -2196,7 +2196,13 @@ TEST_F(NavigationControllerTest, NewSubframe) {
subframe->SendRendererInitiatedNavigationRequest(subframe_url, false);
subframe->PrepareForCommit();
subframe->SendNavigateWithParams(&params);
- EXPECT_EQ(0U, notifications.size());
+
+ // In UseSubframeNavigationEntries mode, we notify of a PageState update to
+ // the entry here rather than during UpdateState.
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries())
+ EXPECT_TRUE(notifications.Check1AndReset(NOTIFICATION_NAV_ENTRY_CHANGED));
+ else
+ EXPECT_EQ(0U, notifications.size());
}
// Now do a new navigation in the frame.
@@ -2283,7 +2289,13 @@ TEST_F(NavigationControllerTest, AutoSubframe) {
subframe->SendRendererInitiatedNavigationRequest(url2, false);
subframe->PrepareForCommit();
subframe->SendNavigateWithParams(&params);
- EXPECT_EQ(0U, notifications.size());
+
+ // In UseSubframeNavigationEntries mode, we notify of a PageState update to
+ // the entry here rather than during UpdateState.
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries())
+ EXPECT_TRUE(notifications.Check1AndReset(NOTIFICATION_NAV_ENTRY_CHANGED));
+ else
+ EXPECT_EQ(0U, notifications.size());
}
// There should still be only one entry.
@@ -2332,7 +2344,13 @@ TEST_F(NavigationControllerTest, AutoSubframe) {
subframe2->SendRendererInitiatedNavigationRequest(url3, false);
subframe2->PrepareForCommit();
subframe2->SendNavigateWithParams(&params);
- EXPECT_EQ(0U, notifications.size());
+
+ // In UseSubframeNavigationEntries mode, we notify of a PageState update to
+ // the entry here rather than during UpdateState.
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries())
+ EXPECT_TRUE(notifications.Check1AndReset(NOTIFICATION_NAV_ENTRY_CHANGED));
+ else
+ EXPECT_EQ(0U, notifications.size());
}
// There should still be only one entry, mostly unchanged.
@@ -2386,7 +2404,13 @@ TEST_F(NavigationControllerTest, AutoSubframe) {
subframe3->SendRendererInitiatedNavigationRequest(url4, false);
subframe3->PrepareForCommit();
subframe3->SendNavigateWithParams(&params);
- EXPECT_EQ(0U, notifications.size());
+
+ // In UseSubframeNavigationEntries mode, we notify of a PageState update to
+ // the entry here rather than during UpdateState.
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries())
+ EXPECT_TRUE(notifications.Check1AndReset(NOTIFICATION_NAV_ENTRY_CHANGED));
+ else
+ EXPECT_EQ(0U, notifications.size());
}
// There should still be only one entry, mostly unchanged.
@@ -2455,7 +2479,13 @@ TEST_F(NavigationControllerTest, BackSubframe) {
subframe->SendRendererInitiatedNavigationRequest(subframe_url, false);
subframe->PrepareForCommit();
subframe->SendNavigateWithParams(&params);
- EXPECT_EQ(0U, notifications.size());
+
+ // In UseSubframeNavigationEntries mode, we notify of a PageState update to
+ // the entry here rather than during UpdateState.
+ if (SiteIsolationPolicy::UseSubframeNavigationEntries())
+ EXPECT_TRUE(notifications.Check1AndReset(NOTIFICATION_NAV_ENTRY_CHANGED));
+ else
+ EXPECT_EQ(0U, notifications.size());
}
// First manual subframe navigation.
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698