OLD | NEW |
---|---|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "webkit/tools/test_shell/test_shell.h" | 5 #include "webkit/tools/test_shell/test_shell.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <commdlg.h> | 8 #include <commdlg.h> |
9 #include <objbase.h> | 9 #include <objbase.h> |
10 #include <process.h> | 10 #include <process.h> |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 } | 144 } |
145 | 145 |
146 } // namespace | 146 } // namespace |
147 | 147 |
148 // Initialize static member variable | 148 // Initialize static member variable |
149 HINSTANCE TestShell::instance_handle_; | 149 HINSTANCE TestShell::instance_handle_; |
150 | 150 |
151 ///////////////////////////////////////////////////////////////////////////// | 151 ///////////////////////////////////////////////////////////////////////////// |
152 // static methods on TestShell | 152 // static methods on TestShell |
153 | 153 |
154 const MINIDUMP_TYPE kFullDumpType = static_cast<MINIDUMP_TYPE>( | |
155 MiniDumpWithFullMemory | // Full memory from process. | |
156 MiniDumpWithProcessThreadData | // Get PEB and TEB. | |
157 MiniDumpWithHandleData); // Get all handle information. | |
158 | |
154 void TestShell::InitializeTestShell(bool layout_test_mode, | 159 void TestShell::InitializeTestShell(bool layout_test_mode, |
155 bool allow_external_pages) { | 160 bool allow_external_pages) { |
156 // Start COM stuff. | 161 // Start COM stuff. |
157 HRESULT res = OleInitialize(NULL); | 162 HRESULT res = OleInitialize(NULL); |
158 DCHECK(SUCCEEDED(res)); | 163 DCHECK(SUCCEEDED(res)); |
159 | 164 |
160 window_list_ = new WindowList; | 165 window_list_ = new WindowList; |
161 instance_handle_ = ::GetModuleHandle(NULL); | 166 instance_handle_ = ::GetModuleHandle(NULL); |
162 layout_test_mode_ = layout_test_mode; | 167 layout_test_mode_ = layout_test_mode; |
163 allow_external_pages_ = allow_external_pages; | 168 allow_external_pages_ = allow_external_pages; |
164 | 169 |
165 web_prefs_ = new WebPreferences; | 170 web_prefs_ = new WebPreferences; |
166 | 171 |
167 ResetWebPreferences(); | 172 ResetWebPreferences(); |
168 | 173 |
169 // Register the Ahem font used by layout tests. | 174 // Register the Ahem font used by layout tests. |
170 DWORD num_fonts = 1; | 175 DWORD num_fonts = 1; |
171 void* font_ptr; | 176 void* font_ptr; |
172 size_t font_size; | 177 size_t font_size; |
173 if (base::GetDataResourceFromModule(::GetModuleHandle(NULL), IDR_AHEM_FONT, | 178 if (base::GetDataResourceFromModule(::GetModuleHandle(NULL), IDR_AHEM_FONT, |
174 &font_ptr, &font_size)) { | 179 &font_ptr, &font_size)) { |
175 HANDLE rc = AddFontMemResourceEx(font_ptr, font_size, 0, &num_fonts); | 180 HANDLE rc = AddFontMemResourceEx(font_ptr, font_size, 0, &num_fonts); |
176 DCHECK(rc != 0); | 181 DCHECK(rc != 0); |
177 } | 182 } |
178 | 183 |
179 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 184 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
180 if (parsed_command_line.HasSwitch(test_shell::kCrashDumps)) { | 185 if (parsed_command_line.HasSwitch(test_shell::kCrashDumps)) { |
181 std::wstring dir( | 186 std::wstring dir( |
182 parsed_command_line.GetSwitchValueNative(test_shell::kCrashDumps)); | 187 parsed_command_line.GetSwitchValueNative(test_shell::kCrashDumps)); |
183 new google_breakpad::ExceptionHandler(dir, 0, &MinidumpCallback, 0, true); | 188 if (parsed_command_line.HasSwitch(test_shell::kCrashDumpsFulldump)) { |
189 new google_breakpad::ExceptionHandler(dir, 0, &MinidumpCallback, 0, true , | |
tony
2010/11/30 17:58:09
Nit: 80 cols
gmorrita
2010/12/01 03:36:18
Done.
| |
190 kFullDumpType, 0, 0); | |
191 } else { | |
192 new google_breakpad::ExceptionHandler(dir, 0, &MinidumpCallback, 0, true ); | |
tony
2010/11/30 17:58:09
Nit: 80 cols
gmorrita
2010/12/01 03:36:18
Done.
| |
193 } | |
184 } | 194 } |
185 } | 195 } |
186 | 196 |
187 void TestShell::DestroyWindow(gfx::NativeWindow windowHandle) { | 197 void TestShell::DestroyWindow(gfx::NativeWindow windowHandle) { |
188 // Do we want to tear down some of the machinery behind the scenes too? | 198 // Do we want to tear down some of the machinery behind the scenes too? |
189 RemoveWindowFromList(windowHandle); | 199 RemoveWindowFromList(windowHandle); |
190 ::DestroyWindow(windowHandle); | 200 ::DestroyWindow(windowHandle); |
191 } | 201 } |
192 | 202 |
193 void TestShell::PlatformShutdown() { | 203 void TestShell::PlatformShutdown() { |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
810 | 820 |
811 bool EnsureFontLoaded(HFONT font) { | 821 bool EnsureFontLoaded(HFONT font) { |
812 return true; | 822 return true; |
813 } | 823 } |
814 | 824 |
815 bool DownloadUrl(const std::string& url, HWND caller_window) { | 825 bool DownloadUrl(const std::string& url, HWND caller_window) { |
816 return false; | 826 return false; |
817 } | 827 } |
818 | 828 |
819 } // namespace webkit_glue | 829 } // namespace webkit_glue |
OLD | NEW |