Changeset 150851 in webkit
- Timestamp:
- May 28, 2013 4:18:04 PM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r150850 r150851 1 2013-05-28 Brent Fulgham <bfulgham@webkit.org> 2 3 [Windows] Many CSS2.1 tests fail under NRWT. 4 https://bugs.webkit.org/show_bug.cgi?id=75707 5 6 Reviewed by Darin Adler. 7 8 * DumpRenderTree/win/DumpRenderTree.cpp: 9 (findFontFallback): Added 10 (addFontFallbackIfPresent): Added 11 (removeFontFallbackIfPresent): Added 12 (runTest): Set up/remove font fallbacks when needed. 13 1 14 2013-05-28 Brent Fulgham <bfulgham@apple.com> 2 15 -
trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp
r150670 r150851 960 960 } 961 961 962 static String findFontFallback(const char* pathOrUrl) 963 { 964 String pathToFontFallback = WebCore::directoryName(pathOrUrl); 965 966 wchar_t fullPath[_MAX_PATH]; 967 if (!_wfullpath(fullPath, pathToFontFallback.charactersWithNullTermination(), _MAX_PATH)) 968 return emptyString(); 969 970 if (!::PathIsDirectoryW(fullPath)) 971 return emptyString(); 972 973 String pathToCheck = fullPath; 974 975 static const String layoutTests = "LayoutTests"; 976 977 // Find the layout test root on the current path: 978 size_t location = pathToCheck.find(layoutTests); 979 if (WTF::notFound == location) 980 return emptyString(); 981 982 String pathToTest = pathToCheck.substring(location + layoutTests.length() + 1); 983 String possiblePathToLogue = WebCore::pathByAppendingComponent(pathToCheck.substring(0, location + layoutTests.length() + 1), "platform\\win"); 984 985 Vector<String> possiblePaths; 986 possiblePaths.append(WebCore::pathByAppendingComponent(possiblePathToLogue, pathToTest)); 987 988 size_t nextCandidateEnd = pathToTest.reverseFind('\\'); 989 while (nextCandidateEnd && nextCandidateEnd != WTF::notFound) { 990 pathToTest = pathToTest.substring(0, nextCandidateEnd); 991 possiblePaths.append(WebCore::pathByAppendingComponent(possiblePathToLogue, pathToTest)); 992 nextCandidateEnd = pathToTest.reverseFind('\\'); 993 } 994 995 for (Vector<String>::iterator pos = possiblePaths.begin(); pos != possiblePaths.end(); ++pos) { 996 pathToFontFallback = WebCore::pathByAppendingComponent(*pos, "resources\\"); 997 998 if (::PathIsDirectoryW(pathToFontFallback.charactersWithNullTermination())) 999 return pathToFontFallback; 1000 } 1001 1002 return emptyString(); 1003 } 1004 1005 static void addFontFallbackIfPresent(const String& fontFallbackPath) 1006 { 1007 if (fontFallbackPath.isEmpty()) 1008 return; 1009 1010 String fontFallback = WebCore::pathByAppendingComponent(fontFallbackPath, "Mac-compatible-font-fallback.css"); 1011 1012 if (!::PathFileExistsW(fontFallback.charactersWithNullTermination())) 1013 return; 1014 1015 ::setPersistentUserStyleSheetLocation(fontFallback.createCFString().get()); 1016 } 1017 1018 static void removeFontFallbackIfPresent(const String& fontFallbackPath) 1019 { 1020 if (fontFallbackPath.isEmpty()) 1021 return; 1022 1023 String fontFallback = WebCore::pathByAppendingComponent(fontFallbackPath, "Mac-compatible-font-fallback.css"); 1024 1025 if (!::PathFileExistsW(fontFallback.charactersWithNullTermination())) 1026 return; 1027 1028 ::setPersistentUserStyleSheetLocation(0); 1029 } 1030 962 1031 static void runTest(const string& inputLine) 963 1032 { … … 978 1047 CFRelease(str); 979 1048 1049 String fallbackPath = findFontFallback(pathOrURL.c_str()); 1050 980 1051 str = CFURLGetString(url); 981 1052 … … 992 1063 done = false; 993 1064 topLoadingFrame = 0; 1065 1066 addFontFallbackIfPresent(fallbackPath); 994 1067 995 1068 sizeWebViewForCurrentTest(); … … 1084 1157 1085 1158 exit: 1159 removeFontFallbackIfPresent(fallbackPath); 1086 1160 SysFreeString(urlBStr); 1087 1161 ::gTestRunner.clear();
Note: See TracChangeset
for help on using the changeset viewer.