diff options
Diffstat (limited to 'Tools/DumpRenderTree/win/DumpRenderTree.cpp')
-rw-r--r-- | Tools/DumpRenderTree/win/DumpRenderTree.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Tools/DumpRenderTree/win/DumpRenderTree.cpp b/Tools/DumpRenderTree/win/DumpRenderTree.cpp index 66e7311..2db43da 100644 --- a/Tools/DumpRenderTree/win/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/win/DumpRenderTree.cpp @@ -168,12 +168,15 @@ wstring urlSuitableForTestResult(const wstring& urlString) return cfStringRefToWString(substringFromIndex(path.get(), CFStringGetLength(basePath.get())).get()); } -wstring lastPathComponent(const wstring& url) +wstring lastPathComponent(const wstring& urlString) { - if (url.empty()) - return url; + if (urlString.empty()) + return urlString; + + RetainPtr<CFURLRef> url(AdoptCF, CFURLCreateWithBytes(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(urlString.c_str()), urlString.length() * sizeof(wstring::value_type), kCFStringEncodingUTF16, 0)); + RetainPtr<CFStringRef> lastPathComponent(CFURLCopyLastPathComponent(url.get())); - return PathFindFileNameW(url.c_str()); + return cfStringRefToWString(lastPathComponent.get()); } static string toUTF8(const wchar_t* wideString, size_t length) @@ -873,6 +876,7 @@ static void resetDefaultsToConsistentValues(IWebPreferences* preferences) prefsPrivate->setXSSAuditorEnabled(FALSE); prefsPrivate->setFrameFlatteningEnabled(FALSE); prefsPrivate->setOfflineWebApplicationCacheEnabled(TRUE); + prefsPrivate->setLoadsSiteIconsIgnoringImageLoadingPreference(FALSE); } setAlwaysAcceptCookies(false); |