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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 1002953004: Ensure we properly set PageTransition for iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | content/renderer/render_frame_impl.cc » ('j') | content/renderer/render_frame_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/site_per_process_browsertest.cc
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index 15bd99883a0f44a89a916708ca04142ece54b91e..954a78fef2471b7998405a26f8ef077cbcd94dda 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -18,6 +18,7 @@
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/frame_messages.h"
+#include "content/public/browser/navigation_details.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
@@ -1960,4 +1961,33 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, RFPHDestruction) {
EXPECT_EQ("", DumpProxyHostSiteInstances(root));
}
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
Charlie Reis 2015/04/15 22:46:11 I'm torn between adding this test here (where it w
+ PageTransitionForSecondaryIframeNavigation) {
+ GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html"));
+ NavigateToURL(shell(), main_url);
+
+ // It is safe to obtain the root frame tree node here, as it doesn't change.
+ FrameTreeNode* root =
+ static_cast<WebContentsImpl*>(shell()->web_contents())->
+ GetFrameTree()->root();
+
+ TestNavigationObserver observer(shell()->web_contents());
+
+ // Load same-site page into iframe.
+ FrameTreeNode* child = root->child_at(0);
+ GURL http_url(embedded_test_server()->GetURL("/title1.html"));
+ NavigateFrameToURL(child, http_url);
+ EXPECT_EQ(http_url, observer.last_navigation_url());
+ EXPECT_TRUE(observer.last_navigation_succeeded());
+
+ // Load cross-site page into iframe.
+ TestFrameNavigationObserver frame_observer(child, 1);
+ GURL url = embedded_test_server()->GetURL("foo.com", "/title2.html");
+ NavigateIframeToURL(shell()->web_contents(), "test", url);
+ frame_observer.Wait();
+
+ EXPECT_EQ(NAVIGATION_TYPE_NEW_SUBFRAME,
Charlie Reis 2015/04/15 22:46:11 Please add a similar test for an initially cross-s
Nate Chapin 2015/04/17 21:48:18 That case reliably returns NAVIGATION_TYPE_NEW_SUB
Charlie Reis 2015/04/22 20:44:56 Sure, with a TODO to make it AUTO. I should be ab
+ frame_observer.load_committed_details().type);
+}
+
} // namespace content
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | content/renderer/render_frame_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698