diff options
Diffstat (limited to 'Tools/WebKitTestRunner/TestInvocation.cpp')
| -rw-r--r-- | Tools/WebKitTestRunner/TestInvocation.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp index fd9423220..1cb56bb71 100644 --- a/Tools/WebKitTestRunner/TestInvocation.cpp +++ b/Tools/WebKitTestRunner/TestInvocation.cpp @@ -143,9 +143,31 @@ static bool shouldOpenWebInspector(const char* pathOrURL) } #endif +#if PLATFORM(MAC) +static bool shouldUseTiledDrawing(const char* pathOrURL) +{ + return strstr(pathOrURL, "tiled-drawing/") || strstr(pathOrURL, "tiled-drawing\\"); +} +#endif + +static void updateTiledDrawingForCurrentTest(const char* pathOrURL) +{ +#if PLATFORM(MAC) + WKRetainPtr<WKMutableDictionaryRef> viewOptions = adoptWK(WKMutableDictionaryCreate()); + WKRetainPtr<WKStringRef> useTiledDrawingKey = adoptWK(WKStringCreateWithUTF8CString("TiledDrawing")); + WKRetainPtr<WKBooleanRef> useTiledDrawingValue = adoptWK(WKBooleanCreate(shouldUseTiledDrawing(pathOrURL))); + WKDictionaryAddItem(viewOptions.get(), useTiledDrawingKey.get(), useTiledDrawingValue.get()); + + TestController::shared().ensureViewSupportsOptions(viewOptions.get()); +#else + UNUSED_PARAM(pathOrURL); +#endif +} + void TestInvocation::invoke() { sizeWebViewForCurrentTest(m_pathOrURL.c_str()); + updateTiledDrawingForCurrentTest(m_pathOrURL.c_str()); WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("BeginTest")); WKRetainPtr<WKMutableDictionaryRef> beginTestMessageBody = adoptWK(WKMutableDictionaryCreate()); @@ -447,6 +469,13 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName return; } + if (WKStringIsEqualToUTF8CString(messageName, "QueueForwardNavigation")) { + ASSERT(WKGetTypeID(messageBody) == WKUInt64GetTypeID()); + uint64_t stepCount = WKUInt64GetValue(static_cast<WKUInt64Ref>(messageBody)); + TestController::shared().workQueueManager().queueForwardNavigation(stepCount); + return; + } + if (WKStringIsEqualToUTF8CString(messageName, "QueueLoad")) { ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID()); WKDictionaryRef loadDataDictionary = static_cast<WKDictionaryRef>(messageBody); @@ -461,6 +490,23 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName return; } + if (WKStringIsEqualToUTF8CString(messageName, "QueueLoadHTMLString")) { + ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID()); + WKDictionaryRef loadDataDictionary = static_cast<WKDictionaryRef>(messageBody); + + WKRetainPtr<WKStringRef> contentKey(AdoptWK, WKStringCreateWithUTF8CString("content")); + WKStringRef contentWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, contentKey.get())); + + WKRetainPtr<WKStringRef> baseURLKey(AdoptWK, WKStringCreateWithUTF8CString("baseURL")); + WKStringRef baseURLWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, baseURLKey.get())); + + WKRetainPtr<WKStringRef> unreachableURLKey(AdoptWK, WKStringCreateWithUTF8CString("unreachableURL")); + WKStringRef unreachableURLWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, unreachableURLKey.get())); + + TestController::shared().workQueueManager().queueLoadHTMLString(toWTFString(contentWK), baseURLWK ? toWTFString(baseURLWK) : String(), unreachableURLWK ? toWTFString(unreachableURLWK) : String()); + return; + } + if (WKStringIsEqualToUTF8CString(messageName, "QueueReload")) { TestController::shared().workQueueManager().queueReload(); return; |
