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

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

Issue 1467783002: Use FrameTreeNode::current_origin() in more places. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/frame_tree_browsertest.cc
diff --git a/content/browser/frame_host/frame_tree_browsertest.cc b/content/browser/frame_host/frame_tree_browsertest.cc
index b9e3b43bd796c24b40ff46857c2b4f2dbdd0d546..f64e22733db5b3dfe059febad28daa4e5dc797b6 100644
--- a/content/browser/frame_host/frame_tree_browsertest.cc
+++ b/content/browser/frame_host/frame_tree_browsertest.cc
@@ -215,26 +215,25 @@ IN_PROC_BROWSER_TEST_F(FrameTreeBrowserTest, OriginSetOnNavigation) {
// Extra '/' is added because the replicated origin is serialized in RFC 6454
// format, which dictates no trailing '/', whereas GURL::GetOrigin does put a
// '/' at the end.
- EXPECT_EQ(root->current_replication_state().origin.Serialize() + '/',
+ EXPECT_EQ(root->current_origin().Serialize() + '/',
main_url.GetOrigin().spec());
GURL frame_url(embedded_test_server()->GetURL("/title1.html"));
NavigateFrameToURL(root->child_at(0), frame_url);
- EXPECT_EQ(
- root->child_at(0)->current_replication_state().origin.Serialize() + '/',
- frame_url.GetOrigin().spec());
+ EXPECT_EQ(root->child_at(0)->current_origin().Serialize() + '/',
+ frame_url.GetOrigin().spec());
GURL data_url("data:text/html,foo");
EXPECT_TRUE(NavigateToURL(shell(), data_url));
// Navigating to a data URL should set a unique origin. This is represented
// as "null" per RFC 6454.
- EXPECT_EQ(root->current_replication_state().origin.Serialize(), "null");
+ EXPECT_EQ(root->current_origin().Serialize(), "null");
// Re-navigating to a normal URL should update the origin.
EXPECT_TRUE(NavigateToURL(shell(), main_url));
- EXPECT_EQ(root->current_replication_state().origin.Serialize() + '/',
+ EXPECT_EQ(root->current_origin().Serialize() + '/',
main_url.GetOrigin().spec());
}
@@ -266,13 +265,10 @@ IN_PROC_BROWSER_TEST_F(FrameTreeBrowserTest, SandboxFlagsSetForChildFrames) {
// Sandboxed frames should set a unique origin unless they have the
// "allow-same-origin" directive.
- EXPECT_EQ(root->child_at(0)->current_replication_state().origin.Serialize(),
- "null");
- EXPECT_EQ(root->child_at(1)->current_replication_state().origin.Serialize(),
- "null");
- EXPECT_EQ(
- root->child_at(2)->current_replication_state().origin.Serialize() + "/",
- main_url.GetOrigin().spec());
+ EXPECT_EQ(root->child_at(0)->current_origin().Serialize(), "null");
+ EXPECT_EQ(root->child_at(1)->current_origin().Serialize(), "null");
+ EXPECT_EQ(root->child_at(2)->current_origin().Serialize() + "/",
+ main_url.GetOrigin().spec());
// Navigating to a different URL should not clear sandbox flags.
GURL frame_url(embedded_test_server()->GetURL("/title1.html"));
@@ -393,32 +389,29 @@ IN_PROC_BROWSER_TEST_F(CrossProcessFrameTreeBrowserTest,
FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents())
->GetFrameTree()->root();
- EXPECT_EQ(root->current_replication_state().origin.Serialize() + '/',
+ EXPECT_EQ(root->current_origin().Serialize() + '/',
main_url.GetOrigin().spec());
// First frame is an about:blank frame. Check that its origin is correctly
// inherited from the parent.
- EXPECT_EQ(
- root->child_at(0)->current_replication_state().origin.Serialize() + '/',
- main_url.GetOrigin().spec());
+ EXPECT_EQ(root->child_at(0)->current_origin().Serialize() + '/',
+ main_url.GetOrigin().spec());
// Second frame loads a same-site page. Its origin should also be the same
// as the parent.
- EXPECT_EQ(
- root->child_at(1)->current_replication_state().origin.Serialize() + '/',
- main_url.GetOrigin().spec());
+ EXPECT_EQ(root->child_at(1)->current_origin().Serialize() + '/',
+ main_url.GetOrigin().spec());
// Load cross-site page into the first frame.
GURL cross_site_url(
embedded_test_server()->GetURL("foo.com", "/title2.html"));
NavigateFrameToURL(root->child_at(0), cross_site_url);
- EXPECT_EQ(
- root->child_at(0)->current_replication_state().origin.Serialize() + '/',
- cross_site_url.GetOrigin().spec());
+ EXPECT_EQ(root->child_at(0)->current_origin().Serialize() + '/',
+ cross_site_url.GetOrigin().spec());
// The root's origin shouldn't have changed.
- EXPECT_EQ(root->current_replication_state().origin.Serialize() + '/',
+ EXPECT_EQ(root->current_origin().Serialize() + '/',
main_url.GetOrigin().spec());
GURL data_url("data:text/html,foo");
@@ -426,8 +419,7 @@ IN_PROC_BROWSER_TEST_F(CrossProcessFrameTreeBrowserTest,
// Navigating to a data URL should set a unique origin. This is represented
// as "null" per RFC 6454.
- EXPECT_EQ(root->child_at(1)->current_replication_state().origin.Serialize(),
- "null");
+ EXPECT_EQ(root->child_at(1)->current_origin().Serialize(), "null");
}
} // namespace content
« no previous file with comments | « no previous file | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698