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

Unified Diff: content/browser/site_instance_impl_unittest.cc

Issue 2494633004: Remove about:srcdoc url conversion. (Closed)
Patch Set: Fix tests with about::blank Created 4 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
Index: content/browser/site_instance_impl_unittest.cc
diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc
index 2523cfc34799977f20dfeb6098aac3477236cd73..bbc97b9bb9083e59036d60642e74bebb4b2d35cc 100644
--- a/content/browser/site_instance_impl_unittest.cc
+++ b/content/browser/site_instance_impl_unittest.cc
@@ -393,6 +393,7 @@ TEST_F(SiteInstanceTest, IsSameWebSite) {
GURL url_foo_port = GURL("http://foo:8080/a.html");
GURL url_javascript = GURL("javascript:alert(1);");
GURL url_blank = GURL(url::kAboutBlankURL);
+ GURL url_srcdoc = GURL(content::kAboutSrcDocURL);
// Same scheme and port -> same site.
EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, url_foo, url_foo2));
@@ -411,15 +412,22 @@ TEST_F(SiteInstanceTest, IsSameWebSite) {
EXPECT_TRUE(
SiteInstance::IsSameWebSite(nullptr, url_javascript, url_foo_port));
- // Navigating to a blank page is considered the same site.
+ // Navigating to a blank page or about:srcdoc is considered the same site.
Charlie Reis 2016/11/22 01:01:20 As mentioned earlier, let's leave this out, or may
arthursonzogni 2016/11/22 16:43:27 Done (see above).
EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, url_foo, url_blank));
EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, url_foo_https, url_blank));
EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, url_foo_port, url_blank));
+ EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, url_foo, url_srcdoc));
+ EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, url_foo_https, url_srcdoc));
+ EXPECT_TRUE(SiteInstance::IsSameWebSite(nullptr, url_foo_port, url_srcdoc));
- // Navigating from a blank site is not considered to be the same site.
+ // Navigating from a blank site or from about:srcdoc is not considered to be
+ // the same site.
EXPECT_FALSE(SiteInstance::IsSameWebSite(nullptr, url_blank, url_foo));
EXPECT_FALSE(SiteInstance::IsSameWebSite(nullptr, url_blank, url_foo_https));
EXPECT_FALSE(SiteInstance::IsSameWebSite(nullptr, url_blank, url_foo_port));
+ EXPECT_FALSE(SiteInstance::IsSameWebSite(nullptr, url_srcdoc, url_foo));
+ EXPECT_FALSE(SiteInstance::IsSameWebSite(nullptr, url_srcdoc, url_foo_https));
+ EXPECT_FALSE(SiteInstance::IsSameWebSite(nullptr, url_srcdoc, url_foo_port));
DrainMessageLoop();
}

Powered by Google App Engine
This is Rietveld 408576698