Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / content / browser / renderer_host / render_process_host_unittest.cc
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
3 // found in the LICENSE file.
4
5 #include "content/public/test/mock_render_process_host.h"
6 #include "content/test/test_render_view_host.h"
7
8 namespace content {
9
10 class RenderProcessHostUnitTest : public RenderViewHostTestHarness {};
11
12 // Tests that guest RenderProcessHosts are not considered suitable hosts when
13 // searching for RenderProcessHost.
14 TEST_F(RenderProcessHostUnitTest, GuestsAreNotSuitableHosts) {
15   GURL test_url("http://foo.com");
16
17   MockRenderProcessHost guest_host(browser_context());
18   guest_host.SetIsGuest(true);
19
20   EXPECT_FALSE(RenderProcessHostImpl::IsSuitableHost(
21       &guest_host, browser_context(), test_url));
22   EXPECT_TRUE(RenderProcessHostImpl::IsSuitableHost(
23       process(), browser_context(), test_url));
24   EXPECT_EQ(
25       process(),
26       RenderProcessHost::GetExistingProcessHost(browser_context(), test_url));
27 }
28
29 }  // namespace content