Summary: | ~96 regression tests fail when using QuickTime 7.6 (they pass with QuickTime 7.3) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brian Weinstein <bweinstein> | ||||||||
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | aroben, eric.carlson, webkit.review.bot | ||||||||
Priority: | P2 | Keywords: | InRadar, PlatformOnly | ||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows XP | ||||||||||
Attachments: |
|
Description
Brian Weinstein
2009-10-09 11:20:37 PDT
Created attachment 44247 [details]
Proposed patch
Attachment 44247 [details] did not pass style-queue:
Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp:216: Tab found; better to use spaces [whitespace/tab] [1]
Total errors found: 1
Created attachment 44248 [details]
Patch, without tabs this time.
style-queue ran check-webkit-style on attachment 44248 [details] without any errors.
Comment on attachment 44248 [details] Patch, without tabs this time. > +static void addQTDirToPATH() > +{ > + static LPCWSTR pathEnvironmentVariable = L"PATH"; > + static LPCWSTR quickTimeKeyName = L"Software\\Apple Computer, Inc.\\QuickTime"; > + static LPCWSTR quickTimeSysDir = L"QTSysDir"; > + static bool initialized; > + > + if (initialized) > + return; > + initialized = true; > + > + // Get the QuickTime dll directory from the registry. The key can be in either HKLM or HKCU. > + HKEY hKey; > + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, quickTimeKeyName, 0, KEY_READ, &hKey)) { > + if (RegOpenKeyEx(HKEY_CURRENT_USER, quickTimeKeyName, 0, KEY_READ, &hKey)) > + return; > + } I think (throughout this function) it would be better to compare with ERROR_SUCCESS. > + DWORD type; > + DWORD bufferSize; > + LONG err = RegQueryValueEx(hKey, quickTimeSysDir, 0, &type, 0, &bufferSize); > + if (err || !bufferSize || type != REG_SZ) { > + RegCloseKey(hKey); > + return; > + } > + > + Vector<TCHAR> qtDir(bufferSize); > + err = RegQueryValueEx(hKey, quickTimeSysDir, 0, 0, (LPBYTE)qtDir.data(), &bufferSize); > + RegCloseKey(hKey); > + if (err || !bufferSize) > + return; Can we use SHGetValue instead? That would be a lot simpler. > + > + // Read the current PATH > + DWORD pathSize = GetEnvironmentVariable(pathEnvironmentVariable, 0, 0); > + Vector<TCHAR> oldPath(pathSize); > + if (!GetEnvironmentVariable(pathEnvironmentVariable, oldPath.data(), oldPath.size())) > + return; > + > + // And add the QuickTime dll. > + wstring newPath; > + newPath.append(qtDir.data(), qtDir.size() - 1); > + newPath.append(L";"); > + newPath.append(oldPath.data(), oldPath.size()); > + SetEnvironmentVariable(pathEnvironmentVariable, newPath.c_str()); > +} There's a strange mix of TCHAR and WCHAR here. I'd just always use WCHAR and call the *W versions of the APIs (e.g., SetEnvironmentVariableW). > @@ -263,6 +309,8 @@ static void initialize() > for (int i = 0; i < ARRAYSIZE(fontsToInstall); ++i) > textRenderer->registerPrivateFont(wstring(resourcesPath + fontsToInstall[i]).c_str()); > > + addQTDirToPATH(); I think it's worth adding a comment explaining why this is necessary. r=me, but you should consider these comments. Created attachment 44267 [details]
Simplified patch.
style-queue ran check-webkit-style on attachment 44267 [details] without any errors.
Comment on attachment 44267 [details] Simplified patch. > + // Read the current PATH. > + DWORD pathSize = GetEnvironmentVariableW(pathEnvironmentVariable, 0, 0); > + Vector<TCHAR> oldPath(pathSize); > + if (!GetEnvironmentVariable(pathEnvironmentVariable, oldPath.data(), oldPath.size())) > + return; That should be Vector<WCHAR>. r=me |