diff options
Diffstat (limited to 'WebKitTools/WebKitTestRunner/TestInvocation.cpp')
-rw-r--r-- | WebKitTools/WebKitTestRunner/TestInvocation.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.cpp b/WebKitTools/WebKitTestRunner/TestInvocation.cpp index d3bb8d2..1434d50 100644 --- a/WebKitTools/WebKitTestRunner/TestInvocation.cpp +++ b/WebKitTools/WebKitTestRunner/TestInvocation.cpp @@ -46,7 +46,11 @@ static WKURLRef createWKURL(const char* pathOrURL) if (CFStringHasPrefix(pathOrURLCFString.get(), CFSTR("http://")) || CFStringHasPrefix(pathOrURLCFString.get(), CFSTR("https://"))) cfURL.adoptCF(CFURLCreateWithString(0, pathOrURLCFString.get(), 0)); else +#if defined(WIN32) || defined(_WIN32) + cfURL.adoptCF(CFURLCreateWithFileSystemPath(0, pathOrURLCFString.get(), kCFURLWindowsPathStyle, false)); +#else cfURL.adoptCF(CFURLCreateWithFileSystemPath(0, pathOrURLCFString.get(), kCFURLPOSIXPathStyle, false)); +#endif return WKURLCreateWithCFURL(cfURL.get()); } @@ -92,9 +96,18 @@ static void sizeWebViewForCurrentTest(char* pathOrURL) TestController::shared().mainWebView()->resizeTo(normalWidth, normalHeight); } +void TestInvocation::resetPreferencesToConsistentValues() +{ + WKPreferencesRef preferences = WKContextGetPreferences(TestController::shared().context()); + + WKPreferencesSetOfflineWebApplicationCacheEnabled(preferences, true); +} + void TestInvocation::invoke() { sizeWebViewForCurrentTest(m_pathOrURL); + resetPreferencesToConsistentValues(); + WKRetainPtr<WKStringRef> message(AdoptWK, WKStringCreateWithCFString(CFSTR("BeginTest"))); WKContextPostMessageToInjectedBundle(TestController::shared().context(), message.get()); |