Commit 2e1715b9 authored by Aaron Colwell's avatar Aaron Colwell Committed by Commit Bot

Remove old default SiteInstance test code.

Removing old test code that is no longer correct and was not even
being used anymore. The comment in the block being removed refers to a
bug that has been closed for over a year. The coverage data also
shows that this path was no longer executed. I also removed a
--site-per-process early return that is no longer needed because that
case is handled by the AreDefaultSiteInstancesEnabled() comparison.

Bug: 1015882
Change-Id: I8664a2818b7678984b483138eca625b714f9f0e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2490869
Auto-Submit: Aaron Colwell <acolwell@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: Aaron Colwell <acolwell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819887}
parent 63a73efd
...@@ -427,13 +427,6 @@ TEST_F(SiteInstanceTest, SiteInstanceDestructor) { ...@@ -427,13 +427,6 @@ TEST_F(SiteInstanceTest, SiteInstanceDestructor) {
// Ensure that default SiteInstances are deleted when all references to them // Ensure that default SiteInstances are deleted when all references to them
// are gone. // are gone.
TEST_F(SiteInstanceTest, DefaultSiteInstanceDestruction) { TEST_F(SiteInstanceTest, DefaultSiteInstanceDestruction) {
// Skip this test case if the --site-per-process switch is present (e.g. on
// Site Isolation Android chromium.fyi bot).
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSitePerProcess)) {
return;
}
TestBrowserContext browser_context; TestBrowserContext browser_context;
base::test::ScopedCommandLine scoped_command_line; base::test::ScopedCommandLine scoped_command_line;
...@@ -447,23 +440,10 @@ TEST_F(SiteInstanceTest, DefaultSiteInstanceDestruction) { ...@@ -447,23 +440,10 @@ TEST_F(SiteInstanceTest, DefaultSiteInstanceDestruction) {
auto site_instance = SiteInstanceImpl::CreateForUrlInfo( auto site_instance = SiteInstanceImpl::CreateForUrlInfo(
&browser_context, UrlInfo::CreateForTesting(GURL("http://foo.com")), &browser_context, UrlInfo::CreateForTesting(GURL("http://foo.com")),
CoopCoepCrossOriginIsolatedInfo::CreateNonIsolated()); CoopCoepCrossOriginIsolatedInfo::CreateNonIsolated());
if (AreDefaultSiteInstancesEnabled()) {
EXPECT_TRUE(site_instance->IsDefaultSiteInstance()); EXPECT_EQ(AreDefaultSiteInstancesEnabled(),
} else { site_instance->IsDefaultSiteInstance());
// TODO(958060): Remove the creation of this second instance once
// CreateForUrlInfo() starts returning a default SiteInstance without
// the need to specify a command-line flag.
EXPECT_FALSE(site_instance->IsDefaultSiteInstance());
auto related_instance =
site_instance->GetRelatedSiteInstance(GURL("http://bar.com"));
EXPECT_TRUE(static_cast<SiteInstanceImpl*>(related_instance.get())
->IsDefaultSiteInstance());
related_instance.reset();
EXPECT_EQ(1, browser_client()->GetAndClearSiteInstanceDeleteCount());
EXPECT_EQ(0, browser_client()->GetAndClearBrowsingInstanceDeleteCount());
}
site_instance.reset(); site_instance.reset();
EXPECT_EQ(1, browser_client()->GetAndClearSiteInstanceDeleteCount()); EXPECT_EQ(1, browser_client()->GetAndClearSiteInstanceDeleteCount());
......
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