| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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> |
| 11 #include <shlwapi.h> | 11 #include <shlwapi.h> |
| 12 | 12 |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/debug/trace_event.h" | 14 #include "base/debug/trace_event.h" |
| 15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
| 16 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
| 17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 18 #include "base/resource_util.h" | |
| 19 #include "base/stack_container.h" | 18 #include "base/stack_container.h" |
| 20 #include "base/string_piece.h" | 19 #include "base/string_piece.h" |
| 21 #include "base/string_util.h" | 20 #include "base/string_util.h" |
| 22 #include "base/utf_string_conversions.h" | 21 #include "base/utf_string_conversions.h" |
| 22 #include "base/win/resource_util.h" |
| 23 #include "breakpad/src/client/windows/handler/exception_handler.h" | 23 #include "breakpad/src/client/windows/handler/exception_handler.h" |
| 24 #include "grit/webkit_resources.h" | 24 #include "grit/webkit_resources.h" |
| 25 #include "grit/webkit_chromium_resources.h" | 25 #include "grit/webkit_chromium_resources.h" |
| 26 #include "net/base/net_module.h" | 26 #include "net/base/net_module.h" |
| 27 #include "net/url_request/url_request_file_job.h" | 27 #include "net/url_request/url_request_file_job.h" |
| 28 #include "skia/ext/bitmap_platform_device.h" | 28 #include "skia/ext/bitmap_platform_device.h" |
| 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 31 #include "ui/base/win/hwnd_util.h" | 31 #include "ui/base/win/hwnd_util.h" |
| 32 #include "webkit/glue/webkit_glue.h" | 32 #include "webkit/glue/webkit_glue.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 PathService::Get(base::DIR_SOURCE_ROOT, &path); | 124 PathService::Get(base::DIR_SOURCE_ROOT, &path); |
| 125 path = path.AppendASCII("webkit"); | 125 path = path.AppendASCII("webkit"); |
| 126 path = path.AppendASCII("tools"); | 126 path = path.AppendASCII("tools"); |
| 127 path = path.AppendASCII("test_shell"); | 127 path = path.AppendASCII("test_shell"); |
| 128 return path.AppendASCII("resources"); | 128 return path.AppendASCII("resources"); |
| 129 } | 129 } |
| 130 | 130 |
| 131 static base::StringPiece GetRawDataResource(HMODULE module, int resource_id) { | 131 static base::StringPiece GetRawDataResource(HMODULE module, int resource_id) { |
| 132 void* data_ptr; | 132 void* data_ptr; |
| 133 size_t data_size; | 133 size_t data_size; |
| 134 return base::GetDataResourceFromModule(module, resource_id, &data_ptr, | 134 return base::win::GetDataResourceFromModule(module, resource_id, &data_ptr, |
| 135 &data_size) | 135 &data_size) |
| 136 ? base::StringPiece(static_cast<char*>(data_ptr), data_size) | 136 ? base::StringPiece(static_cast<char*>(data_ptr), data_size) |
| 137 : base::StringPiece(); | 137 : base::StringPiece(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace | 140 } // namespace |
| 141 | 141 |
| 142 // Initialize static member variable | 142 // Initialize static member variable |
| 143 HINSTANCE TestShell::instance_handle_; | 143 HINSTANCE TestShell::instance_handle_; |
| 144 | 144 |
| 145 ///////////////////////////////////////////////////////////////////////////// | 145 ///////////////////////////////////////////////////////////////////////////// |
| (...skipping 16 matching lines...) Expand all Loading... |
| 162 allow_external_pages_ = allow_external_pages; | 162 allow_external_pages_ = allow_external_pages; |
| 163 | 163 |
| 164 web_prefs_ = new WebPreferences; | 164 web_prefs_ = new WebPreferences; |
| 165 | 165 |
| 166 ResetWebPreferences(); | 166 ResetWebPreferences(); |
| 167 | 167 |
| 168 // Register the Ahem font used by layout tests. | 168 // Register the Ahem font used by layout tests. |
| 169 DWORD num_fonts = 1; | 169 DWORD num_fonts = 1; |
| 170 void* font_ptr; | 170 void* font_ptr; |
| 171 size_t font_size; | 171 size_t font_size; |
| 172 if (base::GetDataResourceFromModule(::GetModuleHandle(NULL), IDR_AHEM_FONT, | 172 if (base::win::GetDataResourceFromModule(::GetModuleHandle(NULL), |
| 173 &font_ptr, &font_size)) { | 173 IDR_AHEM_FONT, &font_ptr, &font_size)) { |
| 174 HANDLE rc = AddFontMemResourceEx(font_ptr, font_size, 0, &num_fonts); | 174 HANDLE rc = AddFontMemResourceEx(font_ptr, font_size, 0, &num_fonts); |
| 175 DCHECK(rc != 0); | 175 DCHECK(rc != 0); |
| 176 } | 176 } |
| 177 | 177 |
| 178 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 178 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 179 if (parsed_command_line.HasSwitch(test_shell::kCrashDumps)) { | 179 if (parsed_command_line.HasSwitch(test_shell::kCrashDumps)) { |
| 180 std::wstring dir( | 180 std::wstring dir( |
| 181 parsed_command_line.GetSwitchValueNative(test_shell::kCrashDumps)); | 181 parsed_command_line.GetSwitchValueNative(test_shell::kCrashDumps)); |
| 182 if (parsed_command_line.HasSwitch(test_shell::kCrashDumpsFulldump)) { | 182 if (parsed_command_line.HasSwitch(test_shell::kCrashDumpsFulldump)) { |
| 183 new google_breakpad::ExceptionHandler( | 183 new google_breakpad::ExceptionHandler( |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 | 729 |
| 730 bool EnsureFontLoaded(HFONT font) { | 730 bool EnsureFontLoaded(HFONT font) { |
| 731 return true; | 731 return true; |
| 732 } | 732 } |
| 733 | 733 |
| 734 bool DownloadUrl(const std::string& url, HWND caller_window) { | 734 bool DownloadUrl(const std::string& url, HWND caller_window) { |
| 735 return false; | 735 return false; |
| 736 } | 736 } |
| 737 | 737 |
| 738 } // namespace webkit_glue | 738 } // namespace webkit_glue |
| OLD | NEW |