Changeset 60005 in webkit
- Timestamp:
- May 22, 2010 10:17:09 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/chromium/ChangeLog
r59935 r60005 1 2010-05-22 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 [DRT/Chromium] Link resources and load Ahem font for Windows 6 https://bugs.webkit.org/show_bug.cgi?id=39473 7 8 * WebKit.gyp: 9 Add net and webkit resources for Windows. 10 Copy AHEM____.TTF to DumpRenderTree.exe directory. 11 1 12 2010-05-21 Steve Block <steveblock@google.com> 2 13 -
trunk/WebKit/chromium/WebKit.gyp
r59772 r60005 48 48 }], 49 49 ], 50 'ahem_path': '../../WebKitTools/DumpRenderTree/qt/fonts/AHEM____.TTF', 50 51 }, 51 52 'targets': [ … … 580 581 ], 581 582 'conditions': [ 583 ['OS=="win"', { 584 'resource_include_dirs': ['<(SHARED_INTERMEDIATE_DIR)/webkit'], 585 'sources': [ 586 '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc', 587 '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc', 588 '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc', 589 '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.rc', 590 ], 591 'copies': [{ 592 'destination': '<(PRODUCT_DIR)', 593 'files': ['<(ahem_path)'], 594 }], 595 }], 582 596 ['OS=="mac"', { 583 597 'dependencies': ['LayoutTestHelper'], 584 598 585 599 'mac_bundle_resources': [ 586 ' ../../WebKitTools/DumpRenderTree/qt/fonts/AHEM____.TTF',600 '<(ahem_path)', 587 601 '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher100.ttf', 588 602 '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher200.ttf', -
trunk/WebKitTools/ChangeLog
r59986 r60005 1 2010-05-22 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 [DRT/Chromium] Link resources and load Ahem font for Windows 6 https://bugs.webkit.org/show_bug.cgi?id=39473 7 8 * DumpRenderTree/chromium/DumpRenderTree.cpp: 9 (main): Call platformInit(). 10 * DumpRenderTree/chromium/TestShell.h: 11 Declare platformInit(). It is not related to TestShell class, but the 12 implementation of paltformInit() is placed at TestShell*.{cpp,mm}. 13 * DumpRenderTree/chromium/TestShellGtk.cpp: 14 (platformInit): 15 * DumpRenderTree/chromium/TestShellMac.mm: 16 (platformInit): 17 * DumpRenderTree/chromium/TestShellWin.cpp: 18 (platformInit): 19 - Make stdout/stderr binary mode 20 - Load Ahem font 21 1 22 2010-05-21 Eric Seidel <eric@webkit.org> 2 23 -
trunk/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
r58862 r60005 37 37 using namespace std; 38 38 39 void platformInit(); 40 39 41 static const char optionComplexText[] = "--complex-text"; 40 42 static const char optionDumpAllPixels[] = "--dump-all-pixels"; … … 60 62 { 61 63 webkit_support::SetUpTestEnvironment(); 64 platformInit(); 62 65 63 66 TestParams params; -
trunk/WebKitTools/DumpRenderTree/chromium/TestShell.h
r59193 r60005 154 154 #endif 155 155 }; 156 157 void platformInit(); -
trunk/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp
r57703 r60005 63 63 signal(SIGALRM, SIG_DFL); 64 64 } 65 66 void platformInit() 67 { 68 } -
trunk/WebKitTools/DumpRenderTree/chromium/TestShellMac.mm
r56966 r60005 124 124 [thread release]; 125 125 } 126 127 void platformInit() 128 { 129 } -
trunk/WebKitTools/DumpRenderTree/chromium/TestShellWin.cpp
r57649 r60005 33 33 34 34 #include "webkit/support/webkit_support.h" 35 #include <fcntl.h> 36 #include <io.h> 35 37 #include <process.h> 38 #include <shlwapi.h> 39 #include <sys/stat.h> 36 40 37 41 // Default timeout in ms for file page loads when in layout test mode. … … 99 103 WaitForSingleObject(threadHandle, 1000); 100 104 } 105 106 void platformInit() 107 { 108 // Set stdout/stderr binary mode. 109 _setmode(_fileno(stdout), _O_BINARY); 110 _setmode(_fileno(stderr), _O_BINARY); 111 112 // Load Ahem font. 113 // AHEM____.TTF is copied to the directory of DumpRenderTree.exe by WebKit.gyp. 114 WCHAR path[_MAX_PATH]; 115 if (!::GetModuleFileName(0, path, _MAX_PATH)) { 116 fprintf(stderr, "Can't get the module path.\n"); 117 exit(1); 118 } 119 ::PathRemoveFileSpec(path); 120 wcscat_s(path, _MAX_PATH, L"/AHEM____.TTF"); 121 struct _stat ahemStat; 122 if (_wstat(path, &ahemStat) == -1) { 123 fprintf(stderr, "Can't access: '%S'\n", path); 124 exit(1); 125 } 126 127 FILE* fp = _wfopen(path, L"rb"); 128 if (!fp) { 129 _wperror(path); 130 exit(1); 131 } 132 size_t size = ahemStat.st_size; 133 char* fontBuffer = new char[size]; 134 if (fread(fontBuffer, 1, size, fp) != size) { 135 fprintf(stderr, "Can't read the font: '%S'\n", path); 136 fclose(fp); 137 exit(1); 138 } 139 fclose(fp); 140 DWORD numFonts = 1; 141 HANDLE fontHandle = ::AddFontMemResourceEx(fontBuffer, size, 0, &numFonts); 142 delete[] fontBuffer; // OS owns a copy of the buffer. 143 if (!fontHandle) { 144 fprintf(stderr, "Failed to register Ahem font: '%S'\n", path); 145 exit(1); 146 } 147 // We don't need to release the font explicitly. 148 }
Note: See TracChangeset
for help on using the changeset viewer.