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

Side by Side Diff: content/browser/renderer_host/render_process_host_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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <limits> 5 #include <limits>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/public/common/content_constants.h" 8 #include "content/public/common/content_constants.h"
9 #include "content/public/common/content_switches.h" 9 #include "content/public/common/content_switches.h"
10 #include "content/public/test/mock_render_process_host.h" 10 #include "content/public/test/mock_render_process_host.h"
(...skipping 15 matching lines...) Expand all
26 &guest_host, browser_context(), test_url)); 26 &guest_host, browser_context(), test_url));
27 EXPECT_TRUE(RenderProcessHostImpl::IsSuitableHost( 27 EXPECT_TRUE(RenderProcessHostImpl::IsSuitableHost(
28 process(), browser_context(), test_url)); 28 process(), browser_context(), test_url));
29 EXPECT_EQ( 29 EXPECT_EQ(
30 process(), 30 process(),
31 RenderProcessHost::GetExistingProcessHost(browser_context(), test_url)); 31 RenderProcessHost::GetExistingProcessHost(browser_context(), test_url));
32 } 32 }
33 33
34 #if !defined(OS_ANDROID) 34 #if !defined(OS_ANDROID)
35 TEST_F(RenderProcessHostUnitTest, RendererProcessLimit) { 35 TEST_F(RenderProcessHostUnitTest, RendererProcessLimit) {
36 // This test shouldn't run with --site-per-process or 36 // This test shouldn't run with --site-per-process mode, which prohibits
37 // --enable-strict-site-isolation modes, since they don't allow renderer 37 // the renderer process reuse this test explicitly exercises.
38 // process reuse, which this test explicitly exercises.
39 const base::CommandLine& command_line = 38 const base::CommandLine& command_line =
40 *base::CommandLine::ForCurrentProcess(); 39 *base::CommandLine::ForCurrentProcess();
41 if (command_line.HasSwitch(switches::kSitePerProcess) || 40 if (command_line.HasSwitch(switches::kSitePerProcess))
42 command_line.HasSwitch(switches::kEnableStrictSiteIsolation))
43 return; 41 return;
44 42
45 // Disable any overrides. 43 // Disable any overrides.
46 RenderProcessHostImpl::SetMaxRendererProcessCount(0); 44 RenderProcessHostImpl::SetMaxRendererProcessCount(0);
47 45
48 // Verify that the limit is between 1 and kMaxRendererProcessCount. 46 // Verify that the limit is between 1 and kMaxRendererProcessCount.
49 EXPECT_GT(RenderProcessHostImpl::GetMaxRendererProcessCount(), 0u); 47 EXPECT_GT(RenderProcessHostImpl::GetMaxRendererProcessCount(), 0u);
50 EXPECT_LE(RenderProcessHostImpl::GetMaxRendererProcessCount(), 48 EXPECT_LE(RenderProcessHostImpl::GetMaxRendererProcessCount(),
51 kMaxRendererProcessCount); 49 kMaxRendererProcessCount);
52 50
(...skipping 28 matching lines...) Expand all
81 } 79 }
82 80
83 // Verify that the renderer sharing still won't happen. 81 // Verify that the renderer sharing still won't happen.
84 GURL test_url("http://foo.com"); 82 GURL test_url("http://foo.com");
85 EXPECT_FALSE(RenderProcessHostImpl::ShouldTryToUseExistingProcessHost( 83 EXPECT_FALSE(RenderProcessHostImpl::ShouldTryToUseExistingProcessHost(
86 browser_context(), test_url)); 84 browser_context(), test_url));
87 } 85 }
88 #endif 86 #endif
89 87
90 } // namespace content 88 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/browser/site_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698