| OLD | NEW |
| 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 "content/public/test/mock_render_process_host.h" | 5 #include "content/public/test/mock_render_process_host.h" |
| 6 #include "content/test/test_render_view_host.h" | 6 #include "content/test/test_render_view_host.h" |
| 7 | 7 |
| 8 namespace content { | 8 namespace content { |
| 9 | 9 |
| 10 class RenderProcessHostUnitTest : public RenderViewHostTestHarness {}; | 10 class RenderProcessHostUnitTest : public RenderViewHostTestHarness {}; |
| 11 | 11 |
| 12 // Tests that guest RenderProcessHosts are not considered suitable hosts when | 12 // Tests that guest RenderProcessHosts are not considered suitable hosts when |
| 13 // searching for RenderProcessHost. | 13 // searching for RenderProcessHost. |
| 14 TEST_F(RenderProcessHostUnitTest, GuestsAreNotSuitableHosts) { | 14 TEST_F(RenderProcessHostUnitTest, GuestsAreNotSuitableHosts) { |
| 15 GURL test_url("http://foo.com"); | 15 GURL test_url("http://foo.com"); |
| 16 | 16 |
| 17 MockRenderProcessHost guest_host(browser_context()); | 17 MockRenderProcessHost guest_host(browser_context()); |
| 18 guest_host.SetIsGuest(true); | 18 guest_host.set_is_isolated_guest(true); |
| 19 | 19 |
| 20 EXPECT_FALSE(RenderProcessHostImpl::IsSuitableHost( | 20 EXPECT_FALSE(RenderProcessHostImpl::IsSuitableHost( |
| 21 &guest_host, browser_context(), test_url)); | 21 &guest_host, browser_context(), test_url)); |
| 22 EXPECT_TRUE(RenderProcessHostImpl::IsSuitableHost( | 22 EXPECT_TRUE(RenderProcessHostImpl::IsSuitableHost( |
| 23 process(), browser_context(), test_url)); | 23 process(), browser_context(), test_url)); |
| 24 EXPECT_EQ( | 24 EXPECT_EQ( |
| 25 process(), | 25 process(), |
| 26 RenderProcessHost::GetExistingProcessHost(browser_context(), test_url)); | 26 RenderProcessHost::GetExistingProcessHost(browser_context(), test_url)); |
| 27 } | 27 } |
| 28 | 28 |
| 29 } // namespace content | 29 } // namespace content |
| OLD | NEW |