diff options
Diffstat (limited to 'Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp')
-rw-r--r-- | Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp b/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp index 8ed2fbf..181d88e 100644 --- a/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp +++ b/Tools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp @@ -29,6 +29,10 @@ #include <WebKit2/WKURLCF.h> #include <wtf/RetainPtr.h> +#if USE(CFNETWORK) +#include <WebKit2/WKURLResponseCF.h> +#endif + namespace TestWebKitAPI { namespace Util { @@ -81,6 +85,16 @@ WKURLRef URLForNonExistentResource() return WKURLCreateWithUTF8CString("file:///does-not-exist.html"); } +WKRetainPtr<WKStringRef> MIMETypeForWKURLResponse(WKURLResponseRef wkResponse) +{ +#if USE(CFNETWORK) + RetainPtr<CFURLResponseRef> response(AdoptCF, WKURLResponseCopyCFURLResponse(0, wkResponse)); + return adoptWK(WKStringCreateWithCFString(CFURLResponseGetMIMEType(response.get()))); +#else + return 0; +#endif +} + bool isKeyDown(WKNativeEventPtr event) { return event->message == WM_KEYDOWN; |