| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 class FakeMainDelegate : public content::ContentMainDelegate { | 147 class FakeMainDelegate : public content::ContentMainDelegate { |
| 148 public: | 148 public: |
| 149 virtual ~FakeMainDelegate() {} | 149 virtual ~FakeMainDelegate() {} |
| 150 | 150 |
| 151 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE { | 151 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE { |
| 152 logging_win::InstallTestLogCollector( | 152 logging_win::InstallTestLogCollector( |
| 153 testing::UnitTest::GetInstance()); | 153 testing::UnitTest::GetInstance()); |
| 154 | 154 |
| 155 content::SetContentClient(&g_chrome_content_client.Get()); | 155 content::SetContentClient(&g_chrome_content_client.Get()); |
| 156 content::GetContentClient()->set_renderer_for_testing( | 156 content::SetRendererClientForTesting(&g_renderer_client.Get()); |
| 157 &g_renderer_client.Get()); | |
| 158 return false; | 157 return false; |
| 159 } | 158 } |
| 160 | 159 |
| 161 // Override the default ContentBrowserClient to let Chrome participate in | 160 // Override the default ContentBrowserClient to let Chrome participate in |
| 162 // content logic. We use a subclass of Chrome's implementation, | 161 // content logic. We use a subclass of Chrome's implementation, |
| 163 // FakeContentBrowserClient, to override CreateBrowserMainParts. Must | 162 // FakeContentBrowserClient, to override CreateBrowserMainParts. Must |
| 164 // be done before any tabs are created. | 163 // be done before any tabs are created. |
| 165 virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE { | 164 virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE { |
| 166 return &g_browser_client.Get(); | 165 return &g_browser_client.Get(); |
| 167 }; | 166 }; |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 content::InitializeSandboxInfo(&sandbox_info); | 970 content::InitializeSandboxInfo(&sandbox_info); |
| 972 FakeMainDelegate delegate; | 971 FakeMainDelegate delegate; |
| 973 content::ContentMain( | 972 content::ContentMain( |
| 974 reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL)), | 973 reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL)), |
| 975 &sandbox_info, | 974 &sandbox_info, |
| 976 &delegate); | 975 &delegate); |
| 977 | 976 |
| 978 // Note: In debug builds, we ExitProcess during PostDestroyThreads. | 977 // Note: In debug builds, we ExitProcess during PostDestroyThreads. |
| 979 return g_test_suite->test_result(); | 978 return g_test_suite->test_result(); |
| 980 } | 979 } |
| OLD | NEW |