diff options
Diffstat (limited to 'Tools/WebKitTestRunner/TestInvocation.cpp')
| -rw-r--r-- | Tools/WebKitTestRunner/TestInvocation.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp index ef17437e4..bad24fa61 100644 --- a/Tools/WebKitTestRunner/TestInvocation.cpp +++ b/Tools/WebKitTestRunner/TestInvocation.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012 Intel Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -165,9 +166,31 @@ static void updateTiledDrawingForCurrentTest(const char* pathOrURL) #endif } +#if ENABLE(CSS_DEVICE_ADAPTATION) +static bool shouldUseFixedLayout(const char* pathOrURL) +{ + return strstr(pathOrURL, "device-adapt/") || strstr(pathOrURL, "device-adapt\\"); +} +#endif + +static void updateLayoutType(const char* pathOrURL) +{ +#if ENABLE(CSS_DEVICE_ADAPTATION) + WKRetainPtr<WKMutableDictionaryRef> viewOptions = adoptWK(WKMutableDictionaryCreate()); + WKRetainPtr<WKStringRef> useFixedLayoutKey = adoptWK(WKStringCreateWithUTF8CString("UseFixedLayout")); + WKRetainPtr<WKBooleanRef> useFixedLayoutValue = adoptWK(WKBooleanCreate(shouldUseFixedLayout(pathOrURL))); + WKDictionaryAddItem(viewOptions.get(), useFixedLayoutKey.get(), useFixedLayoutValue.get()); + + TestController::shared().ensureViewSupportsOptions(viewOptions.get()); +#else + UNUSED_PARAM(pathOrURL); +#endif +} + void TestInvocation::invoke() { sizeWebViewForCurrentTest(m_pathOrURL.c_str()); + updateLayoutType(m_pathOrURL.c_str()); updateTiledDrawingForCurrentTest(m_pathOrURL.c_str()); WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("BeginTest")); |
