OLD | NEW |
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/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/string16.h" | 8 #include "base/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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 }; | 56 }; |
57 | 57 |
58 class SiteInstanceTestBrowserClient : public TestContentBrowserClient { | 58 class SiteInstanceTestBrowserClient : public TestContentBrowserClient { |
59 public: | 59 public: |
60 SiteInstanceTestBrowserClient() | 60 SiteInstanceTestBrowserClient() |
61 : privileged_process_id_(-1) { | 61 : privileged_process_id_(-1) { |
62 WebUIControllerFactory::RegisterFactory(&factory_); | 62 WebUIControllerFactory::RegisterFactory(&factory_); |
63 } | 63 } |
64 | 64 |
65 ~SiteInstanceTestBrowserClient() { | 65 virtual ~SiteInstanceTestBrowserClient() { |
66 WebUIControllerFactory::UnregisterFactoryForTesting(&factory_); | 66 WebUIControllerFactory::UnregisterFactoryForTesting(&factory_); |
67 } | 67 } |
68 | 68 |
69 virtual bool IsSuitableHost(RenderProcessHost* process_host, | 69 virtual bool IsSuitableHost(RenderProcessHost* process_host, |
70 const GURL& site_url) OVERRIDE { | 70 const GURL& site_url) OVERRIDE { |
71 return (privileged_process_id_ == process_host->GetID()) == | 71 return (privileged_process_id_ == process_host->GetID()) == |
72 site_url.SchemeIs(kPrivilegedScheme); | 72 site_url.SchemeIs(kPrivilegedScheme); |
73 } | 73 } |
74 | 74 |
75 void set_privileged_process_id(int process_id) { | 75 void set_privileged_process_id(int process_id) { |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 EXPECT_TRUE(instance->GetSiteURL().is_empty()); | 755 EXPECT_TRUE(instance->GetSiteURL().is_empty()); |
756 host.reset(instance->GetProcess()); | 756 host.reset(instance->GetProcess()); |
757 | 757 |
758 EXPECT_FALSE(RenderProcessHostImpl::GetProcessHostForSite( | 758 EXPECT_FALSE(RenderProcessHostImpl::GetProcessHostForSite( |
759 browser_context.get(), GURL())); | 759 browser_context.get(), GURL())); |
760 | 760 |
761 DrainMessageLoops(); | 761 DrainMessageLoops(); |
762 } | 762 } |
763 | 763 |
764 } // namespace content | 764 } // namespace content |
OLD | NEW |