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 "chrome_frame/test/net/fake_external_tab.h" | 5 #include "chrome_frame/test/net/fake_external_tab.h" |
6 | 6 |
7 #include <atlbase.h> | 7 #include <atlbase.h> |
8 #include <atlcom.h> | 8 #include <atlcom.h> |
9 #include <exdisp.h> | 9 #include <exdisp.h> |
10 #include <Winsock2.h> | 10 #include <Winsock2.h> |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 base::LazyInstance<chrome::ChromeContentRendererClient> | 138 base::LazyInstance<chrome::ChromeContentRendererClient> |
139 g_renderer_client = LAZY_INSTANCE_INITIALIZER; | 139 g_renderer_client = LAZY_INSTANCE_INITIALIZER; |
140 | 140 |
141 class FakeMainDelegate : public content::ContentMainDelegate { | 141 class FakeMainDelegate : public content::ContentMainDelegate { |
142 public: | 142 public: |
143 virtual ~FakeMainDelegate() {} | 143 virtual ~FakeMainDelegate() {} |
144 | 144 |
145 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE { | 145 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE { |
146 logging_win::InstallTestLogCollector( | 146 logging_win::InstallTestLogCollector( |
147 testing::UnitTest::GetInstance()); | 147 testing::UnitTest::GetInstance()); |
148 return false; | |
149 } | |
150 | 148 |
151 virtual void PreSandboxStartup() OVERRIDE { | |
152 // Initialize the content client. | 149 // Initialize the content client. |
153 content::SetContentClient(&g_chrome_content_client.Get()); | 150 content::SetContentClient(&g_chrome_content_client.Get()); |
154 | 151 |
155 // Override the default ContentBrowserClient to let Chrome participate in | 152 // Override the default ContentBrowserClient to let Chrome participate in |
156 // content logic. We use a subclass of Chrome's implementation, | 153 // content logic. We use a subclass of Chrome's implementation, |
157 // FakeContentBrowserClient, to override CreateBrowserMainParts. Must | 154 // FakeContentBrowserClient, to override CreateBrowserMainParts. Must |
158 // be done before any tabs are created. | 155 // be done before any tabs are created. |
159 content::GetContentClient()->set_browser(&g_browser_client.Get()); | 156 content::GetContentClient()->set_browser(&g_browser_client.Get()); |
| 157 content::GetContentClient()->set_renderer(&g_renderer_client.Get()); |
| 158 return false; |
| 159 } |
160 | 160 |
161 content::GetContentClient()->set_renderer(&g_renderer_client.Get()); | 161 virtual void PreSandboxStartup() OVERRIDE { |
162 } | 162 } |
163 | 163 |
164 virtual void SandboxInitialized(const std::string& process_type) OVERRIDE {} | 164 virtual void SandboxInitialized(const std::string& process_type) OVERRIDE {} |
165 | 165 |
166 virtual int RunProcess( | 166 virtual int RunProcess( |
167 const std::string& process_type, | 167 const std::string& process_type, |
168 const content::MainFunctionParams& main_function_params) OVERRIDE { | 168 const content::MainFunctionParams& main_function_params) OVERRIDE { |
169 return -1; | 169 return -1; |
170 } | 170 } |
171 virtual void ProcessExiting(const std::string& process_type) OVERRIDE {} | 171 virtual void ProcessExiting(const std::string& process_type) OVERRIDE {} |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 // content::InitializeSandboxInfo(&sandbox_info); | 890 // content::InitializeSandboxInfo(&sandbox_info); |
891 FakeMainDelegate delegate; | 891 FakeMainDelegate delegate; |
892 content::ContentMain( | 892 content::ContentMain( |
893 reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL)), | 893 reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL)), |
894 &sandbox_info, | 894 &sandbox_info, |
895 &delegate); | 895 &delegate); |
896 | 896 |
897 // Note: In debug builds, we ExitProcess during PostDestroyThreads. | 897 // Note: In debug builds, we ExitProcess during PostDestroyThreads. |
898 return g_test_suite->test_result(); | 898 return g_test_suite->test_result(); |
899 } | 899 } |
OLD | NEW |