Changeset 190065 in webkit
- Timestamp:
- Sep 21, 2015 12:10:48 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 13 added
- 26 edited
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r190060 r190065 1 2015-09-21 Simon Fraser <simon.fraser@apple.com> 2 3 Add the ability for tests to run script in the UI process in WebKitTestRunner 4 https://bugs.webkit.org/show_bug.cgi?id=149356 5 6 Reviewed by Tim Horton. 7 8 Some new tests that exercise testRunner.runUIScript(). 9 10 * TestExpectations: 11 * fast/harness/concurrent-ui-side-scripts-expected.txt: Added. 12 * fast/harness/concurrent-ui-side-scripts.html: Added. 13 * fast/harness/ui-side-scripts-expected.txt: Added. 14 * fast/harness/ui-side-scripts.html: Added. 15 * fast/zooming/zoom-to-scale.html: Added. 16 * platform/ios-simulator/TestExpectations: 17 * platform/mac/TestExpectations: 18 1 19 2015-09-21 Tim Horton <timothy_horton@apple.com> 2 20 -
trunk/LayoutTests/TestExpectations
r190041 r190065 15 15 tiled-drawing [ Skip ] 16 16 swipe [ Skip ] 17 fast/zooming/ios [ Skip ] 17 18 18 19 fast/forms/attributed-strings.html [ Skip ] … … 39 40 # This test is WebKit2-only 40 41 http/tests/appcache/decide-navigation-policy-after-delay.html [ Skip ] 42 43 # Only Mac and iOS have an implementation of UIScriptController::doAsyncTask(). 44 fast/harness/ui-side-scripts.html [ Skip ] 45 fast/harness/concurrent-ui-side-scripts.html [ Skip ] 41 46 42 47 #////////////////////////////////////////////////////////////////////////////////////////// -
trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations
r189864 r190065 2 2 # 3 3 # See http://trac.webkit.org/wiki/TestExpectations for more information on this file. 4 5 #////////////////////////////////////////////////////////////////////////////////////////// 6 # Platform-specific directories. Skipped globally, then re-enabled here. 7 #////////////////////////////////////////////////////////////////////////////////////////// 8 9 fast/harness/ui-side-scripts.html [ Pass ] 10 fast/harness/concurrent-ui-side-scripts.html [ Pass ] 11 fast/zooming/ios [ Pass ] 12 13 #////////////////////////////////////////////////////////////////////////////////////////// 14 # End platform-specific directories. 15 #////////////////////////////////////////////////////////////////////////////////////////// 4 16 5 17 # Animation tests that fail: -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r190010 r190065 13 13 fast/events/force-click-on-link-navigation.html [ Pass ] 14 14 fast/events/force-click-text-selection-behavior.html [ Failure ] 15 16 fast/harness/ui-side-scripts.html [ Pass ] 17 fast/harness/concurrent-ui-side-scripts.html [ Pass ] 15 18 16 19 #////////////////////////////////////////////////////////////////////////////////////////// -
trunk/Source/WebKit2/ChangeLog
r190064 r190065 1 2015-09-21 Simon Fraser <simon.fraser@apple.com> 2 3 Add the ability for tests to run script in the UI process in WebKitTestRunner 4 https://bugs.webkit.org/show_bug.cgi?id=149356 5 6 Reviewed by Tim Horton. 7 8 Expose a few private functions for testing. 9 10 * UIProcess/API/Cocoa/WKWebView.mm: 11 * UIProcess/API/Cocoa/WKWebViewPrivate.h: 12 1 13 2015-09-21 Tim Horton <timothy_horton@apple.com> 2 14 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r189986 r190065 1597 1597 } 1598 1598 1599 // Unobscured content rect where the user can interact. When the keyboard is up, this should be the area above or bel low the keyboard, wherever there is enough space.1599 // Unobscured content rect where the user can interact. When the keyboard is up, this should be the area above or below the keyboard, wherever there is enough space. 1600 1600 - (CGRect)_contentRectForUserInteraction 1601 1601 { … … 3021 3021 } 3022 3022 3023 - (CGRect)_contentVisibleRect 3024 { 3025 return [self convertRect:[self bounds] toView:self._currentContentView]; 3026 } 3027 3028 - (CGPoint)_convertPointFromContentsToView:(CGPoint)point 3029 { 3030 return [self convertPoint:point fromView:self._currentContentView]; 3031 } 3032 3033 - (CGPoint)_convertPointFromViewToContents:(CGPoint)point 3034 { 3035 return [self convertPoint:point toView:self._currentContentView]; 3036 } 3037 3023 3038 - (_WKWebViewPrintFormatter *)_webViewPrintFormatter 3024 3039 { -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
r189551 r190065 126 126 @property (nonatomic, readonly) CGFloat _viewportMetaTagWidth; 127 127 128 @property (nonatomic, readonly) CGRect _contentVisibleRect; 129 128 130 @property (nonatomic, readonly) _WKWebViewPrintFormatter *_webViewPrintFormatter; 131 132 - (CGPoint)_convertPointFromContentsToView:(CGPoint)point; 133 - (CGPoint)_convertPointFromViewToContents:(CGPoint)point; 129 134 130 135 - (void)_beginInteractiveObscuredInsetsChange; -
trunk/Tools/ChangeLog
r190060 r190065 1 2015-09-21 Simon Fraser <simon.fraser@apple.com> 2 3 Add the ability for tests to run script in the UI process in WebKitTestRunner 4 https://bugs.webkit.org/show_bug.cgi?id=149356 5 6 Reviewed by Tim Horton. 7 8 This change adds testRunner.runUIScript(script, callback), which allows a test 9 to execute script in a JSContext which runs in the UI process. That context 10 has bindings exposed through the UIScriptController interface; currently one test 11 function, and some iOS-specific functions are included. UIScriptController can be 12 async with a callback, and runUIScript() itself is asynchronous. When the UI 13 script is complete, it calls uiController.uiScriptComplete(result), where 'result' 14 is a string passed back to the web process, and given to the runUIScript() 15 callback function. 16 17 Thanks to Gyuyoung Kim for help with the Gtk/Efl build. 18 19 * WebKitTestRunner/DerivedSources.make: Build UIScriptController.idl. 20 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: Add runUIScript(). 21 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 22 (WTR::InjectedBundle::didReceiveMessageToPage): When the UI-side script is 23 complete, call back into TestRunner. 24 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 25 (WTR::nextUIScriptCallbackID): 26 (WTR::TestRunner::runUIScript): Post a message to the injected bundle to run the UI script. 27 (WTR::TestRunner::runUIScriptCallback): When the UI script is done, execute its callback function. 28 * WebKitTestRunner/InjectedBundle/TestRunner.h: 29 * WebKitTestRunner/PlatformWebView.h: 30 * WebKitTestRunner/TestController.cpp: 31 (WTR::updateTestOptionsFromTestHeader): 32 (WTR::TestController::testOptionsForTest): Support "useFlexibleViewport" as a test argument. 33 (WTR::shouldUseFixedLayout): Deleted. Moved to a TestInvocation function. 34 * WebKitTestRunner/TestInvocation.cpp: 35 (WTR::TestInvocation::shouldUseFixedLayout): 36 (WTR::TestInvocation::shouldUseThreadedScrolling): 37 (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): 38 (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): 39 (WTR::TestInvocation::runUISideScript): Run the UI-side script! 40 (WTR::TestInvocation::uiScriptDidComplete): Send a message back to the injected bundle. 41 * WebKitTestRunner/TestInvocation.h: 42 * WebKitTestRunner/TestOptions.h: 43 * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: 44 * WebKitTestRunner/cocoa/TestControllerCocoa.mm: 45 * WebKitTestRunner/cocoa/TestRunnerWKWebView.h: Copied from Tools/WebKitTestRunner/TestOptions.h. 46 * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm: Added. 47 (-[TestRunnerWKWebView dragImage:at:offset:event:pasteboard:source:slideBack:]): 48 (-[TestRunnerWKWebView zoomToScale:animated:completionHandler:]): 49 (-[TestRunnerWKWebView scrollViewDidEndZooming:withView:atScale:]): 50 (-[TestRunnerWKWebView onDidEndZooming:]): Allow a test to hook into the end of zooming. 51 * WebKitTestRunner/ios/PlatformWebViewIOS.mm: 52 (WTR::PlatformWebView::PlatformWebView): Make a TestRunnerWKWebView on iOS. 53 * WebKitTestRunner/ios/UIScriptControllerIOS.mm: Added. 54 (WTR::UIScriptController::doAsyncTask): 55 (WTR::UIScriptController::zoomToScale): 56 (WTR::UIScriptController::zoomScale): 57 (WTR::UIScriptController::minimumZoomScale): 58 (WTR::UIScriptController::maximumZoomScale): 59 (WTR::UIScriptController::contentVisibleRect): 60 * WebKitTestRunner/mac/EventSenderProxy.mm: 61 * WebKitTestRunner/mac/PlatformWebViewMac.mm: 62 (-[TestRunnerWKWebView dragImage:at:offset:event:pasteboard:source:slideBack:]): Deleted. 63 * WebKitTestRunner/mac/TestControllerMac.mm: 64 (WTR::TestController::updatePlatformSpecificTestOptionsForTest): 65 (WTR::shouldUseThreadedScrolling): Deleted. Moved to TestInvocation. 66 * WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.h: 67 * WebKitTestRunner/uiscriptcontext/UIScriptContext.cpp: Added. Owns the JS context in the UI process. 68 (UIScriptContext::UIScriptContext): 69 (UIScriptContext::~UIScriptContext): 70 (UIScriptContext::runUIScript): Entrypoint to running the UI script. If the script didn't do anything 71 asynchronous, call the callback. 72 (UIScriptContext::nextTaskCallbackID): 73 (UIScriptContext::prepareForAsyncTask): Do setup for one async task (i.e. a UIScriptController function 74 that has a callback). Has to store the callbackID of the script, so code called from the completion 75 callback knows which UI script invoked it. 76 (UIScriptContext::asyncTaskComplete): Called when one task is finished. 77 (UIScriptContext::uiScriptComplete): 78 (UIScriptContext::objectFromRect): Make a JS object from a rect. 79 * WebKitTestRunner/uiscriptcontext/UIScriptContext.h: Copied from Tools/WebKitTestRunner/TestOptions.h. 80 (WTR::UIScriptContext::hasOutstandingAsyncTasks): 81 * WebKitTestRunner/uiscriptcontext/UIScriptController.cpp: Copied from Tools/WebKitTestRunner/TestOptions.h. 82 (WTR::UIScriptController::UIScriptController): 83 (WTR::UIScriptController::makeWindowObject): 84 (WTR::UIScriptController::wrapperClass): 85 (WTR::UIScriptController::doAsyncTask): 86 (WTR::UIScriptController::zoomToScale): 87 (WTR::UIScriptController::zoomScale): 88 (WTR::UIScriptController::minimumZoomScale): 89 (WTR::UIScriptController::maximumZoomScale): 90 (WTR::UIScriptController::contentVisibleRect): 91 (WTR::UIScriptController::uiScriptComplete): 92 * WebKitTestRunner/uiscriptcontext/UIScriptController.h: Copied from Tools/WebKitTestRunner/TestOptions.h. 93 (WTR::UIScriptController::create): 94 * WebKitTestRunner/uiscriptcontext/bindings/UIScriptController.idl: Copied from Tools/WebKitTestRunner/TestOptions.h. 95 1 96 2015-09-21 Tim Horton <timothy_horton@apple.com> 2 97 -
trunk/Tools/WebKitTestRunner/CMakeLists.txt
r185806 r190065 1 1 set(WEBKIT_TESTRUNNER_DIR "${TOOLS_DIR}/WebKitTestRunner") 2 2 set(WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR "${TOOLS_DIR}/WebKitTestRunner/InjectedBundle") 3 set(WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR "${TOOLS_DIR}/WebKitTestRunner/UIScriptContext") 3 4 4 5 file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/InjectedBundle) 6 file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/UIScriptContext) 5 7 6 8 set(WebKitTestRunner_SOURCES … … 13 15 ${WEBKIT_TESTRUNNER_DIR}/WebNotificationProvider.cpp 14 16 ${WEBKIT_TESTRUNNER_DIR}/WorkQueueManager.cpp 17 ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/UIScriptContext.cpp 18 ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/UIScriptController.cpp 19 20 ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/JSWrapper.cpp 15 21 ) 16 22 … … 27 33 ${WEBKIT_TESTRUNNER_DIR}/InjectedBundle/Bindings 28 34 ${WEBKIT_TESTRUNNER_DIR}/InjectedBundle/atk 35 ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR} 36 ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/Bindings 29 37 ${JAVASCRIPTCORE_DIR} 30 38 ${JAVASCRIPTCORE_DIR}/ForwardingHeaders … … 48 56 ${WTF_DIR} 49 57 ${DERIVED_SOURCES_DIR}/InjectedBundle 58 ${DERIVED_SOURCES_DIR}/UIScriptContext 50 59 ${CMAKE_BINARY_DIR} 51 60 ${CMAKE_SOURCE_DIR}/Source … … 83 92 ) 84 93 85 set(WebKitTestRunner InjectedBundle_LIBRARIES86 ${WebKitTestRunner_LIBRARIES}94 set(WebKitTestRunner_IDL_FILES 95 "${WEBKIT_TESTRUNNER_DIR}/UIScriptContext/Bindings/UIScriptController.idl" 87 96 ) 88 97 … … 95 104 ${WEBCORE_DIR}/bindings/scripts/IDLAttributes.txt) 96 105 106 GENERATE_BINDINGS(WebKitTestRunner_SOURCES 107 "${WebKitTestRunner_IDL_FILES}" 108 "${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings" 109 "--include=${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings" 110 "${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}" 111 ${DERIVED_SOURCES_DIR}/UIScriptContext JS TestRunner cpp 112 ${WEBCORE_DIR}/bindings/scripts/IDLAttributes.txt) 113 97 114 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS() 98 115 … … 101 118 102 119 add_library(TestRunnerInjectedBundle SHARED ${WebKitTestRunnerInjectedBundle_SOURCES}) 103 target_link_libraries(TestRunnerInjectedBundle ${WebKitTestRunner InjectedBundle_LIBRARIES})120 target_link_libraries(TestRunnerInjectedBundle ${WebKitTestRunner_LIBRARIES}) 104 121 105 122 add_executable(WebKitTestRunner ${WebKitTestRunner_SOURCES}) -
trunk/Tools/WebKitTestRunner/DerivedSources.make
r135129 r190065 24 24 VPATH = \ 25 25 $(WebKitTestRunner)/InjectedBundle/Bindings \ 26 $(WebKitTestRunner)/UIScriptContext/Bindings \ 26 27 # 27 28 28 IN TERFACES = \29 INJECTED_BUNDLE_INTERFACES = \ 29 30 AccessibilityController \ 30 31 AccessibilityTextMarker \ … … 35 36 TestRunner \ 36 37 TextInputController \ 38 # 39 40 UICONTEXT_INTERFACES = \ 41 UIScriptController \ 37 42 # 38 43 … … 48 53 JS%.h JS%.cpp : %.idl $(SCRIPTS) 49 54 @echo Generating bindings for $*... 50 @perl -I $(WebCoreScripts) -I $(WebKitTestRunner)/InjectedBundle/Bindings $(WebCoreScripts)/generate-bindings.pl --defines "" --include InjectedBundle/Bindings --outputDir . --generator TestRunner $<55 @perl -I $(WebCoreScripts) -I $(WebKitTestRunner)/InjectedBundle/Bindings -I $(WebKitTestRunner)/UIScriptContext/Bindings $(WebCoreScripts)/generate-bindings.pl --defines "" --include InjectedBundle/Bindings --include UIScriptContext/Bindings --outputDir . --generator TestRunner $< 51 56 52 57 all : \ 53 $(INTERFACES:%=JS%.h) \ 54 $(INTERFACES:%=JS%.cpp) \ 58 $(INJECTED_BUNDLE_INTERFACES:%=JS%.h) \ 59 $(INJECTED_BUNDLE_INTERFACES:%=JS%.cpp) \ 60 $(UICONTEXT_INTERFACES:%=JS%.h) \ 61 $(UICONTEXT_INTERFACES:%=JS%.cpp) \ 55 62 # -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r189321 r190065 214 214 void installDidEndSwipeCallback(object callback); 215 215 void installDidRemoveSwipeSnapshotCallback(object callback); 216 217 // UI Process Testing 218 void runUIScript(DOMString script, object callback); 216 219 }; 217 220 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r190035 r190065 236 236 } 237 237 238 if (WKStringIsEqualToUTF8CString(messageName, "CallUISideScriptCallback")) { 239 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 240 241 WKRetainPtr<WKStringRef> resultKey(AdoptWK, WKStringCreateWithUTF8CString("Result")); 242 WKRetainPtr<WKStringRef> callbackIDKey(AdoptWK, WKStringCreateWithUTF8CString("CallbackID")); 243 244 unsigned callbackID = (unsigned)WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, callbackIDKey.get()))); 245 246 WKStringRef resultString = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, resultKey.get())); 247 auto resultJSString = toJS(resultString); 248 249 m_testRunner->runUIScriptCallback(callbackID, resultJSString.get()); 250 return; 251 } 252 238 253 if (WKStringIsEqualToUTF8CString(messageName, "WorkQueueProcessedCallback")) { 239 254 if (!topLoadingFrame() && !m_testRunner->waitToDump()) -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r189321 r190065 514 514 WillEndSwipeCallbackID, 515 515 DidEndSwipeCallbackID, 516 DidRemoveSwipeSnapshotCallbackID 516 DidRemoveSwipeSnapshotCallbackID, 517 FirstUIScriptCallbackID = 100 517 518 }; 518 519 … … 533 534 } 534 535 535 static void callTestRunnerCallback(unsigned index )536 static void callTestRunnerCallback(unsigned index, size_t argumentCount = 0, const JSValueRef arguments[] = nullptr) 536 537 { 537 538 if (!callbackMap().contains(index)) … … 540 541 JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame); 541 542 JSObjectRef callback = JSValueToObject(context, callbackMap().take(index), 0); 542 JSObjectCallAsFunction(context, callback, JSContextGetGlobalObject(context), 0, 0, 0);543 JSObjectCallAsFunction(context, callback, JSContextGetGlobalObject(context), argumentCount, arguments, 0); 543 544 JSValueUnprotect(context, callback); 544 545 } … … 889 890 } 890 891 892 static unsigned nextUIScriptCallbackID() 893 { 894 static unsigned callbackID = FirstUIScriptCallbackID; 895 return callbackID++; 896 } 897 898 void TestRunner::runUIScript(JSStringRef script, JSValueRef callback) 899 { 900 unsigned callbackID = nextUIScriptCallbackID(); 901 cacheTestRunnerCallback(callbackID, callback); 902 903 WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("RunUIProcessScript")); 904 905 WKRetainPtr<WKMutableDictionaryRef> testDictionary(AdoptWK, WKMutableDictionaryCreate()); 906 907 WKRetainPtr<WKStringRef> scriptKey(AdoptWK, WKStringCreateWithUTF8CString("Script")); 908 WKRetainPtr<WKStringRef> scriptValue(AdoptWK, WKStringCreateWithJSString(script)); 909 910 WKRetainPtr<WKStringRef> callbackIDKey(AdoptWK, WKStringCreateWithUTF8CString("CallbackID")); 911 WKRetainPtr<WKUInt64Ref> callbackIDValue = adoptWK(WKUInt64Create(callbackID)); 912 913 WKDictionarySetItem(testDictionary.get(), scriptKey.get(), scriptValue.get()); 914 WKDictionarySetItem(testDictionary.get(), callbackIDKey.get(), callbackIDValue.get()); 915 916 WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), testDictionary.get()); 917 } 918 919 void TestRunner::runUIScriptCallback(unsigned callbackID, JSStringRef result) 920 { 921 WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::singleton().page()->page()); 922 JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame); 923 924 JSValueRef resultValue = JSValueMakeString(context, result); 925 callTestRunnerCallback(callbackID, 1, &resultValue); 926 } 927 891 928 void TestRunner::installDidBeginSwipeCallback(JSValueRef callback) 892 929 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r189321 r190065 288 288 void setNavigationGesturesEnabled(bool); 289 289 290 void runUIScript(JSStringRef script, JSValueRef callback); 291 void runUIScriptCallback(unsigned callbackID, JSStringRef result); 292 290 293 void installDidBeginSwipeCallback(JSValueRef); 291 294 void installWillEndSwipeCallback(JSValueRef); -
trunk/Tools/WebKitTestRunner/PlatformWebView.h
r189959 r190065 34 34 OBJC_CLASS NSView; 35 35 OBJC_CLASS UIView; 36 OBJC_CLASS WKWebView;36 OBJC_CLASS TestRunnerWKWebView; 37 37 OBJC_CLASS WKWebViewConfiguration; 38 38 OBJC_CLASS WebKitTestRunnerWindow; 39 39 40 40 #if WK_API_ENABLED 41 typedef WKWebView *PlatformWKView;41 typedef TestRunnerWKWebView *PlatformWKView; 42 42 #else 43 43 typedef NSView *PlatformWKView; -
trunk/Tools/WebKitTestRunner/TestController.cpp
r189981 r190065 808 808 } 809 809 810 static bool shouldUseFixedLayout(const TestInvocation& test)811 {812 #if ENABLE(CSS_DEVICE_ADAPTATION)813 if (test.urlContains("device-adapt/") || test.urlContains("device-adapt\\"))814 return true;815 #endif816 817 return false;818 }819 820 810 static std::string testPath(const WKURLRef url) 821 811 { … … 879 869 if (key == "useThreadedScrolling") 880 870 testOptions.useThreadedScrolling = parseBooleanTestHeaderValue(value); 871 if (key == "useFlexibleViewport") 872 testOptions.useFlexibleViewport = parseBooleanTestHeaderValue(value); 881 873 pairStart = pairEnd + 1; 882 874 } … … 889 881 options.useRemoteLayerTree = m_shouldUseRemoteLayerTree; 890 882 options.shouldShowWebView = m_shouldShowWebView; 891 options.useFixedLayout = shouldUseFixedLayout(test); 883 options.useFixedLayout = test.shouldUseFixedLayout(); 884 options.useFlexibleViewport = test.shouldMakeViewportFlexible(); 892 885 893 886 updatePlatformSpecificTestOptionsForTest(options, test); -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r190009 r190065 31 31 #include "StringFunctions.h" 32 32 #include "TestController.h" 33 #include "UIScriptController.h" 33 34 #include <WebKit/WKContextPrivate.h> 34 35 #include <WebKit/WKCookieManager.h> … … 53 54 #include <unistd.h> // For getcwd. 54 55 56 using namespace JSC; 55 57 using namespace WebKit; 56 58 using namespace std; … … 148 150 } 149 151 152 bool TestInvocation::shouldUseFixedLayout() const 153 { 154 #if ENABLE(CSS_DEVICE_ADAPTATION) 155 if (urlContains("device-adapt/") || urlContains("device-adapt\\")) 156 return true; 157 #endif 158 159 return false; 160 } 161 150 162 void TestInvocation::invoke() 151 163 { … … 652 664 } 653 665 666 if (WKStringIsEqualToUTF8CString(messageName, "RunUIProcessScript")) { 667 WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); 668 WKRetainPtr<WKStringRef> scriptKey(AdoptWK, WKStringCreateWithUTF8CString("Script")); 669 WKRetainPtr<WKStringRef> callbackIDKey(AdoptWK, WKStringCreateWithUTF8CString("CallbackID")); 670 671 unsigned callbackID = (unsigned)WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, callbackIDKey.get()))); 672 WKStringRef scriptString = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, scriptKey.get())); 673 674 runUISideScript(scriptString, callbackID); 675 return; 676 } 677 654 678 ASSERT_NOT_REACHED(); 655 679 } … … 661 685 WKBooleanRef isKeyValue = static_cast<WKBooleanRef>(messageBody); 662 686 TestController::singleton().mainWebView()->setWindowIsKey(WKBooleanGetValue(isKeyValue)); 663 return 0;687 return nullptr; 664 688 } 665 689 … … 690 714 // FIXME: This updates the policy in WebProcess and in NetworkProcess asynchronously, which might break some tests' expectations. 691 715 WKCookieManagerSetHTTPCookieAcceptPolicy(WKContextGetCookieManager(TestController::singleton().context()), policy); 692 return 0;716 return nullptr; 693 717 } 694 718 695 719 ASSERT_NOT_REACHED(); 696 return 0; 720 return nullptr; 721 } 722 723 void TestInvocation::runUISideScript(WKStringRef script, unsigned scriptCallbackID) 724 { 725 if (!m_UIScriptContext) 726 m_UIScriptContext = std::make_unique<UIScriptContext>(*this); 727 728 m_UIScriptContext->runUIScript(script, scriptCallbackID); 729 } 730 731 void TestInvocation::uiScriptDidComplete(WKStringRef result, unsigned scriptCallbackID) 732 { 733 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallUISideScriptCallback")); 734 735 WKRetainPtr<WKMutableDictionaryRef> messageBody(AdoptWK, WKMutableDictionaryCreate()); 736 WKRetainPtr<WKStringRef> resultKey(AdoptWK, WKStringCreateWithUTF8CString("Result")); 737 WKRetainPtr<WKStringRef> callbackIDKey(AdoptWK, WKStringCreateWithUTF8CString("CallbackID")); 738 WKRetainPtr<WKUInt64Ref> callbackIDValue = adoptWK(WKUInt64Create(scriptCallbackID)); 739 740 WKDictionarySetItem(messageBody.get(), resultKey.get(), result); 741 WKDictionarySetItem(messageBody.get(), callbackIDKey.get(), callbackIDValue.get()); 742 743 WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), messageBody.get()); 697 744 } 698 745 -
trunk/Tools/WebKitTestRunner/TestInvocation.h
r190009 r190065 27 27 #define TestInvocation_h 28 28 29 #include "JSWrappable.h" 30 #include "UIScriptContext.h" 31 #include <JavaScriptCore/JSRetainPtr.h> 29 32 #include <WebKit/WKRetainPtr.h> 30 33 #include <string> … … 34 37 namespace WTR { 35 38 36 class TestInvocation {39 class TestInvocation : public UIScriptContextDelegate { 37 40 WTF_MAKE_NONCOPYABLE(TestInvocation); 38 41 public: … … 62 65 63 66 bool shouldMakeViewportFlexible() const; 67 bool shouldUseFixedLayout() const; 64 68 65 69 private: … … 74 78 bool shouldLogFrameLoadDelegates() const; 75 79 bool shouldLogHistoryClientCallbacks() const; 80 81 void runUISideScript(WKStringRef, unsigned callbackID); 82 // UIScriptContextDelegate 83 void uiScriptDidComplete(WKStringRef result, unsigned callbackID) override; 76 84 77 85 WKRetainPtr<WKURLRef> m_url; … … 95 103 std::string m_errorMessage; 96 104 bool m_webProcessIsUnresponsive; 105 106 std::unique_ptr<UIScriptContext> m_UIScriptContext; 97 107 98 108 }; -
trunk/Tools/WebKitTestRunner/TestOptions.h
r189669 r190065 36 36 bool useRemoteLayerTree { false }; 37 37 bool shouldShowWebView { false }; 38 38 bool useFlexibleViewport { false }; 39 39 bool useFixedLayout { false }; 40 40 Vector<String> overrideLanguages; -
trunk/Tools/WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl
r190064 r190065 24 24 */ 25 25 26 #ifndef TestOptions_h 27 #define TestOptions_h 26 interface UIScriptController { 28 27 29 #include <wtf/Vector.h> 30 #include <wtf/text/WTFString.h> 28 void doAsyncTask(object callback); // Used to test the harness. 31 29 32 namespace WTR { 30 void zoomToScale(double scale, object callback); 33 31 34 struct TestOptions { 35 bool useThreadedScrolling { false }; 36 bool useRemoteLayerTree { false }; 37 bool shouldShowWebView { false }; 32 readonly attribute double zoomScale; 33 readonly attribute double minimumZoomScale; 34 readonly attribute double maximumZoomScale; 38 35 39 bool useFixedLayout { false }; 40 Vector<String> overrideLanguages; 36 readonly attribute object contentVisibleRect; // Returned object has 'left', 'top', 'width', 'height' properties. 37 38 void uiScriptComplete(DOMString result); 41 39 }; 42 43 }44 45 #endif // TestOptions_h -
trunk/Tools/WebKitTestRunner/UIScriptContext/UIScriptContext.h
r190064 r190065 24 24 */ 25 25 26 #ifndef TestOptions_h27 #define TestOptions_h26 #ifndef UIScriptContext_h 27 #define UIScriptContext_h 28 28 29 #include <wtf/Vector.h> 30 #include <wtf/text/WTFString.h> 29 #include <JavaScriptCore/JSRetainPtr.h> 30 #include <wtf/HashMap.h> 31 #include <wtf/RefPtr.h> 31 32 32 33 namespace WTR { 33 34 34 struct TestOptions { 35 bool useThreadedScrolling { false }; 36 bool useRemoteLayerTree { false }; 37 bool shouldShowWebView { false }; 35 class UIScriptController; 38 36 39 bool useFixedLayout { false }; 40 Vector<String> overrideLanguages; 37 class UIScriptContextDelegate { 38 public: 39 virtual void uiScriptDidComplete(WKStringRef result, unsigned callbackID) = 0; 40 }; 41 42 class UIScriptContext { 43 public: 44 45 UIScriptContext(UIScriptContextDelegate&); 46 47 void runUIScript(WKStringRef script, unsigned scriptCallbackID); 48 void uiScriptComplete(JSStringRef); 49 50 unsigned prepareForAsyncTask(JSValueRef taskCallback); 51 void asyncTaskComplete(unsigned taskCallbackID); 52 53 unsigned nextTaskCallbackID(); 54 55 JSObjectRef objectFromRect(const WKRect&) const; 56 57 private: 58 JSRetainPtr<JSGlobalContextRef> m_context; 59 60 bool hasOutstandingAsyncTasks() const { return !m_callbacks.isEmpty(); } 61 62 struct Task { 63 unsigned parentScriptCallbackID { 0 }; 64 JSValueRef callback { nullptr }; 65 }; 66 HashMap<unsigned, Task> m_callbacks; 67 68 UIScriptContextDelegate& m_delegate; 69 RefPtr<UIScriptController> m_controller; 70 71 unsigned m_currentScriptCallbackID { 0 }; 72 unsigned m_nextTaskCallbackID { 0 }; 41 73 }; 42 74 43 75 } 44 76 45 #endif // TestOptions_h77 #endif // UIScriptContext_h -
trunk/Tools/WebKitTestRunner/UIScriptContext/UIScriptController.cpp
r190064 r190065 24 24 */ 25 25 26 #i fndef TestOptions_h27 # define TestOptions_h26 #include "config.h" 27 #include "UIScriptController.h" 28 28 29 #include <wtf/Vector.h> 30 #include <wtf/text/WTFString.h> 29 #include "JSUIScriptController.h" 30 #include "UIScriptContext.h" 31 // #include <JavaScriptCore/JavaScriptCore.h> 31 32 32 33 namespace WTR { 33 34 34 struct TestOptions { 35 bool useThreadedScrolling { false };36 bool useRemoteLayerTree { false }; 37 bool shouldShowWebView { false }; 35 UIScriptController::UIScriptController(UIScriptContext& context) 36 : m_context(context) 37 { 38 } 38 39 39 bool useFixedLayout { false }; 40 Vector<String> overrideLanguages; 41 }; 40 void UIScriptController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) 41 { 42 setProperty(context, windowObject, "uiController", this, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception); 43 } 44 45 JSClassRef UIScriptController::wrapperClass() 46 { 47 return JSUIScriptController::uIScriptControllerClass(); 48 } 49 50 #if !PLATFORM(COCOA) 51 void UIScriptController::doAsyncTask(JSValueRef) 52 { 53 } 54 #endif 55 56 #if !PLATFORM(IOS) 57 void UIScriptController::zoomToScale(double, JSValueRef) 58 { 59 } 60 61 double UIScriptController::zoomScale() const 62 { 63 return 1; 64 } 65 66 double UIScriptController::minimumZoomScale() const 67 { 68 return 1; 69 } 70 71 double UIScriptController::maximumZoomScale() const 72 { 73 return 1; 74 } 75 76 JSObjectRef UIScriptController::contentVisibleRect() const 77 { 78 return nullptr; 79 } 80 #endif 81 82 void UIScriptController::uiScriptComplete(JSStringRef result) 83 { 84 m_context.uiScriptComplete(result); 85 } 42 86 43 87 } 44 45 #endif // TestOptions_h -
trunk/Tools/WebKitTestRunner/UIScriptContext/UIScriptController.h
r190064 r190065 24 24 */ 25 25 26 #ifndef TestOptions_h27 #define TestOptions_h26 #ifndef UIScriptController_h 27 #define UIScriptController_h 28 28 29 #include <wtf/Vector.h>30 #include <wtf/ text/WTFString.h>29 #include "JSWrappable.h" 30 #include <wtf/Ref.h> 31 31 32 32 namespace WTR { 33 33 34 struct TestOptions { 35 bool useThreadedScrolling { false }; 36 bool useRemoteLayerTree { false }; 37 bool shouldShowWebView { false }; 34 class UIScriptContext; 38 35 39 bool useFixedLayout { false }; 40 Vector<String> overrideLanguages; 36 class UIScriptController : public JSWrappable { 37 public: 38 static Ref<UIScriptController> create(UIScriptContext& context) 39 { 40 return adoptRef(*new UIScriptController(context)); 41 } 42 43 void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception); 44 45 void doAsyncTask(JSValueRef callback); 46 void zoomToScale(double scale, JSValueRef callback); 47 48 double zoomScale() const; 49 double minimumZoomScale() const; 50 double maximumZoomScale() const; 51 52 JSObjectRef contentVisibleRect() const; 53 54 void uiScriptComplete(JSStringRef result); 55 56 private: 57 UIScriptController(UIScriptContext&); 58 59 virtual JSClassRef wrapperClass() override; 60 61 JSObjectRef objectFromRect(const WKRect&) const; 62 63 UIScriptContext& m_context; 41 64 }; 42 65 43 66 } 44 67 45 #endif // TestOptions_h68 #endif // UIScriptController_h -
trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
r189948 r190065 35 35 /* Begin PBXBuildFile section */ 36 36 0F5169CC1445222D00E0A9D7 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F5169CA1445222D00E0A9D7 /* WebKit.framework */; }; 37 0F831AEA1BAB84F400F96CD8 /* Launch.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0F831AE91BAB84F400F96CD8 /* Launch.storyboard */; settings = {ASSET_TAGS = (); }; }; 37 0F73B5511BA78968004B3EF4 /* JSUIScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F73B54F1BA78968004B3EF4 /* JSUIScriptController.cpp */; }; 38 0F73B5521BA78968004B3EF4 /* JSUIScriptController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F73B5501BA78968004B3EF4 /* JSUIScriptController.h */; }; 39 0F73B55A1BA792FF004B3EF4 /* JSWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952C0C11F3B965003398B4 /* JSWrapper.cpp */; }; 40 0F73B55C1BA89042004B3EF4 /* UIScriptControllerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F73B55B1BA89042004B3EF4 /* UIScriptControllerIOS.mm */; }; 41 0F87B6131BACAD82004EC572 /* UIScriptControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F87B6111BACAD6F004EC572 /* UIScriptControllerMac.mm */; settings = {ASSET_TAGS = (); }; }; 42 0F87B6171BACC4C0004EC572 /* TestRunnerWKWebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F87B6151BACC4B9004EC572 /* TestRunnerWKWebView.mm */; settings = {ASSET_TAGS = (); }; }; 43 0F87B6191BACC558004EC572 /* Launch.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0F87B6181BACC558004EC572 /* Launch.storyboard */; settings = {ASSET_TAGS = (); }; }; 44 0F87B61E1BACDA93004EC572 /* UIScriptContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F87B61A1BACDA93004EC572 /* UIScriptContext.cpp */; settings = {ASSET_TAGS = (); }; }; 45 0F87B6201BACDA93004EC572 /* UIScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F87B61C1BACDA93004EC572 /* UIScriptController.cpp */; settings = {ASSET_TAGS = (); }; }; 38 46 0FEB90A01905A834000FDBF3 /* InjectedBundlePageCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FEB909E1905A776000FDBF3 /* InjectedBundlePageCocoa.mm */; }; 39 47 0FEB90A51905C016000FDBF3 /* CrashReporterInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FEB90A31905BC6A000FDBF3 /* CrashReporterInfo.mm */; }; … … 163 171 0F2109C7189C650D00F879A3 /* BaseTarget.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = BaseTarget.xcconfig; sourceTree = "<group>"; }; 164 172 0F5169CA1445222D00E0A9D7 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 165 0F831AE91BAB84F400F96CD8 /* Launch.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Launch.storyboard; sourceTree = "<group>"; }; 173 0F73B54F1BA78968004B3EF4 /* JSUIScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSUIScriptController.cpp; path = DerivedSources/WebKitTestRunner/JSUIScriptController.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; 174 0F73B5501BA78968004B3EF4 /* JSUIScriptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSUIScriptController.h; path = DerivedSources/WebKitTestRunner/JSUIScriptController.h; sourceTree = BUILT_PRODUCTS_DIR; }; 175 0F73B5571BA7929E004B3EF4 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 176 0F73B55B1BA89042004B3EF4 /* UIScriptControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIScriptControllerIOS.mm; sourceTree = "<group>"; }; 177 0F831AE71BAB72D000F96CD8 /* Launch.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Launch.storyboard; sourceTree = "<group>"; }; 178 0F87B6111BACAD6F004EC572 /* UIScriptControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIScriptControllerMac.mm; sourceTree = "<group>"; }; 179 0F87B6141BACC4B9004EC572 /* TestRunnerWKWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestRunnerWKWebView.h; path = cocoa/TestRunnerWKWebView.h; sourceTree = "<group>"; }; 180 0F87B6151BACC4B9004EC572 /* TestRunnerWKWebView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestRunnerWKWebView.mm; path = cocoa/TestRunnerWKWebView.mm; sourceTree = "<group>"; }; 181 0F87B6181BACC558004EC572 /* Launch.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Launch.storyboard; sourceTree = "<group>"; }; 182 0F87B61A1BACDA93004EC572 /* UIScriptContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UIScriptContext.cpp; path = UIScriptContext/UIScriptContext.cpp; sourceTree = "<group>"; }; 183 0F87B61B1BACDA93004EC572 /* UIScriptContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIScriptContext.h; path = UIScriptContext/UIScriptContext.h; sourceTree = "<group>"; }; 184 0F87B61C1BACDA93004EC572 /* UIScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UIScriptController.cpp; path = UIScriptContext/UIScriptController.cpp; sourceTree = "<group>"; }; 185 0F87B61D1BACDA93004EC572 /* UIScriptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIScriptController.h; path = UIScriptContext/UIScriptController.h; sourceTree = "<group>"; }; 186 0F87B6221BACDAA2004EC572 /* UIScriptController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = UIScriptController.idl; path = UIScriptContext/Bindings/UIScriptController.idl; sourceTree = "<group>"; }; 166 187 0FEB909E1905A776000FDBF3 /* InjectedBundlePageCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InjectedBundlePageCocoa.mm; sourceTree = "<group>"; }; 167 188 0FEB90A21905BC6A000FDBF3 /* CrashReporterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CrashReporterInfo.h; path = cocoa/CrashReporterInfo.h; sourceTree = "<group>"; }; … … 392 413 4429FC5E1627089600F66D8B /* WorkQueueManager.cpp */, 393 414 4429FC611627089600F66D8B /* WorkQueueManager.h */, 415 0F73B5471BA782FE004B3EF4 /* UIScriptContext */, 394 416 ); 395 417 name = TestRunner; … … 409 431 sourceTree = "<group>"; 410 432 }; 433 0F73B5471BA782FE004B3EF4 /* UIScriptContext */ = { 434 isa = PBXGroup; 435 children = ( 436 0F73B54E1BA78954004B3EF4 /* Derived Sources */, 437 0F73B54B1BA78350004B3EF4 /* Bindings */, 438 0F87B61A1BACDA93004EC572 /* UIScriptContext.cpp */, 439 0F87B61B1BACDA93004EC572 /* UIScriptContext.h */, 440 0F87B61C1BACDA93004EC572 /* UIScriptController.cpp */, 441 0F87B61D1BACDA93004EC572 /* UIScriptController.h */, 442 ); 443 name = UIScriptContext; 444 sourceTree = "<group>"; 445 }; 446 0F73B54B1BA78350004B3EF4 /* Bindings */ = { 447 isa = PBXGroup; 448 children = ( 449 0F87B6221BACDAA2004EC572 /* UIScriptController.idl */, 450 ); 451 name = Bindings; 452 sourceTree = "<group>"; 453 }; 454 0F73B54E1BA78954004B3EF4 /* Derived Sources */ = { 455 isa = PBXGroup; 456 children = ( 457 0F73B54F1BA78968004B3EF4 /* JSUIScriptController.cpp */, 458 0F73B5501BA78968004B3EF4 /* JSUIScriptController.h */, 459 ); 460 name = "Derived Sources"; 461 sourceTree = "<group>"; 462 }; 411 463 0FEB909D1905A75D000FDBF3 /* cocoa */ = { 412 464 isa = PBXGroup; … … 424 476 0FEB90A31905BC6A000FDBF3 /* CrashReporterInfo.mm */, 425 477 2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */, 478 0F87B6141BACC4B9004EC572 /* TestRunnerWKWebView.h */, 479 0F87B6151BACC4B9004EC572 /* TestRunnerWKWebView.mm */, 426 480 ); 427 481 name = cocoa; … … 473 527 isa = PBXGroup; 474 528 children = ( 529 0F73B5571BA7929E004B3EF4 /* JavaScriptCore.framework */, 475 530 2EE52CE21890A9A80010ED21 /* Foundation.framework */, 476 531 2EE52CE41890A9A80010ED21 /* CoreGraphics.framework */, … … 492 547 isa = PBXGroup; 493 548 children = ( 494 0F8 31AE91BAB84F400F96CD8/* Launch.storyboard */,549 0F87B6181BACC558004EC572 /* Launch.storyboard */, 495 550 2EE52CEB1890A9A80010ED21 /* InfoPlist.strings */, 496 551 2EE52D131890A9FB0010ED21 /* PlatformWebViewIOS.mm */, 497 552 2EE52D141890A9FB0010ED21 /* TestControllerIOS.mm */, 553 0F73B55B1BA89042004B3EF4 /* UIScriptControllerIOS.mm */, 498 554 2EE52D151890A9FB0010ED21 /* WebArchiveDumpSupportIOS.mm */, 499 555 2EE52D161890A9FB0010ED21 /* mainIOS.mm */, 556 0F831AE71BAB72D000F96CD8 /* Launch.storyboard */, 500 557 ); 501 558 path = ios; … … 588 645 E1C642C117CBCC7300D66A3C /* PoseAsClass.mm */, 589 646 BC8C795B11D2785D004535A1 /* TestControllerMac.mm */, 647 0F87B6111BACAD6F004EC572 /* UIScriptControllerMac.mm */, 590 648 E132AA3917CD5F1000611DF0 /* WebKitTestRunnerDraggingInfo.h */, 591 649 E132AA3817CD5F1000611DF0 /* WebKitTestRunnerDraggingInfo.mm */, … … 678 736 buildActionMask = 2147483647; 679 737 files = ( 738 0F73B5521BA78968004B3EF4 /* JSUIScriptController.h in Headers */, 680 739 ); 681 740 runOnlyForDeploymentPostprocessing = 0; … … 804 863 2E34C90018B68808000067BB /* WebKitTestRunnerInjectedBundle.bundle in Resources */, 805 864 2EE52CED1890A9A80010ED21 /* InfoPlist.strings in Resources */, 806 0F8 31AEA1BAB84F400F96CD8/* Launch.storyboard in Resources */,865 0F87B6191BACC558004EC572 /* Launch.storyboard in Resources */, 807 866 ); 808 867 runOnlyForDeploymentPostprocessing = 0; … … 866 925 BC793400118F7C84005EA8E2 /* main.mm in Sources */, 867 926 E1C642C617CBCD4C00D66A3C /* WebKitTestRunnerPasteboard.mm in Sources */, 927 0F87B6131BACAD82004EC572 /* UIScriptControllerMac.mm in Sources */, 868 928 BC7934E811906846005EA8E2 /* PlatformWebViewMac.mm in Sources */, 869 929 BC8C795C11D2785D004535A1 /* TestControllerMac.mm in Sources */, … … 876 936 buildActionMask = 2147483647; 877 937 files = ( 938 0F73B55A1BA792FF004B3EF4 /* JSWrapper.cpp in Sources */, 878 939 A18510441B9AE14A00744AEB /* WorkQueueManager.cpp in Sources */, 879 940 A185103F1B9AE12900744AEB /* GeolocationProviderMock.cpp in Sources */, 941 0F73B55C1BA89042004B3EF4 /* UIScriptControllerIOS.mm in Sources */, 880 942 A185103C1B9AE0FE00744AEB /* Options.cpp in Sources */, 881 943 A18510431B9AE14500744AEB /* WebNotificationProvider.cpp in Sources */, 882 944 A18510411B9AE13800744AEB /* TestController.cpp in Sources */, 945 0F87B6201BACDA93004EC572 /* UIScriptController.cpp in Sources */, 883 946 A18510421B9AE13E00744AEB /* TestInvocation.cpp in Sources */, 884 947 A18510401B9AE13100744AEB /* PixelDumpSupport.cpp in Sources */, 885 948 A185103D1B9AE10600744AEB /* TestInvocationCG.cpp in Sources */, 886 949 A185103A1B9AE0DA00744AEB /* CrashReporterInfo.mm in Sources */, 950 0F73B5511BA78968004B3EF4 /* JSUIScriptController.cpp in Sources */, 951 0F87B61E1BACDA93004EC572 /* UIScriptContext.cpp in Sources */, 887 952 A185103E1B9AE12200744AEB /* CyclicRedundancyCheck.cpp in Sources */, 953 0F87B6171BACC4C0004EC572 /* TestRunnerWKWebView.mm in Sources */, 888 954 A185103B1B9AE0E200744AEB /* TestControllerCocoa.mm in Sources */, 889 955 ); … … 1194 1260 ); 1195 1261 defaultConfigurationIsVisible = 0; 1262 defaultConfigurationName = Production; 1196 1263 }; 1197 1264 A185102D1B9ADE4800744AEB /* Build configuration list for PBXNativeTarget "WebKitTestRunner (Library)" */ = { -
trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm
r189668 r190065 30 30 #import "PlatformWebView.h" 31 31 #import "TestInvocation.h" 32 #import "TestRunnerWKWebView.h" 32 33 #import <Foundation/Foundation.h> 33 34 #import <WebKit/WKContextConfigurationRef.h> -
trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.h
r190064 r190065 24 24 */ 25 25 26 #ifndef TestOptions_h 27 #define TestOptions_h 26 #import <WebKit/WebKit.h> 28 27 29 #include <wtf/Vector.h> 30 #include <wtf/text/WTFString.h> 28 #if WK_API_ENABLED 31 29 32 namespace WTR { 30 @interface TestRunnerWKWebView : WKWebView 33 31 34 struct TestOptions { 35 bool useThreadedScrolling { false };36 bool useRemoteLayerTree { false };37 bool shouldShowWebView { false }; 32 #if PLATFORM(IOS) 33 - (void)zoomToScale:(double)scale animated:(BOOL)animated completionHandler:(void (^)(void))completionHandler; 34 - (void)onDidEndZooming:(void (^)(void))completionHandler; 35 #endif 38 36 39 bool useFixedLayout { false }; 40 Vector<String> overrideLanguages; 41 }; 37 @end 42 38 43 } 44 45 #endif // TestOptions_h 39 #endif // #if WK_API_ENABLED -
trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm
r189959 r190065 24 24 */ 25 25 26 #include "config.h" 27 #include "PlatformWebView.h" 28 #include "TestController.h" 29 26 #import "config.h" 27 #import "PlatformWebView.h" 28 29 #import "TestController.h" 30 #import "TestRunnerWKWebView.h" 30 31 #import <WebKit/WKImageCG.h> 31 32 #import <WebKit/WKPreferencesPrivate.h> … … 107 108 { 108 109 CGRect rect = CGRectMake(0, 0, TestController::viewWidth, TestController::viewHeight); 109 m_view = [[ WKWebView alloc] initWithFrame:rect configuration:configuration];110 m_view = [[TestRunnerWKWebView alloc] initWithFrame:rect configuration:configuration]; 110 111 111 112 m_window = [[WebKitTestRunnerWindow alloc] initWithFrame:rect]; -
trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm
r189400 r190065 31 31 #import "StringFunctions.h" 32 32 #import "TestController.h" 33 #import "TestRunnerWKWebView.h" 33 34 #import <Carbon/Carbon.h> 34 35 #import <WebKit/WKString.h> -
trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
r189959 r190065 28 28 29 29 #import "TestController.h" 30 #import "TestRunnerWKWebView.h" 30 31 #import "WebKitTestRunnerDraggingInfo.h" 31 32 #import <WebKit/WKImageCG.h> … … 53 54 @property (nonatomic, assign) PlatformWebView* platformWebView; 54 55 @end 55 56 #if WK_API_ENABLED57 @interface TestRunnerWKWebView : WKWebView58 @end59 60 @implementation TestRunnerWKWebView61 62 - (void)dragImage:(NSImage *)anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag63 {64 RetainPtr<WebKitTestRunnerDraggingInfo> draggingInfo = adoptNS([[WebKitTestRunnerDraggingInfo alloc] initWithImage:anImage offset:initialOffset pasteboard:pboard source:sourceObj]);65 [self draggingUpdated:draggingInfo.get()];66 }67 68 @end69 #endif70 56 71 57 @implementation WebKitTestRunnerWindow -
trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm
r190060 r190065 30 30 #import "PoseAsClass.h" 31 31 #import "TestInvocation.h" 32 #import "TestRunnerWKWebView.h" 32 33 #import "WebKitTestRunnerPasteboard.h" 33 34 #import <WebKit/WKContextPrivate.h> -
trunk/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm
r190064 r190065 24 24 */ 25 25 26 #i fndef TestOptions_h27 # define TestOptions_h26 #import "config.h" 27 #import "UIScriptController.h" 28 28 29 #include <wtf/Vector.h> 30 #include <wtf/text/WTFString.h> 29 #import "UIScriptContext.h" 31 30 32 31 namespace WTR { 33 32 34 struct TestOptions { 35 bool useThreadedScrolling { false }; 36 bool useRemoteLayerTree { false }; 37 bool shouldShowWebView { false }; 33 void UIScriptController::doAsyncTask(JSValueRef callback) 34 { 35 unsigned callbackID = m_context.prepareForAsyncTask(callback); 38 36 39 bool useFixedLayout { false }; 40 Vector<String> overrideLanguages; 41 }; 37 dispatch_async(dispatch_get_main_queue(), ^{ 38 m_context.asyncTaskComplete(callbackID); 39 }); 40 } 42 41 43 42 } 44 45 #endif // TestOptions_h -
trunk/Tools/WebKitTestRunner/mac/WebKitTestRunnerDraggingInfo.h
r185530 r190065 23 23 * THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 26 #if PLATFORM(MAC) 25 27 26 28 @interface WebKitTestRunnerDraggingInfo : NSObject <NSDraggingInfo> { … … 51 53 #endif 52 54 @end 55 56 #endif // PLATFORM(MAC)
Note: See TracChangeset
for help on using the changeset viewer.