Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: webkit/tools/test_shell/test_shell_win.cc

Issue 5262011: TestShell windows: add --crash-dumps-fulldump option (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the feedback Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/tools/test_shell/test_shell_switches.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(
190 dir, 0, &MinidumpCallback, 0, true,
191 kFullDumpType, 0, 0);
192 } else {
193 new google_breakpad::ExceptionHandler(
194 dir, 0, &MinidumpCallback, 0, true);
195 }
184 } 196 }
185 } 197 }
186 198
187 void TestShell::DestroyWindow(gfx::NativeWindow windowHandle) { 199 void TestShell::DestroyWindow(gfx::NativeWindow windowHandle) {
188 // Do we want to tear down some of the machinery behind the scenes too? 200 // Do we want to tear down some of the machinery behind the scenes too?
189 RemoveWindowFromList(windowHandle); 201 RemoveWindowFromList(windowHandle);
190 ::DestroyWindow(windowHandle); 202 ::DestroyWindow(windowHandle);
191 } 203 }
192 204
193 void TestShell::PlatformShutdown() { 205 void TestShell::PlatformShutdown() {
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 822
811 bool EnsureFontLoaded(HFONT font) { 823 bool EnsureFontLoaded(HFONT font) {
812 return true; 824 return true;
813 } 825 }
814 826
815 bool DownloadUrl(const std::string& url, HWND caller_window) { 827 bool DownloadUrl(const std::string& url, HWND caller_window) {
816 return false; 828 return false;
817 } 829 }
818 830
819 } // namespace webkit_glue 831 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/test_shell_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698