Commit 690207f6 authored by Fergal Daly's avatar Fergal Daly Committed by Commit Bot

Fix embedding token failure under CreateNewHostForSameSiteSubframe.

With CreateNewHostForSameSiteSubframe enabled, a new frame is created
and so we expect the embedding token to change.

Bug: 1064944
Change-Id: I8f9833cc5942c847b78a93ddfa021597771f5c34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2138991Reviewed-by: default avatarArthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: default avatarCalder Kitagawa <ckitagawa@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757062}
parent e275c1ef
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "base/unguessable_token.h" #include "base/unguessable_token.h"
#include "content/browser/frame_host/frame_tree.h" #include "content/browser/frame_host/frame_tree.h"
#include "content/browser/web_contents/web_contents_impl.h" #include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/content_navigation_policy.h"
#include "content/public/test/browser_test_utils.h" #include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h" #include "content/public/test/content_browser_test_utils.h"
...@@ -169,7 +170,13 @@ IN_PROC_BROWSER_TEST_F(EmbeddingTokenBrowserTest, ...@@ -169,7 +170,13 @@ IN_PROC_BROWSER_TEST_F(EmbeddingTokenBrowserTest,
b_url.Resolve("valid.html")); b_url.Resolve("valid.html"));
auto new_child_0_token = root->child_at(0)->GetEmbeddingToken(); auto new_child_0_token = root->child_at(0)->GetEmbeddingToken();
ASSERT_TRUE(new_child_0_token.has_value()); ASSERT_TRUE(new_child_0_token.has_value());
EXPECT_EQ(child_0_token, new_child_0_token); // If we are creating a new frame even for same-site navigations then we would
// expect a different token.
if (CreateNewHostForSameSiteSubframe()) {
EXPECT_NE(child_0_token, new_child_0_token);
} else {
EXPECT_EQ(child_0_token, new_child_0_token);
}
// TODO(ckitagawa): Somehow assert that the parent and child have matching // TODO(ckitagawa): Somehow assert that the parent and child have matching
// embedding tokens in parent HTMLOwnerElement and child LocalFrame. // embedding tokens in parent HTMLOwnerElement and child LocalFrame.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment