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

Side by Side Diff: content/browser/site_instance_impl_unittest.cc

Issue 1144253003: Remove --enable-strict-site-isolation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Charlie's fixes Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « content/browser/site_instance_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/memory/scoped_vector.h" 7 #include "base/memory/scoped_vector.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "content/browser/browser_thread_impl.h" 9 #include "content/browser/browser_thread_impl.h"
10 #include "content/browser/browsing_instance.h" 10 #include "content/browser/browsing_instance.h"
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 560
561 static SiteInstanceImpl* CreateSiteInstance(BrowserContext* browser_context, 561 static SiteInstanceImpl* CreateSiteInstance(BrowserContext* browser_context,
562 const GURL& url) { 562 const GURL& url) {
563 return static_cast<SiteInstanceImpl*>( 563 return static_cast<SiteInstanceImpl*>(
564 SiteInstance::CreateForURL(browser_context, url)); 564 SiteInstance::CreateForURL(browser_context, url));
565 } 565 }
566 566
567 // Test to ensure that pages that require certain privileges are grouped 567 // Test to ensure that pages that require certain privileges are grouped
568 // in processes with similar pages. 568 // in processes with similar pages.
569 TEST_F(SiteInstanceTest, ProcessSharingByType) { 569 TEST_F(SiteInstanceTest, ProcessSharingByType) {
570 // This test shouldn't run with --site-per-process or 570 // This test shouldn't run with --site-per-process mode, which prohibits
571 // --enable-strict-site-isolation modes, since they don't allow render 571 // the renderer process reuse this test explicitly exercises.
572 // process reuse, which this test explicitly exercises.
573 const base::CommandLine& command_line = 572 const base::CommandLine& command_line =
574 *base::CommandLine::ForCurrentProcess(); 573 *base::CommandLine::ForCurrentProcess();
575 if (command_line.HasSwitch(switches::kSitePerProcess) || 574 if (command_line.HasSwitch(switches::kSitePerProcess))
576 command_line.HasSwitch(switches::kEnableStrictSiteIsolation))
577 return; 575 return;
578 576
579 // On Android by default the number of renderer hosts is unlimited and process 577 // On Android by default the number of renderer hosts is unlimited and process
580 // sharing doesn't happen. We set the override so that the test can run 578 // sharing doesn't happen. We set the override so that the test can run
581 // everywhere. 579 // everywhere.
582 RenderProcessHost::SetMaxRendererProcessCount(kMaxRendererProcessCount); 580 RenderProcessHost::SetMaxRendererProcessCount(kMaxRendererProcessCount);
583 581
584 ChildProcessSecurityPolicyImpl* policy = 582 ChildProcessSecurityPolicyImpl* policy =
585 ChildProcessSecurityPolicyImpl::GetInstance(); 583 ChildProcessSecurityPolicyImpl::GetInstance();
586 584
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 EXPECT_TRUE(instance->GetSiteURL().is_empty()); 778 EXPECT_TRUE(instance->GetSiteURL().is_empty());
781 host.reset(instance->GetProcess()); 779 host.reset(instance->GetProcess());
782 780
783 EXPECT_FALSE(RenderProcessHostImpl::GetProcessHostForSite( 781 EXPECT_FALSE(RenderProcessHostImpl::GetProcessHostForSite(
784 browser_context.get(), GURL())); 782 browser_context.get(), GURL()));
785 783
786 DrainMessageLoops(); 784 DrainMessageLoops();
787 } 785 }
788 786
789 } // namespace content 787 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/site_instance_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698