diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-21 10:57:44 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-21 10:57:44 +0200 |
commit | 5ef7c8a6a70875d4430752d146bdcb069605d71d (patch) | |
tree | f6256640b6c46d7da221435803cae65326817ba2 /Tools/DumpRenderTree/chromium | |
parent | decad929f578d8db641febc8740649ca6c574638 (diff) | |
download | qtwebkit-5ef7c8a6a70875d4430752d146bdcb069605d71d.tar.gz |
Imported WebKit commit 356d83016b090995d08ad568f2d2c243aa55e831 (http://svn.webkit.org/repository/webkit/trunk@126147)
New snapshot including various build fixes for newer Qt 5
Diffstat (limited to 'Tools/DumpRenderTree/chromium')
-rw-r--r-- | Tools/DumpRenderTree/chromium/DRTTestRunner.cpp (renamed from Tools/DumpRenderTree/chromium/LayoutTestController.cpp) | 700 | ||||
-rw-r--r-- | Tools/DumpRenderTree/chromium/DRTTestRunner.h (renamed from Tools/DumpRenderTree/chromium/LayoutTestController.h) | 30 | ||||
-rw-r--r-- | Tools/DumpRenderTree/chromium/DumpRenderTree.cpp | 2 | ||||
-rw-r--r-- | Tools/DumpRenderTree/chromium/NotificationPresenter.h | 4 | ||||
-rw-r--r-- | Tools/DumpRenderTree/chromium/TestShell.cpp | 47 | ||||
-rw-r--r-- | Tools/DumpRenderTree/chromium/TestShell.h | 18 | ||||
-rw-r--r-- | Tools/DumpRenderTree/chromium/WebPermissions.cpp | 10 | ||||
-rw-r--r-- | Tools/DumpRenderTree/chromium/WebPermissions.h | 4 | ||||
-rw-r--r-- | Tools/DumpRenderTree/chromium/WebViewHost.cpp | 79 | ||||
-rw-r--r-- | Tools/DumpRenderTree/chromium/WebViewHost.h | 7 |
10 files changed, 454 insertions, 447 deletions
diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp b/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp index 046e1ec2d..bbc9f9bc6 100644 --- a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp +++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp @@ -30,7 +30,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "DRTTestRunner.h" #include "DRTDevToolsAgent.h" #include "MockWebSpeechInputController.h" @@ -94,7 +94,7 @@ public: virtual void destroy() { } }; -LayoutTestController::LayoutTestController(TestShell* shell) +DRTTestRunner::DRTTestRunner(TestShell* shell) : m_shell(shell) , m_closeRemainingWindows(false) , m_deferMainResourceDataLoad(false) @@ -107,178 +107,178 @@ LayoutTestController::LayoutTestController(TestShell* shell) // Initialize the map that associates methods of this class with the names // they will use when called by JavaScript. The actual binding of those // names to their methods will be done by calling bindToJavaScript() (defined - // by CppBoundClass, the parent to LayoutTestController). - bindMethod("addFileToPasteboardOnDrag", &LayoutTestController::addFileToPasteboardOnDrag); + // by CppBoundClass, the parent to DRTTestRunner). + bindMethod("addFileToPasteboardOnDrag", &DRTTestRunner::addFileToPasteboardOnDrag); #if ENABLE(INPUT_SPEECH) - bindMethod("addMockSpeechInputResult", &LayoutTestController::addMockSpeechInputResult); - bindMethod("setMockSpeechInputDumpRect", &LayoutTestController::setMockSpeechInputDumpRect); + bindMethod("addMockSpeechInputResult", &DRTTestRunner::addMockSpeechInputResult); + bindMethod("setMockSpeechInputDumpRect", &DRTTestRunner::setMockSpeechInputDumpRect); #endif #if ENABLE(SCRIPTED_SPEECH) - bindMethod("addMockSpeechRecognitionResult", &LayoutTestController::addMockSpeechRecognitionResult); - bindMethod("setMockSpeechRecognitionError", &LayoutTestController::setMockSpeechRecognitionError); - bindMethod("wasMockSpeechRecognitionAborted", &LayoutTestController::wasMockSpeechRecognitionAborted); + bindMethod("addMockSpeechRecognitionResult", &DRTTestRunner::addMockSpeechRecognitionResult); + bindMethod("setMockSpeechRecognitionError", &DRTTestRunner::setMockSpeechRecognitionError); + bindMethod("wasMockSpeechRecognitionAborted", &DRTTestRunner::wasMockSpeechRecognitionAborted); #endif - bindMethod("addOriginAccessWhitelistEntry", &LayoutTestController::addOriginAccessWhitelistEntry); - bindMethod("addUserScript", &LayoutTestController::addUserScript); - bindMethod("addUserStyleSheet", &LayoutTestController::addUserStyleSheet); - bindMethod("clearAllDatabases", &LayoutTestController::clearAllDatabases); - bindMethod("closeWebInspector", &LayoutTestController::closeWebInspector); + bindMethod("addOriginAccessWhitelistEntry", &DRTTestRunner::addOriginAccessWhitelistEntry); + bindMethod("addUserScript", &DRTTestRunner::addUserScript); + bindMethod("addUserStyleSheet", &DRTTestRunner::addUserStyleSheet); + bindMethod("clearAllDatabases", &DRTTestRunner::clearAllDatabases); + bindMethod("closeWebInspector", &DRTTestRunner::closeWebInspector); #if ENABLE(POINTER_LOCK) - bindMethod("didLosePointerLock", &LayoutTestController::didLosePointerLock); + bindMethod("didLosePointerLock", &DRTTestRunner::didLosePointerLock); #endif - bindMethod("disableAutoResizeMode", &LayoutTestController::disableAutoResizeMode); - bindMethod("disableImageLoading", &LayoutTestController::disableImageLoading); - bindMethod("display", &LayoutTestController::display); - bindMethod("displayInvalidatedRegion", &LayoutTestController::displayInvalidatedRegion); - bindMethod("dumpAsText", &LayoutTestController::dumpAsText); - bindMethod("dumpBackForwardList", &LayoutTestController::dumpBackForwardList); - bindMethod("dumpChildFramesAsText", &LayoutTestController::dumpChildFramesAsText); - bindMethod("dumpChildFrameScrollPositions", &LayoutTestController::dumpChildFrameScrollPositions); - bindMethod("dumpDatabaseCallbacks", &LayoutTestController::dumpDatabaseCallbacks); - bindMethod("dumpEditingCallbacks", &LayoutTestController::dumpEditingCallbacks); - bindMethod("dumpFrameLoadCallbacks", &LayoutTestController::dumpFrameLoadCallbacks); - bindMethod("dumpProgressFinishedCallback", &LayoutTestController::dumpProgressFinishedCallback); - bindMethod("dumpUserGestureInFrameLoadCallbacks", &LayoutTestController::dumpUserGestureInFrameLoadCallbacks); - bindMethod("dumpResourceLoadCallbacks", &LayoutTestController::dumpResourceLoadCallbacks); - bindMethod("dumpResourceResponseMIMETypes", &LayoutTestController::dumpResourceResponseMIMETypes); - bindMethod("dumpSelectionRect", &LayoutTestController::dumpSelectionRect); - bindMethod("dumpStatusCallbacks", &LayoutTestController::dumpWindowStatusChanges); - bindMethod("dumpTitleChanges", &LayoutTestController::dumpTitleChanges); - bindMethod("dumpPermissionClientCallbacks", &LayoutTestController::dumpPermissionClientCallbacks); - bindMethod("dumpCreateView", &LayoutTestController::dumpCreateView); - bindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId); - bindMethod("enableAutoResizeMode", &LayoutTestController::enableAutoResizeMode); - bindMethod("evaluateInWebInspector", &LayoutTestController::evaluateInWebInspector); - bindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld); - bindMethod("evaluateScriptInIsolatedWorldAndReturnValue", &LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue); - bindMethod("setIsolatedWorldSecurityOrigin", &LayoutTestController::setIsolatedWorldSecurityOrigin); - bindMethod("execCommand", &LayoutTestController::execCommand); - bindMethod("forceRedSelectionColors", &LayoutTestController::forceRedSelectionColors); + bindMethod("disableAutoResizeMode", &DRTTestRunner::disableAutoResizeMode); + bindMethod("disableImageLoading", &DRTTestRunner::disableImageLoading); + bindMethod("display", &DRTTestRunner::display); + bindMethod("displayInvalidatedRegion", &DRTTestRunner::displayInvalidatedRegion); + bindMethod("dumpAsText", &DRTTestRunner::dumpAsText); + bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList); + bindMethod("dumpChildFramesAsText", &DRTTestRunner::dumpChildFramesAsText); + bindMethod("dumpChildFrameScrollPositions", &DRTTestRunner::dumpChildFrameScrollPositions); + bindMethod("dumpDatabaseCallbacks", &DRTTestRunner::dumpDatabaseCallbacks); + bindMethod("dumpEditingCallbacks", &DRTTestRunner::dumpEditingCallbacks); + bindMethod("dumpFrameLoadCallbacks", &DRTTestRunner::dumpFrameLoadCallbacks); + bindMethod("dumpProgressFinishedCallback", &DRTTestRunner::dumpProgressFinishedCallback); + bindMethod("dumpUserGestureInFrameLoadCallbacks", &DRTTestRunner::dumpUserGestureInFrameLoadCallbacks); + bindMethod("dumpResourceLoadCallbacks", &DRTTestRunner::dumpResourceLoadCallbacks); + bindMethod("dumpResourceResponseMIMETypes", &DRTTestRunner::dumpResourceResponseMIMETypes); + bindMethod("dumpSelectionRect", &DRTTestRunner::dumpSelectionRect); + bindMethod("dumpStatusCallbacks", &DRTTestRunner::dumpWindowStatusChanges); + bindMethod("dumpTitleChanges", &DRTTestRunner::dumpTitleChanges); + bindMethod("dumpPermissionClientCallbacks", &DRTTestRunner::dumpPermissionClientCallbacks); + bindMethod("dumpCreateView", &DRTTestRunner::dumpCreateView); + bindMethod("elementDoesAutoCompleteForElementWithId", &DRTTestRunner::elementDoesAutoCompleteForElementWithId); + bindMethod("enableAutoResizeMode", &DRTTestRunner::enableAutoResizeMode); + bindMethod("evaluateInWebInspector", &DRTTestRunner::evaluateInWebInspector); + bindMethod("evaluateScriptInIsolatedWorld", &DRTTestRunner::evaluateScriptInIsolatedWorld); + bindMethod("evaluateScriptInIsolatedWorldAndReturnValue", &DRTTestRunner::evaluateScriptInIsolatedWorldAndReturnValue); + bindMethod("setIsolatedWorldSecurityOrigin", &DRTTestRunner::setIsolatedWorldSecurityOrigin); + bindMethod("execCommand", &DRTTestRunner::execCommand); + bindMethod("forceRedSelectionColors", &DRTTestRunner::forceRedSelectionColors); #if ENABLE(NOTIFICATIONS) - bindMethod("grantDesktopNotificationPermission", &LayoutTestController::grantDesktopNotificationPermission); + bindMethod("grantDesktopNotificationPermission", &DRTTestRunner::grantDesktopNotificationPermission); #endif - bindMethod("findString", &LayoutTestController::findString); - bindMethod("isCommandEnabled", &LayoutTestController::isCommandEnabled); - bindMethod("hasCustomPageSizeStyle", &LayoutTestController::hasCustomPageSizeStyle); - bindMethod("layerTreeAsText", &LayoutTestController::layerTreeAsText); - bindMethod("loseCompositorContext", &LayoutTestController::loseCompositorContext); - bindMethod("markerTextForListItem", &LayoutTestController::markerTextForListItem); - bindMethod("notifyDone", &LayoutTestController::notifyDone); - bindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations); - bindMethod("numberOfPages", &LayoutTestController::numberOfPages); - bindMethod("numberOfPendingGeolocationPermissionRequests", &LayoutTestController:: numberOfPendingGeolocationPermissionRequests); - bindMethod("objCIdentityIsEqual", &LayoutTestController::objCIdentityIsEqual); - bindMethod("overridePreference", &LayoutTestController::overridePreference); - bindMethod("pageProperty", &LayoutTestController::pageProperty); - bindMethod("pageSizeAndMarginsInPixels", &LayoutTestController::pageSizeAndMarginsInPixels); - bindMethod("pathToLocalResource", &LayoutTestController::pathToLocalResource); - bindMethod("pauseAnimationAtTimeOnElementWithId", &LayoutTestController::pauseAnimationAtTimeOnElementWithId); - bindMethod("pauseTransitionAtTimeOnElementWithId", &LayoutTestController::pauseTransitionAtTimeOnElementWithId); - bindMethod("queueBackNavigation", &LayoutTestController::queueBackNavigation); - bindMethod("queueForwardNavigation", &LayoutTestController::queueForwardNavigation); - bindMethod("queueLoadingScript", &LayoutTestController::queueLoadingScript); - bindMethod("queueLoad", &LayoutTestController::queueLoad); - bindMethod("queueLoadHTMLString", &LayoutTestController::queueLoadHTMLString); - bindMethod("queueNonLoadingScript", &LayoutTestController::queueNonLoadingScript); - bindMethod("queueReload", &LayoutTestController::queueReload); - bindMethod("removeOriginAccessWhitelistEntry", &LayoutTestController::removeOriginAccessWhitelistEntry); - bindMethod("repaintSweepHorizontally", &LayoutTestController::repaintSweepHorizontally); - bindMethod("resetPageVisibility", &LayoutTestController::resetPageVisibility); - bindMethod("setAcceptsEditing", &LayoutTestController::setAcceptsEditing); - bindMethod("setAllowDisplayOfInsecureContent", &LayoutTestController::setAllowDisplayOfInsecureContent); - bindMethod("setAllowFileAccessFromFileURLs", &LayoutTestController::setAllowFileAccessFromFileURLs); - bindMethod("setAllowRunningOfInsecureContent", &LayoutTestController::setAllowRunningOfInsecureContent); - bindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAllowUniversalAccessFromFileURLs); - bindMethod("setAlwaysAcceptCookies", &LayoutTestController::setAlwaysAcceptCookies); - bindMethod("setAuthorAndUserStylesEnabled", &LayoutTestController::setAuthorAndUserStylesEnabled); - bindMethod("setAutofilled", &LayoutTestController::setAutofilled); - bindMethod("setCanOpenWindows", &LayoutTestController::setCanOpenWindows); - bindMethod("setCloseRemainingWindowsWhenComplete", &LayoutTestController::setCloseRemainingWindowsWhenComplete); - bindMethod("setCustomPolicyDelegate", &LayoutTestController::setCustomPolicyDelegate); - bindMethod("setDatabaseQuota", &LayoutTestController::setDatabaseQuota); - bindMethod("setDeferMainResourceDataLoad", &LayoutTestController::setDeferMainResourceDataLoad); - bindMethod("setDomainRelaxationForbiddenForURLScheme", &LayoutTestController::setDomainRelaxationForbiddenForURLScheme); - bindMethod("setAudioData", &LayoutTestController::setAudioData); - bindMethod("setGeolocationPermission", &LayoutTestController::setGeolocationPermission); - bindMethod("setIconDatabaseEnabled", &LayoutTestController::setIconDatabaseEnabled); - bindMethod("setJavaScriptCanAccessClipboard", &LayoutTestController::setJavaScriptCanAccessClipboard); - bindMethod("setMinimumTimerInterval", &LayoutTestController::setMinimumTimerInterval); - bindMethod("setMockDeviceOrientation", &LayoutTestController::setMockDeviceOrientation); - bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError); - bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition); - bindMethod("setPageVisibility", &LayoutTestController::setPageVisibility); - bindMethod("setPluginsEnabled", &LayoutTestController::setPluginsEnabled); + bindMethod("findString", &DRTTestRunner::findString); + bindMethod("isCommandEnabled", &DRTTestRunner::isCommandEnabled); + bindMethod("hasCustomPageSizeStyle", &DRTTestRunner::hasCustomPageSizeStyle); + bindMethod("layerTreeAsText", &DRTTestRunner::layerTreeAsText); + bindMethod("loseCompositorContext", &DRTTestRunner::loseCompositorContext); + bindMethod("markerTextForListItem", &DRTTestRunner::markerTextForListItem); + bindMethod("notifyDone", &DRTTestRunner::notifyDone); + bindMethod("numberOfActiveAnimations", &DRTTestRunner::numberOfActiveAnimations); + bindMethod("numberOfPages", &DRTTestRunner::numberOfPages); + bindMethod("numberOfPendingGeolocationPermissionRequests", &DRTTestRunner:: numberOfPendingGeolocationPermissionRequests); + bindMethod("objCIdentityIsEqual", &DRTTestRunner::objCIdentityIsEqual); + bindMethod("overridePreference", &DRTTestRunner::overridePreference); + bindMethod("pageProperty", &DRTTestRunner::pageProperty); + bindMethod("pageSizeAndMarginsInPixels", &DRTTestRunner::pageSizeAndMarginsInPixels); + bindMethod("pathToLocalResource", &DRTTestRunner::pathToLocalResource); + bindMethod("pauseAnimationAtTimeOnElementWithId", &DRTTestRunner::pauseAnimationAtTimeOnElementWithId); + bindMethod("pauseTransitionAtTimeOnElementWithId", &DRTTestRunner::pauseTransitionAtTimeOnElementWithId); + bindMethod("queueBackNavigation", &DRTTestRunner::queueBackNavigation); + bindMethod("queueForwardNavigation", &DRTTestRunner::queueForwardNavigation); + bindMethod("queueLoadingScript", &DRTTestRunner::queueLoadingScript); + bindMethod("queueLoad", &DRTTestRunner::queueLoad); + bindMethod("queueLoadHTMLString", &DRTTestRunner::queueLoadHTMLString); + bindMethod("queueNonLoadingScript", &DRTTestRunner::queueNonLoadingScript); + bindMethod("queueReload", &DRTTestRunner::queueReload); + bindMethod("removeOriginAccessWhitelistEntry", &DRTTestRunner::removeOriginAccessWhitelistEntry); + bindMethod("repaintSweepHorizontally", &DRTTestRunner::repaintSweepHorizontally); + bindMethod("resetPageVisibility", &DRTTestRunner::resetPageVisibility); + bindMethod("setAcceptsEditing", &DRTTestRunner::setAcceptsEditing); + bindMethod("setAllowDisplayOfInsecureContent", &DRTTestRunner::setAllowDisplayOfInsecureContent); + bindMethod("setAllowFileAccessFromFileURLs", &DRTTestRunner::setAllowFileAccessFromFileURLs); + bindMethod("setAllowRunningOfInsecureContent", &DRTTestRunner::setAllowRunningOfInsecureContent); + bindMethod("setAllowUniversalAccessFromFileURLs", &DRTTestRunner::setAllowUniversalAccessFromFileURLs); + bindMethod("setAlwaysAcceptCookies", &DRTTestRunner::setAlwaysAcceptCookies); + bindMethod("setAuthorAndUserStylesEnabled", &DRTTestRunner::setAuthorAndUserStylesEnabled); + bindMethod("setAutofilled", &DRTTestRunner::setAutofilled); + bindMethod("setCanOpenWindows", &DRTTestRunner::setCanOpenWindows); + bindMethod("setCloseRemainingWindowsWhenComplete", &DRTTestRunner::setCloseRemainingWindowsWhenComplete); + bindMethod("setCustomPolicyDelegate", &DRTTestRunner::setCustomPolicyDelegate); + bindMethod("setDatabaseQuota", &DRTTestRunner::setDatabaseQuota); + bindMethod("setDeferMainResourceDataLoad", &DRTTestRunner::setDeferMainResourceDataLoad); + bindMethod("setDomainRelaxationForbiddenForURLScheme", &DRTTestRunner::setDomainRelaxationForbiddenForURLScheme); + bindMethod("setAudioData", &DRTTestRunner::setAudioData); + bindMethod("setGeolocationPermission", &DRTTestRunner::setGeolocationPermission); + bindMethod("setIconDatabaseEnabled", &DRTTestRunner::setIconDatabaseEnabled); + bindMethod("setJavaScriptCanAccessClipboard", &DRTTestRunner::setJavaScriptCanAccessClipboard); + bindMethod("setMinimumTimerInterval", &DRTTestRunner::setMinimumTimerInterval); + bindMethod("setMockDeviceOrientation", &DRTTestRunner::setMockDeviceOrientation); + bindMethod("setMockGeolocationError", &DRTTestRunner::setMockGeolocationError); + bindMethod("setMockGeolocationPosition", &DRTTestRunner::setMockGeolocationPosition); + bindMethod("setPageVisibility", &DRTTestRunner::setPageVisibility); + bindMethod("setPluginsEnabled", &DRTTestRunner::setPluginsEnabled); #if ENABLE(POINTER_LOCK) - bindMethod("setPointerLockWillFailAsynchronously", &LayoutTestController::setPointerLockWillFailAsynchronously); - bindMethod("setPointerLockWillFailSynchronously", &LayoutTestController::setPointerLockWillFailSynchronously); + bindMethod("setPointerLockWillFailAsynchronously", &DRTTestRunner::setPointerLockWillFailAsynchronously); + bindMethod("setPointerLockWillFailSynchronously", &DRTTestRunner::setPointerLockWillFailSynchronously); #endif - bindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled); - bindMethod("setPOSIXLocale", &LayoutTestController::setPOSIXLocale); - bindMethod("setPrinting", &LayoutTestController::setPrinting); - bindMethod("setScrollbarPolicy", &LayoutTestController::setScrollbarPolicy); - bindMethod("setSelectTrailingWhitespaceEnabled", &LayoutTestController::setSelectTrailingWhitespaceEnabled); - bindMethod("setTextSubpixelPositioning", &LayoutTestController::setTextSubpixelPositioning); - bindMethod("setBackingScaleFactor", &LayoutTestController::setBackingScaleFactor); - bindMethod("setSmartInsertDeleteEnabled", &LayoutTestController::setSmartInsertDeleteEnabled); - bindMethod("setStopProvisionalFrameLoads", &LayoutTestController::setStopProvisionalFrameLoads); - bindMethod("setTabKeyCyclesThroughElements", &LayoutTestController::setTabKeyCyclesThroughElements); - bindMethod("setUserStyleSheetEnabled", &LayoutTestController::setUserStyleSheetEnabled); - bindMethod("setUserStyleSheetLocation", &LayoutTestController::setUserStyleSheetLocation); - bindMethod("setValueForUser", &LayoutTestController::setValueForUser); - bindMethod("setWillSendRequestClearHeader", &LayoutTestController::setWillSendRequestClearHeader); - bindMethod("setWillSendRequestReturnsNull", &LayoutTestController::setWillSendRequestReturnsNull); - bindMethod("setWillSendRequestReturnsNullOnRedirect", &LayoutTestController::setWillSendRequestReturnsNullOnRedirect); - bindMethod("setWindowIsKey", &LayoutTestController::setWindowIsKey); - bindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled); - bindMethod("setAsynchronousSpellCheckingEnabled", &LayoutTestController::setAsynchronousSpellCheckingEnabled); - bindMethod("showWebInspector", &LayoutTestController::showWebInspector); + bindMethod("setPopupBlockingEnabled", &DRTTestRunner::setPopupBlockingEnabled); + bindMethod("setPOSIXLocale", &DRTTestRunner::setPOSIXLocale); + bindMethod("setPrinting", &DRTTestRunner::setPrinting); + bindMethod("setScrollbarPolicy", &DRTTestRunner::setScrollbarPolicy); + bindMethod("setSelectTrailingWhitespaceEnabled", &DRTTestRunner::setSelectTrailingWhitespaceEnabled); + bindMethod("setTextSubpixelPositioning", &DRTTestRunner::setTextSubpixelPositioning); + bindMethod("setBackingScaleFactor", &DRTTestRunner::setBackingScaleFactor); + bindMethod("setSmartInsertDeleteEnabled", &DRTTestRunner::setSmartInsertDeleteEnabled); + bindMethod("setStopProvisionalFrameLoads", &DRTTestRunner::setStopProvisionalFrameLoads); + bindMethod("setTabKeyCyclesThroughElements", &DRTTestRunner::setTabKeyCyclesThroughElements); + bindMethod("setUserStyleSheetEnabled", &DRTTestRunner::setUserStyleSheetEnabled); + bindMethod("setUserStyleSheetLocation", &DRTTestRunner::setUserStyleSheetLocation); + bindMethod("setValueForUser", &DRTTestRunner::setValueForUser); + bindMethod("setWillSendRequestClearHeader", &DRTTestRunner::setWillSendRequestClearHeader); + bindMethod("setWillSendRequestReturnsNull", &DRTTestRunner::setWillSendRequestReturnsNull); + bindMethod("setWillSendRequestReturnsNullOnRedirect", &DRTTestRunner::setWillSendRequestReturnsNullOnRedirect); + bindMethod("setWindowIsKey", &DRTTestRunner::setWindowIsKey); + bindMethod("setXSSAuditorEnabled", &DRTTestRunner::setXSSAuditorEnabled); + bindMethod("setAsynchronousSpellCheckingEnabled", &DRTTestRunner::setAsynchronousSpellCheckingEnabled); + bindMethod("showWebInspector", &DRTTestRunner::showWebInspector); #if ENABLE(NOTIFICATIONS) - bindMethod("simulateDesktopNotificationClick", &LayoutTestController::simulateDesktopNotificationClick); + bindMethod("simulateDesktopNotificationClick", &DRTTestRunner::simulateDesktopNotificationClick); #endif - bindMethod("startSpeechInput", &LayoutTestController::startSpeechInput); - bindMethod("testRepaint", &LayoutTestController::testRepaint); - bindMethod("waitForPolicyDelegate", &LayoutTestController::waitForPolicyDelegate); - bindMethod("waitUntilDone", &LayoutTestController::waitUntilDone); - bindMethod("windowCount", &LayoutTestController::windowCount); - bindMethod("setTextDirection", &LayoutTestController::setTextDirection); - bindMethod("setImagesAllowed", &LayoutTestController::setImagesAllowed); - bindMethod("setScriptsAllowed", &LayoutTestController::setScriptsAllowed); - bindMethod("setStorageAllowed", &LayoutTestController::setStorageAllowed); - bindMethod("setPluginsAllowed", &LayoutTestController::setPluginsAllowed); + bindMethod("startSpeechInput", &DRTTestRunner::startSpeechInput); + bindMethod("testRepaint", &DRTTestRunner::testRepaint); + bindMethod("waitForPolicyDelegate", &DRTTestRunner::waitForPolicyDelegate); + bindMethod("waitUntilDone", &DRTTestRunner::waitUntilDone); + bindMethod("windowCount", &DRTTestRunner::windowCount); + bindMethod("setTextDirection", &DRTTestRunner::setTextDirection); + bindMethod("setImagesAllowed", &DRTTestRunner::setImagesAllowed); + bindMethod("setScriptsAllowed", &DRTTestRunner::setScriptsAllowed); + bindMethod("setStorageAllowed", &DRTTestRunner::setStorageAllowed); + bindMethod("setPluginsAllowed", &DRTTestRunner::setPluginsAllowed); // The following are stubs. - bindMethod("abortModal", &LayoutTestController::abortModal); - bindMethod("accessStoredWebScriptObject", &LayoutTestController::accessStoredWebScriptObject); - bindMethod("addDisallowedURL", &LayoutTestController::addDisallowedURL); - bindMethod("applicationCacheDiskUsageForOrigin", &LayoutTestController::applicationCacheDiskUsageForOrigin); - bindMethod("callShouldCloseOnWebView", &LayoutTestController::callShouldCloseOnWebView); - bindMethod("clearAllApplicationCaches", &LayoutTestController::clearAllApplicationCaches); - bindMethod("clearApplicationCacheForOrigin", &LayoutTestController::clearApplicationCacheForOrigin); - bindMethod("clearBackForwardList", &LayoutTestController::clearBackForwardList); - bindMethod("dumpAsWebArchive", &LayoutTestController::dumpAsWebArchive); - bindMethod("keepWebHistory", &LayoutTestController::keepWebHistory); - bindMethod("objCClassNameOf", &LayoutTestController::objCClassNameOf); - bindMethod("setApplicationCacheOriginQuota", &LayoutTestController::setApplicationCacheOriginQuota); - bindMethod("setCallCloseOnWebViews", &LayoutTestController::setCallCloseOnWebViews); - bindMethod("setMainFrameIsFirstResponder", &LayoutTestController::setMainFrameIsFirstResponder); - bindMethod("setPrivateBrowsingEnabled", &LayoutTestController::setPrivateBrowsingEnabled); - bindMethod("setUseDashboardCompatibilityMode", &LayoutTestController::setUseDashboardCompatibilityMode); - bindMethod("storeWebScriptObject", &LayoutTestController::storeWebScriptObject); - bindMethod("deleteAllLocalStorage", &LayoutTestController::deleteAllLocalStorage); - bindMethod("localStorageDiskUsageForOrigin", &LayoutTestController::localStorageDiskUsageForOrigin); - bindMethod("originsWithLocalStorage", &LayoutTestController::originsWithLocalStorage); - bindMethod("deleteLocalStorageForOrigin", &LayoutTestController::deleteLocalStorageForOrigin); - bindMethod("observeStorageTrackerNotifications", &LayoutTestController::observeStorageTrackerNotifications); - bindMethod("syncLocalStorage", &LayoutTestController::syncLocalStorage); - bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload); - bindMethod("enableFixedLayoutMode", &LayoutTestController::enableFixedLayoutMode); - bindMethod("setFixedLayoutSize", &LayoutTestController::setFixedLayoutSize); - bindMethod("selectionAsMarkup", &LayoutTestController::selectionAsMarkup); - bindMethod("setHasCustomFullScreenBehavior", &LayoutTestController::setHasCustomFullScreenBehavior); - bindMethod("textSurroundingNode", &LayoutTestController::textSurroundingNode); + bindMethod("abortModal", &DRTTestRunner::abortModal); + bindMethod("accessStoredWebScriptObject", &DRTTestRunner::accessStoredWebScriptObject); + bindMethod("addDisallowedURL", &DRTTestRunner::addDisallowedURL); + bindMethod("applicationCacheDiskUsageForOrigin", &DRTTestRunner::applicationCacheDiskUsageForOrigin); + bindMethod("callShouldCloseOnWebView", &DRTTestRunner::callShouldCloseOnWebView); + bindMethod("clearAllApplicationCaches", &DRTTestRunner::clearAllApplicationCaches); + bindMethod("clearApplicationCacheForOrigin", &DRTTestRunner::clearApplicationCacheForOrigin); + bindMethod("clearBackForwardList", &DRTTestRunner::clearBackForwardList); + bindMethod("dumpAsWebArchive", &DRTTestRunner::dumpAsWebArchive); + bindMethod("keepWebHistory", &DRTTestRunner::keepWebHistory); + bindMethod("objCClassNameOf", &DRTTestRunner::objCClassNameOf); + bindMethod("setApplicationCacheOriginQuota", &DRTTestRunner::setApplicationCacheOriginQuota); + bindMethod("setCallCloseOnWebViews", &DRTTestRunner::setCallCloseOnWebViews); + bindMethod("setMainFrameIsFirstResponder", &DRTTestRunner::setMainFrameIsFirstResponder); + bindMethod("setPrivateBrowsingEnabled", &DRTTestRunner::setPrivateBrowsingEnabled); + bindMethod("setUseDashboardCompatibilityMode", &DRTTestRunner::setUseDashboardCompatibilityMode); + bindMethod("storeWebScriptObject", &DRTTestRunner::storeWebScriptObject); + bindMethod("deleteAllLocalStorage", &DRTTestRunner::deleteAllLocalStorage); + bindMethod("localStorageDiskUsageForOrigin", &DRTTestRunner::localStorageDiskUsageForOrigin); + bindMethod("originsWithLocalStorage", &DRTTestRunner::originsWithLocalStorage); + bindMethod("deleteLocalStorageForOrigin", &DRTTestRunner::deleteLocalStorageForOrigin); + bindMethod("observeStorageTrackerNotifications", &DRTTestRunner::observeStorageTrackerNotifications); + bindMethod("syncLocalStorage", &DRTTestRunner::syncLocalStorage); + bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload); + bindMethod("enableFixedLayoutMode", &DRTTestRunner::enableFixedLayoutMode); + bindMethod("setFixedLayoutSize", &DRTTestRunner::setFixedLayoutSize); + bindMethod("selectionAsMarkup", &DRTTestRunner::selectionAsMarkup); + bindMethod("setHasCustomFullScreenBehavior", &DRTTestRunner::setHasCustomFullScreenBehavior); + bindMethod("textSurroundingNode", &DRTTestRunner::textSurroundingNode); // The fallback method is called when an unknown method is invoked. - bindFallbackMethod(&LayoutTestController::fallbackMethod); + bindFallbackMethod(&DRTTestRunner::fallbackMethod); // Shared properties. // globalFlag is used by a number of layout tests in @@ -289,21 +289,21 @@ LayoutTestController::LayoutTestController(TestShell* shell) bindProperty("titleTextDirection", &m_titleTextDirection); bindProperty("platformName", &m_platformName); bindProperty("interceptPostMessage", &m_interceptPostMessage); - bindProperty("workerThreadCount", &LayoutTestController::workerThreadCount); - bindMethod("sendWebIntentResponse", &LayoutTestController::sendWebIntentResponse); - bindMethod("deliverWebIntent", &LayoutTestController::deliverWebIntent); + bindProperty("workerThreadCount", &DRTTestRunner::workerThreadCount); + bindMethod("sendWebIntentResponse", &DRTTestRunner::sendWebIntentResponse); + bindMethod("deliverWebIntent", &DRTTestRunner::deliverWebIntent); } -LayoutTestController::~LayoutTestController() +DRTTestRunner::~DRTTestRunner() { } -LayoutTestController::WorkQueue::~WorkQueue() +DRTTestRunner::WorkQueue::~WorkQueue() { reset(); } -void LayoutTestController::WorkQueue::processWorkSoon() +void DRTTestRunner::WorkQueue::processWorkSoon() { if (m_controller->m_shell->webViewHost()->topLoadingFrame()) return; @@ -315,7 +315,7 @@ void LayoutTestController::WorkQueue::processWorkSoon() m_controller->m_shell->testFinished(); } -void LayoutTestController::WorkQueue::processWork() +void DRTTestRunner::WorkQueue::processWork() { TestShell* shell = m_controller->m_shell; // Quit doing work once a load is in progress. @@ -330,14 +330,14 @@ void LayoutTestController::WorkQueue::processWork() shell->testFinished(); } -void LayoutTestController::WorkQueue::reset() +void DRTTestRunner::WorkQueue::reset() { m_frozen = false; while (!m_queue.isEmpty()) delete m_queue.takeFirst(); } -void LayoutTestController::WorkQueue::addWork(WorkItem* work) +void DRTTestRunner::WorkQueue::addWork(WorkItem* work) { if (m_frozen) { delete work; @@ -346,7 +346,7 @@ void LayoutTestController::WorkQueue::addWork(WorkItem* work) m_queue.append(work); } -void LayoutTestController::dumpAsText(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::dumpAsText(const CppArgumentList& arguments, CppVariant* result) { m_dumpAsText = true; m_generatePixelResults = false; @@ -358,98 +358,98 @@ void LayoutTestController::dumpAsText(const CppArgumentList& arguments, CppVaria result->setNull(); } -void LayoutTestController::dumpDatabaseCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpDatabaseCallbacks(const CppArgumentList&, CppVariant* result) { // Do nothing; we don't use this flag anywhere for now result->setNull(); } -void LayoutTestController::dumpEditingCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpEditingCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpEditingCallbacks = true; result->setNull(); } -void LayoutTestController::dumpBackForwardList(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpBackForwardList(const CppArgumentList&, CppVariant* result) { m_dumpBackForwardList = true; result->setNull(); } -void LayoutTestController::dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpFrameLoadCallbacks = true; result->setNull(); } -void LayoutTestController::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result) { m_dumpProgressFinishedCallback = true; result->setNull(); } -void LayoutTestController::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpUserGestureInFrameLoadCallbacks = true; result->setNull(); } -void LayoutTestController::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpResourceLoadCallbacks = true; result->setNull(); } -void LayoutTestController::dumpResourceResponseMIMETypes(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpResourceResponseMIMETypes(const CppArgumentList&, CppVariant* result) { m_dumpResourceResponseMIMETypes = true; result->setNull(); } -void LayoutTestController::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result) { m_dumpChildFrameScrollPositions = true; result->setNull(); } -void LayoutTestController::dumpChildFramesAsText(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpChildFramesAsText(const CppArgumentList&, CppVariant* result) { m_dumpChildFramesAsText = true; result->setNull(); } -void LayoutTestController::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result) { m_dumpWindowStatusChanges = true; result->setNull(); } -void LayoutTestController::dumpTitleChanges(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpTitleChanges(const CppArgumentList&, CppVariant* result) { m_dumpTitleChanges = true; result->setNull(); } -void LayoutTestController::dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpPermissionClientCallbacks = true; result->setNull(); } -void LayoutTestController::dumpCreateView(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpCreateView(const CppArgumentList&, CppVariant* result) { m_dumpCreateView = true; result->setNull(); } -void LayoutTestController::setAcceptsEditing(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAcceptsEditing(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_acceptsEditing = arguments[0].value.boolValue; result->setNull(); } -void LayoutTestController::waitUntilDone(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::waitUntilDone(const CppArgumentList&, CppVariant* result) { if (!webkit_support::BeingDebugged()) postDelayedTask(new NotifyDoneTimedOutTask(this), m_shell->layoutTestTimeout()); @@ -457,7 +457,7 @@ void LayoutTestController::waitUntilDone(const CppArgumentList&, CppVariant* res result->setNull(); } -void LayoutTestController::notifyDone(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::notifyDone(const CppArgumentList&, CppVariant* result) { // Test didn't timeout. Kill the timeout timer. m_taskList.revokeAll(); @@ -466,7 +466,7 @@ void LayoutTestController::notifyDone(const CppArgumentList&, CppVariant* result result->setNull(); } -void LayoutTestController::completeNotifyDone(bool isTimeout) +void DRTTestRunner::completeNotifyDone(bool isTimeout) { if (m_waitUntilDone && !m_shell->webViewHost()->topLoadingFrame() && m_workQueue.isEmpty()) { if (isTimeout) @@ -477,7 +477,7 @@ void LayoutTestController::completeNotifyDone(bool isTimeout) m_waitUntilDone = false; } -class WorkItemBackForward : public LayoutTestController::WorkItem { +class WorkItemBackForward : public DRTTestRunner::WorkItem { public: WorkItemBackForward(int distance) : m_distance(distance) { } bool run(TestShell* shell) @@ -490,21 +490,21 @@ private: int m_distance; }; -void LayoutTestController::queueBackNavigation(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::queueBackNavigation(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isNumber()) m_workQueue.addWork(new WorkItemBackForward(-arguments[0].toInt32())); result->setNull(); } -void LayoutTestController::queueForwardNavigation(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::queueForwardNavigation(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isNumber()) m_workQueue.addWork(new WorkItemBackForward(arguments[0].toInt32())); result->setNull(); } -class WorkItemReload : public LayoutTestController::WorkItem { +class WorkItemReload : public DRTTestRunner::WorkItem { public: bool run(TestShell* shell) { @@ -513,13 +513,13 @@ public: } }; -void LayoutTestController::queueReload(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::queueReload(const CppArgumentList&, CppVariant* result) { m_workQueue.addWork(new WorkItemReload); result->setNull(); } -class WorkItemLoadingScript : public LayoutTestController::WorkItem { +class WorkItemLoadingScript : public DRTTestRunner::WorkItem { public: WorkItemLoadingScript(const string& script) : m_script(script) { } bool run(TestShell* shell) @@ -532,7 +532,7 @@ private: string m_script; }; -class WorkItemNonLoadingScript : public LayoutTestController::WorkItem { +class WorkItemNonLoadingScript : public DRTTestRunner::WorkItem { public: WorkItemNonLoadingScript(const string& script) : m_script(script) { } bool run(TestShell* shell) @@ -545,21 +545,21 @@ private: string m_script; }; -void LayoutTestController::queueLoadingScript(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::queueLoadingScript(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) m_workQueue.addWork(new WorkItemLoadingScript(arguments[0].toString())); result->setNull(); } -void LayoutTestController::queueNonLoadingScript(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::queueNonLoadingScript(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) m_workQueue.addWork(new WorkItemNonLoadingScript(arguments[0].toString())); result->setNull(); } -class WorkItemLoad : public LayoutTestController::WorkItem { +class WorkItemLoad : public DRTTestRunner::WorkItem { public: WorkItemLoad(const WebURL& url, const WebString& target) : m_url(url) @@ -575,7 +575,7 @@ private: WebString m_target; }; -void LayoutTestController::queueLoad(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::queueLoad(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { // FIXME: Implement WebURL::resolve() and avoid GURL. @@ -591,7 +591,7 @@ void LayoutTestController::queueLoad(const CppArgumentList& arguments, CppVarian result->setNull(); } -class WorkItemLoadHTMLString : public LayoutTestController::WorkItem { +class WorkItemLoadHTMLString : public DRTTestRunner::WorkItem { public: WorkItemLoadHTMLString(const std::string& html, const WebURL& baseURL) : m_html(html) @@ -613,7 +613,7 @@ private: WebURL m_unreachableURL; }; -void LayoutTestController::queueLoadHTMLString(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::queueLoadHTMLString(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { string html = arguments[0].toString(); @@ -628,7 +628,7 @@ void LayoutTestController::queueLoadHTMLString(const CppArgumentList& arguments, result->setNull(); } -void LayoutTestController::objCIdentityIsEqual(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::objCIdentityIsEqual(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() < 2) { // This is the best we can do to return an error. @@ -638,7 +638,7 @@ void LayoutTestController::objCIdentityIsEqual(const CppArgumentList& arguments, result->set(arguments[0].isEqual(arguments[1])); } -void LayoutTestController::reset() +void DRTTestRunner::reset() { if (m_shell) { m_shell->webView()->setZoomLevel(false, 0); @@ -707,7 +707,7 @@ void LayoutTestController::reset() #endif } -void LayoutTestController::locationChangeDone() +void DRTTestRunner::locationChangeDone() { m_webHistoryItemCount.set(m_shell->navigationEntryCount()); @@ -718,72 +718,72 @@ void LayoutTestController::locationChangeDone() m_workQueue.processWorkSoon(); } -void LayoutTestController::policyDelegateDone() +void DRTTestRunner::policyDelegateDone() { ASSERT(m_waitUntilDone); m_shell->testFinished(); m_waitUntilDone = false; } -void LayoutTestController::setCanOpenWindows(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setCanOpenWindows(const CppArgumentList&, CppVariant* result) { m_canOpenWindows = true; result->setNull(); } -void LayoutTestController::setTabKeyCyclesThroughElements(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setTabKeyCyclesThroughElements(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webView()->setTabKeyCyclesThroughElements(arguments[0].toBoolean()); result->setNull(); } -void LayoutTestController::windowCount(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::windowCount(const CppArgumentList&, CppVariant* result) { result->set(static_cast<int>(m_shell->windowCount())); } -void LayoutTestController::setCloseRemainingWindowsWhenComplete(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setCloseRemainingWindowsWhenComplete(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_closeRemainingWindows = arguments[0].value.boolValue; result->setNull(); } -void LayoutTestController::setAlwaysAcceptCookies(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAlwaysAcceptCookies(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0) webkit_support::SetAcceptAllCookies(cppVariantToBool(arguments[0])); result->setNull(); } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAsynchronousSpellCheckingEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webView()->settings()->setAsynchronousSpellCheckingEnabled(cppVariantToBool(arguments[0])); result->setNull(); } -void LayoutTestController::showWebInspector(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::showWebInspector(const CppArgumentList&, CppVariant* result) { m_shell->showDevTools(); result->setNull(); } -void LayoutTestController::closeWebInspector(const CppArgumentList& args, CppVariant* result) +void DRTTestRunner::closeWebInspector(const CppArgumentList& args, CppVariant* result) { m_shell->closeDevTools(); result->setNull(); } -void LayoutTestController::setWindowIsKey(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setWindowIsKey(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->setFocus(m_shell->webView(), arguments[0].value.boolValue); result->setNull(); } -void LayoutTestController::setUserStyleSheetEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setUserStyleSheetEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->userStyleSheetLocation = arguments[0].value.boolValue ? m_userStyleSheetLocation : WebURL(); @@ -792,7 +792,7 @@ void LayoutTestController::setUserStyleSheetEnabled(const CppArgumentList& argum result->setNull(); } -void LayoutTestController::setUserStyleSheetLocation(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setUserStyleSheetLocation(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { m_userStyleSheetLocation = webkit_support::LocalFileToDataURL( @@ -803,7 +803,7 @@ void LayoutTestController::setUserStyleSheetLocation(const CppArgumentList& argu result->setNull(); } -void LayoutTestController::setAuthorAndUserStylesEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAuthorAndUserStylesEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->authorAndUserStylesEnabled = arguments[0].value.boolValue; @@ -812,7 +812,7 @@ void LayoutTestController::setAuthorAndUserStylesEnabled(const CppArgumentList& result->setNull(); } -void LayoutTestController::execCommand(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::execCommand(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() <= 0 || !arguments[0].isString()) @@ -829,7 +829,7 @@ void LayoutTestController::execCommand(const CppArgumentList& arguments, CppVari m_shell->webView()->focusedFrame()->executeCommand(WebString::fromUTF8(command), WebString::fromUTF8(value)); } -void LayoutTestController::isCommandEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::isCommandEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() <= 0 || !arguments[0].isString()) { result->setNull(); @@ -841,7 +841,7 @@ void LayoutTestController::isCommandEnabled(const CppArgumentList& arguments, Cp result->set(rv); } -void LayoutTestController::setPopupBlockingEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPopupBlockingEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { bool blockPopups = arguments[0].toBoolean(); @@ -851,78 +851,78 @@ void LayoutTestController::setPopupBlockingEnabled(const CppArgumentList& argume result->setNull(); } -void LayoutTestController::setImagesAllowed(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setImagesAllowed(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setImagesAllowed(arguments[0].toBoolean()); result->setNull(); } -void LayoutTestController::setScriptsAllowed(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setScriptsAllowed(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setScriptsAllowed(arguments[0].toBoolean()); result->setNull(); } -void LayoutTestController::setStorageAllowed(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setStorageAllowed(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setStorageAllowed(arguments[0].toBoolean()); result->setNull(); } -void LayoutTestController::setPluginsAllowed(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPluginsAllowed(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setPluginsAllowed(arguments[0].toBoolean()); result->setNull(); } -void LayoutTestController::setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant* result) { // We have no need to support Dashboard Compatibility Mode (mac-only) result->setNull(); } -void LayoutTestController::clearAllApplicationCaches(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::clearAllApplicationCaches(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support application cache quotas. result->setNull(); } -void LayoutTestController::clearApplicationCacheForOrigin(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::clearApplicationCacheForOrigin(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support deleting all application cache for an origin. result->setNull(); } -void LayoutTestController::setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support application cache quotas. result->setNull(); } -void LayoutTestController::originsWithApplicationCache(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::originsWithApplicationCache(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support getting origins that have application caches. result->setNull(); } -void LayoutTestController::applicationCacheDiskUsageForOrigin(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::applicationCacheDiskUsageForOrigin(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support getting disk usage by all application cache for an origin. result->setNull(); } -void LayoutTestController::setScrollbarPolicy(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setScrollbarPolicy(const CppArgumentList&, CppVariant* result) { // FIXME: implement. // Currently only has a non-null implementation on QT. result->setNull(); } -void LayoutTestController::setCustomPolicyDelegate(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setCustomPolicyDelegate(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { bool enable = arguments[0].value.boolValue; @@ -934,14 +934,14 @@ void LayoutTestController::setCustomPolicyDelegate(const CppArgumentList& argume result->setNull(); } -void LayoutTestController::waitForPolicyDelegate(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::waitForPolicyDelegate(const CppArgumentList&, CppVariant* result) { m_shell->webViewHost()->waitForPolicyDelegate(); m_waitUntilDone = true; result->setNull(); } -void LayoutTestController::setWillSendRequestClearHeader(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setWillSendRequestClearHeader(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { string header = arguments[0].toString(); @@ -951,21 +951,21 @@ void LayoutTestController::setWillSendRequestClearHeader(const CppArgumentList& result->setNull(); } -void LayoutTestController::setWillSendRequestReturnsNullOnRedirect(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setWillSendRequestReturnsNullOnRedirect(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webViewHost()->setBlockRedirects(arguments[0].value.boolValue); result->setNull(); } -void LayoutTestController::setWillSendRequestReturnsNull(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setWillSendRequestReturnsNull(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webViewHost()->setRequestReturnNull(arguments[0].value.boolValue); result->setNull(); } -void LayoutTestController::pathToLocalResource(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::pathToLocalResource(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() <= 0 || !arguments[0].isString()) @@ -1003,33 +1003,33 @@ void LayoutTestController::pathToLocalResource(const CppArgumentList& arguments, result->set(webkit_support::RewriteLayoutTestsURL(url).spec()); } -void LayoutTestController::addFileToPasteboardOnDrag(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::addFileToPasteboardOnDrag(const CppArgumentList&, CppVariant* result) { result->setNull(); m_shouldAddFileToPasteboard = true; } -void LayoutTestController::setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant* result) { result->setNull(); m_stopProvisionalFrameLoads = true; } -void LayoutTestController::setSmartInsertDeleteEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setSmartInsertDeleteEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webViewHost()->setSmartInsertDeleteEnabled(arguments[0].value.boolValue); result->setNull(); } -void LayoutTestController::setSelectTrailingWhitespaceEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setSelectTrailingWhitespaceEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webViewHost()->setSelectTrailingWhitespaceEnabled(arguments[0].value.boolValue); result->setNull(); } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const WebString& animationName, double time, const WebString& elementId) +bool DRTTestRunner::pauseAnimationAtTimeOnElementWithId(const WebString& animationName, double time, const WebString& elementId) { WebFrame* webFrame = m_shell->webView()->mainFrame(); if (!webFrame) @@ -1045,7 +1045,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const WebString& return controller->pauseAnimationAtTime(element, animationName, time); } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const WebString& propertyName, double time, const WebString& elementId) +bool DRTTestRunner::pauseTransitionAtTimeOnElementWithId(const WebString& propertyName, double time, const WebString& elementId) { WebFrame* webFrame = m_shell->webView()->mainFrame(); if (!webFrame) @@ -1061,7 +1061,7 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const WebString& return controller->pauseTransitionAtTime(element, propertyName, time); } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(const WebString& elementId) +bool DRTTestRunner::elementDoesAutoCompleteForElementWithId(const WebString& elementId) { WebFrame* webFrame = m_shell->webView()->mainFrame(); if (!webFrame) @@ -1075,7 +1075,7 @@ bool LayoutTestController::elementDoesAutoCompleteForElementWithId(const WebStri return inputElement.autoComplete(); } -int LayoutTestController::numberOfActiveAnimations() +int DRTTestRunner::numberOfActiveAnimations() { WebFrame* webFrame = m_shell->webView()->mainFrame(); if (!webFrame) @@ -1088,7 +1088,7 @@ int LayoutTestController::numberOfActiveAnimations() return controller->numberOfActiveAnimations(); } -void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result) { result->set(false); if (arguments.size() > 2 && arguments[0].isString() && arguments[1].isNumber() && arguments[2].isString()) { @@ -1099,7 +1099,7 @@ void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgument } } -void LayoutTestController::pauseTransitionAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::pauseTransitionAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result) { result->set(false); if (arguments.size() > 2 && arguments[0].isString() && arguments[1].isNumber() && arguments[2].isString()) { @@ -1110,7 +1110,7 @@ void LayoutTestController::pauseTransitionAtTimeOnElementWithId(const CppArgumen } } -void LayoutTestController::elementDoesAutoCompleteForElementWithId(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::elementDoesAutoCompleteForElementWithId(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() != 1 || !arguments[0].isString()) { result->set(false); @@ -1120,7 +1120,7 @@ void LayoutTestController::elementDoesAutoCompleteForElementWithId(const CppArgu result->set(elementDoesAutoCompleteForElementWithId(elementId)); } -void LayoutTestController::enableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::enableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() != 4) { result->set(false); @@ -1138,7 +1138,7 @@ void LayoutTestController::enableAutoResizeMode(const CppArgumentList& arguments result->set(true); } -void LayoutTestController::disableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::disableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() !=2) { result->set(false); @@ -1154,31 +1154,31 @@ void LayoutTestController::disableAutoResizeMode(const CppArgumentList& argument result->set(true); } -void LayoutTestController::numberOfActiveAnimations(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::numberOfActiveAnimations(const CppArgumentList&, CppVariant* result) { result->set(numberOfActiveAnimations()); } -void LayoutTestController::disableImageLoading(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::disableImageLoading(const CppArgumentList&, CppVariant* result) { m_shell->preferences()->loadsImagesAutomatically = false; m_shell->applyPreferences(); result->setNull(); } -void LayoutTestController::setIconDatabaseEnabled(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setIconDatabaseEnabled(const CppArgumentList&, CppVariant* result) { // We don't use the WebKit icon database. result->setNull(); } -void LayoutTestController::callShouldCloseOnWebView(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::callShouldCloseOnWebView(const CppArgumentList&, CppVariant* result) { result->set(m_shell->webView()->dispatchBeforeUnloadEvent()); } #if ENABLE(NOTIFICATIONS) -void LayoutTestController::grantDesktopNotificationPermission(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::grantDesktopNotificationPermission(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() != 1 || !arguments[0].isString()) { result->set(false); @@ -1190,7 +1190,7 @@ void LayoutTestController::grantDesktopNotificationPermission(const CppArgumentL result->set(true); } -void LayoutTestController::simulateDesktopNotificationClick(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::simulateDesktopNotificationClick(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() != 1 || !arguments[0].isString()) { result->set(false); @@ -1205,14 +1205,14 @@ void LayoutTestController::simulateDesktopNotificationClick(const CppArgumentLis } #endif -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setDomainRelaxationForbiddenForURLScheme(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() != 2 || !arguments[0].isBool() || !arguments[1].isString()) return; m_shell->webView()->setDomainRelaxationForbidden(cppVariantToBool(arguments[0]), cppVariantToWebString(arguments[1])); } -void LayoutTestController::setDeferMainResourceDataLoad(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setDeferMainResourceDataLoad(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() == 1) m_deferMainResourceDataLoad = cppVariantToBool(arguments[0]); @@ -1222,23 +1222,23 @@ void LayoutTestController::setDeferMainResourceDataLoad(const CppArgumentList& a // Unimplemented stubs // -void LayoutTestController::dumpAsWebArchive(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::dumpAsWebArchive(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::setMainFrameIsFirstResponder(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMainFrameIsFirstResponder(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result) { m_dumpSelectionRect = true; result->setNull(); } -void LayoutTestController::display(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::display(const CppArgumentList& arguments, CppVariant* result) { WebViewHost* host = m_shell->webViewHost(); const WebKit::WebSize& size = m_shell->webView()->size(); @@ -1249,7 +1249,7 @@ void LayoutTestController::display(const CppArgumentList& arguments, CppVariant* result->setNull(); } -void LayoutTestController::displayInvalidatedRegion(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::displayInvalidatedRegion(const CppArgumentList& arguments, CppVariant* result) { WebViewHost* host = m_shell->webViewHost(); host->paintInvalidatedRegion(); @@ -1257,59 +1257,59 @@ void LayoutTestController::displayInvalidatedRegion(const CppArgumentList& argum result->setNull(); } -void LayoutTestController::testRepaint(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::testRepaint(const CppArgumentList&, CppVariant* result) { m_testRepaint = true; result->setNull(); } -void LayoutTestController::repaintSweepHorizontally(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::repaintSweepHorizontally(const CppArgumentList&, CppVariant* result) { m_sweepHorizontally = true; result->setNull(); } -void LayoutTestController::clearBackForwardList(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::clearBackForwardList(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::keepWebHistory(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::keepWebHistory(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::storeWebScriptObject(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::storeWebScriptObject(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::accessStoredWebScriptObject(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::accessStoredWebScriptObject(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::objCClassNameOf(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::objCClassNameOf(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::addDisallowedURL(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addDisallowedURL(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::setCallCloseOnWebViews(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setCallCloseOnWebViews(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::setPrivateBrowsingEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPrivateBrowsingEnabled(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::setJavaScriptCanAccessClipboard(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setJavaScriptCanAccessClipboard(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->javaScriptCanAccessClipboard = arguments[0].value.boolValue; @@ -1318,7 +1318,7 @@ void LayoutTestController::setJavaScriptCanAccessClipboard(const CppArgumentList result->setNull(); } -void LayoutTestController::setXSSAuditorEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setXSSAuditorEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->XSSAuditorEnabled = arguments[0].value.boolValue; @@ -1327,7 +1327,7 @@ void LayoutTestController::setXSSAuditorEnabled(const CppArgumentList& arguments result->setNull(); } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::evaluateScriptInIsolatedWorldAndReturnValue(const CppArgumentList& arguments, CppVariant* result) { v8::HandleScope scope; WebVector<v8::Local<v8::Value> > values; @@ -1357,7 +1357,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(const Cpp } } -void LayoutTestController::evaluateScriptInIsolatedWorld(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::evaluateScriptInIsolatedWorld(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() >= 2 && arguments[0].isNumber() && arguments[1].isString()) { WebScriptSource source(cppVariantToWebString(arguments[1])); @@ -1368,7 +1368,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(const CppArgumentList& result->setNull(); } -void LayoutTestController::setIsolatedWorldSecurityOrigin(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setIsolatedWorldSecurityOrigin(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); @@ -1380,7 +1380,7 @@ void LayoutTestController::setIsolatedWorldSecurityOrigin(const CppArgumentList& WebSecurityOrigin::createFromString(cppVariantToWebString(arguments[1]))); } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAllowUniversalAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->allowUniversalAccessFromFileURLs = arguments[0].value.boolValue; @@ -1389,7 +1389,7 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(const CppArgument result->setNull(); } -void LayoutTestController::setAllowDisplayOfInsecureContent(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAllowDisplayOfInsecureContent(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setDisplayingInsecureContentAllowed(arguments[0].toBoolean()); @@ -1397,7 +1397,7 @@ void LayoutTestController::setAllowDisplayOfInsecureContent(const CppArgumentLis result->setNull(); } -void LayoutTestController::setAllowFileAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAllowFileAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->allowFileAccessFromFileURLs = arguments[0].value.boolValue; @@ -1406,7 +1406,7 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(const CppArgumentList& result->setNull(); } -void LayoutTestController::setAllowRunningOfInsecureContent(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAllowRunningOfInsecureContent(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setRunningInsecureContentAllowed(arguments[0].value.boolValue); @@ -1416,7 +1416,7 @@ void LayoutTestController::setAllowRunningOfInsecureContent(const CppArgumentLis // Need these conversions because the format of the value for booleans // may vary - for example, on mac "1" and "0" are used for boolean. -bool LayoutTestController::cppVariantToBool(const CppVariant& value) +bool DRTTestRunner::cppVariantToBool(const CppVariant& value) { if (value.isBool()) return value.toBoolean(); @@ -1433,7 +1433,7 @@ bool LayoutTestController::cppVariantToBool(const CppVariant& value) return false; } -int32_t LayoutTestController::cppVariantToInt32(const CppVariant& value) +int32_t DRTTestRunner::cppVariantToInt32(const CppVariant& value) { if (value.isNumber()) return value.toInt32(); @@ -1449,7 +1449,7 @@ int32_t LayoutTestController::cppVariantToInt32(const CppVariant& value) return 0; } -WebString LayoutTestController::cppVariantToWebString(const CppVariant& value) +WebString DRTTestRunner::cppVariantToWebString(const CppVariant& value) { if (!value.isString()) { logErrorToConsole("Invalid value for preference. Expected string value."); @@ -1458,7 +1458,7 @@ WebString LayoutTestController::cppVariantToWebString(const CppVariant& value) return WebString::fromUTF8(value.toString()); } -Vector<WebString> LayoutTestController::cppVariantToWebStringArray(const CppVariant& value) +Vector<WebString> DRTTestRunner::cppVariantToWebStringArray(const CppVariant& value) { if (!value.isObject()) { logErrorToConsole("Invalid value for preference. Expected object value."); @@ -1488,7 +1488,7 @@ static void setFontMap(WebPreferences::ScriptFontFamilyMap& map, const Vector<We } } -void LayoutTestController::overridePreference(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::overridePreference(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 2 || !arguments[0].isString()) @@ -1591,13 +1591,13 @@ void LayoutTestController::overridePreference(const CppArgumentList& arguments, m_shell->applyPreferences(); } -void LayoutTestController::fallbackMethod(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::fallbackMethod(const CppArgumentList&, CppVariant* result) { - printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on LayoutTestController\n"); + printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on DRTTestRunner\n"); result->setNull(); } -void LayoutTestController::addOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); @@ -1616,7 +1616,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(const CppArgumentList& arguments[3].toBoolean()); } -void LayoutTestController::removeOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::removeOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); @@ -1635,20 +1635,20 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(const CppArgumentLis arguments[3].toBoolean()); } -void LayoutTestController::clearAllDatabases(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::clearAllDatabases(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); webkit_support::ClearAllDatabases(); } -void LayoutTestController::setDatabaseQuota(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setDatabaseQuota(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if ((arguments.size() >= 1) && arguments[0].isNumber()) webkit_support::SetDatabaseQuota(arguments[0].toInt32()); } -void LayoutTestController::setPOSIXLocale(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPOSIXLocale(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() == 1 && arguments[0].isString()) @@ -1715,13 +1715,13 @@ static bool parsePageNumberSizeMargins(const CppArgumentList& arguments, int arg return true; } -void LayoutTestController::setPrinting(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPrinting(const CppArgumentList& arguments, CppVariant* result) { setIsPrinting(true); result->setNull(); } -void LayoutTestController::pageSizeAndMarginsInPixels(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::pageSizeAndMarginsInPixels(const CppArgumentList& arguments, CppVariant* result) { result->set(""); int pageNumber = 0; @@ -1746,7 +1746,7 @@ void LayoutTestController::pageSizeAndMarginsInPixels(const CppArgumentList& arg result->set(resultString.str()); } -void LayoutTestController::hasCustomPageSizeStyle(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::hasCustomPageSizeStyle(const CppArgumentList& arguments, CppVariant* result) { result->set(false); int pageIndex = 0; @@ -1758,7 +1758,7 @@ void LayoutTestController::hasCustomPageSizeStyle(const CppArgumentList& argumen result->set(frame->hasCustomPageSizeStyle(pageIndex)); } -void LayoutTestController::pageProperty(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::pageProperty(const CppArgumentList& arguments, CppVariant* result) { result->set(""); int pageNumber = 0; @@ -1775,7 +1775,7 @@ void LayoutTestController::pageProperty(const CppArgumentList& arguments, CppVar frame->printEnd(); } -void LayoutTestController::numberOfPages(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::numberOfPages(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); int pageWidthInPixels = 0; @@ -1792,7 +1792,7 @@ void LayoutTestController::numberOfPages(const CppArgumentList& arguments, CppVa result->set(numberOfPages); } -void LayoutTestController::numberOfPendingGeolocationPermissionRequests(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::numberOfPendingGeolocationPermissionRequests(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); Vector<WebViewHost*> windowList = m_shell->windowList(); @@ -1802,14 +1802,14 @@ void LayoutTestController::numberOfPendingGeolocationPermissionRequests(const Cp result->set(numberOfRequests); } -void LayoutTestController::logErrorToConsole(const std::string& text) +void DRTTestRunner::logErrorToConsole(const std::string& text) { m_shell->webViewHost()->didAddMessageToConsole( WebConsoleMessage(WebConsoleMessage::LevelError, WebString::fromUTF8(text)), WebString(), 0); } -void LayoutTestController::evaluateInWebInspector(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::evaluateInWebInspector(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString()) @@ -1817,13 +1817,13 @@ void LayoutTestController::evaluateInWebInspector(const CppArgumentList& argumen m_shell->drtDevToolsAgent()->evaluateInWebInspector(arguments[0].toInt32(), arguments[1].toString()); } -void LayoutTestController::forceRedSelectionColors(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::forceRedSelectionColors(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); m_shell->webView()->setSelectionColors(0xffee0000, 0xff00ee00, 0xff000000, 0xffc0c0c0); } -void LayoutTestController::addUserScript(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addUserScript(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isBool() || !arguments[2].isBool()) @@ -1834,7 +1834,7 @@ void LayoutTestController::addUserScript(const CppArgumentList& arguments, CppVa arguments[2].toBoolean() ? WebView::UserContentInjectInAllFrames : WebView::UserContentInjectInTopFrameOnly); } -void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addUserStyleSheet(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isBool()) @@ -1847,7 +1847,7 @@ void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, C WebView::UserStyleInjectInExistingDocuments); } -void LayoutTestController::setMockDeviceOrientation(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMockDeviceOrientation(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 6 || !arguments[0].isBool() || !arguments[1].isNumber() || !arguments[2].isBool() || !arguments[3].isNumber() || !arguments[4].isBool() || !arguments[5].isNumber()) @@ -1870,7 +1870,7 @@ void LayoutTestController::setMockDeviceOrientation(const CppArgumentList& argum // FIXME: For greater test flexibility, we should be able to set each page's geolocation mock individually. // https://bugs.webkit.org/show_bug.cgi?id=52368 -void LayoutTestController::setGeolocationPermission(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setGeolocationPermission(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isBool()) @@ -1880,7 +1880,7 @@ void LayoutTestController::setGeolocationPermission(const CppArgumentList& argum windowList[i]->geolocationClientMock()->setPermission(arguments[0].toBoolean()); } -void LayoutTestController::setMockGeolocationPosition(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMockGeolocationPosition(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 3 || !arguments[0].isNumber() || !arguments[1].isNumber() || !arguments[2].isNumber()) @@ -1890,7 +1890,7 @@ void LayoutTestController::setMockGeolocationPosition(const CppArgumentList& arg windowList[i]->geolocationClientMock()->setPosition(arguments[0].toDouble(), arguments[1].toDouble(), arguments[2].toDouble()); } -void LayoutTestController::setMockGeolocationError(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMockGeolocationError(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString()) @@ -1900,13 +1900,13 @@ void LayoutTestController::setMockGeolocationError(const CppArgumentList& argume windowList[i]->geolocationClientMock()->setError(arguments[0].toInt32(), cppVariantToWebString(arguments[1])); } -void LayoutTestController::abortModal(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::abortModal(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } #if ENABLE(INPUT_SPEECH) -void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isNumber() || !arguments[2].isString()) @@ -1916,7 +1916,7 @@ void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& argum controller->addMockRecognitionResult(cppVariantToWebString(arguments[0]), arguments[1].toDouble(), cppVariantToWebString(arguments[2])); } -void LayoutTestController::setMockSpeechInputDumpRect(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMockSpeechInputDumpRect(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isBool()) @@ -1928,7 +1928,7 @@ void LayoutTestController::setMockSpeechInputDumpRect(const CppArgumentList& arg #endif #if ENABLE(SCRIPTED_SPEECH) -void LayoutTestController::addMockSpeechRecognitionResult(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addMockSpeechRecognitionResult(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isNumber()) @@ -1938,7 +1938,7 @@ void LayoutTestController::addMockSpeechRecognitionResult(const CppArgumentList& recognizer->addMockResult(cppVariantToWebString(arguments[0]), arguments[1].toDouble()); } -void LayoutTestController::setMockSpeechRecognitionError(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMockSpeechRecognitionError(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString()) @@ -1948,7 +1948,7 @@ void LayoutTestController::setMockSpeechRecognitionError(const CppArgumentList& recognizer->setError(arguments[0].toInt32(), cppVariantToWebString(arguments[1])); } -void LayoutTestController::wasMockSpeechRecognitionAborted(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::wasMockSpeechRecognitionAborted(const CppArgumentList&, CppVariant* result) { result->set(false); if (MockWebSpeechRecognizer* recognizer = m_shell->webViewHost()->mockSpeechRecognizer()) @@ -1956,7 +1956,7 @@ void LayoutTestController::wasMockSpeechRecognitionAborted(const CppArgumentList } #endif -void LayoutTestController::startSpeechInput(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::startSpeechInput(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 1) @@ -1976,12 +1976,12 @@ void LayoutTestController::startSpeechInput(const CppArgumentList& arguments, Cp input->startSpeechInput(); } -void LayoutTestController::layerTreeAsText(const CppArgumentList& args, CppVariant* result) +void DRTTestRunner::layerTreeAsText(const CppArgumentList& args, CppVariant* result) { result->set(m_shell->webView()->mainFrame()->layerTreeAsText(m_showDebugLayerTree).utf8()); } -void LayoutTestController::loseCompositorContext(const CppArgumentList& args, CppVariant*) +void DRTTestRunner::loseCompositorContext(const CppArgumentList& args, CppVariant*) { int numTimes; if (args.size() == 1 || !args[0].isNumber()) @@ -1991,7 +1991,7 @@ void LayoutTestController::loseCompositorContext(const CppArgumentList& args, Cp m_shell->webView()->loseCompositorContext(numTimes); } -void LayoutTestController::markerTextForListItem(const CppArgumentList& args, CppVariant* result) +void DRTTestRunner::markerTextForListItem(const CppArgumentList& args, CppVariant* result) { WebElement element; if (!WebBindings::getElement(args[0].value.objectValue, &element)) @@ -2000,7 +2000,7 @@ void LayoutTestController::markerTextForListItem(const CppArgumentList& args, Cp result->set(element.document().frame()->markerTextForListItem(element).utf8()); } -void LayoutTestController::findString(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::findString(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() < 1 || !arguments[0].isString()) return; @@ -2028,7 +2028,7 @@ void LayoutTestController::findString(const CppArgumentList& arguments, CppVaria result->set(findResult); } -void LayoutTestController::setMinimumTimerInterval(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMinimumTimerInterval(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isNumber()) @@ -2036,7 +2036,7 @@ void LayoutTestController::setMinimumTimerInterval(const CppArgumentList& argume m_shell->webView()->settings()->setMinimumTimerInterval(arguments[0].toDouble()); } -void LayoutTestController::setAutofilled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAutofilled(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 2 || !arguments[1].isBool()) @@ -2053,7 +2053,7 @@ void LayoutTestController::setAutofilled(const CppArgumentList& arguments, CppVa input->setAutofilled(arguments[1].value.boolValue); } -void LayoutTestController::setValueForUser(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setValueForUser(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 2) @@ -2070,37 +2070,37 @@ void LayoutTestController::setValueForUser(const CppArgumentList& arguments, Cpp input->setValue(cppVariantToWebString(arguments[1]), true); } -void LayoutTestController::deleteAllLocalStorage(const CppArgumentList& arguments, CppVariant*) +void DRTTestRunner::deleteAllLocalStorage(const CppArgumentList& arguments, CppVariant*) { // Not Implemented } -void LayoutTestController::localStorageDiskUsageForOrigin(const CppArgumentList& arguments, CppVariant*) +void DRTTestRunner::localStorageDiskUsageForOrigin(const CppArgumentList& arguments, CppVariant*) { // Not Implemented } -void LayoutTestController::originsWithLocalStorage(const CppArgumentList& arguments, CppVariant*) +void DRTTestRunner::originsWithLocalStorage(const CppArgumentList& arguments, CppVariant*) { // Not Implemented } -void LayoutTestController::deleteLocalStorageForOrigin(const CppArgumentList& arguments, CppVariant*) +void DRTTestRunner::deleteLocalStorageForOrigin(const CppArgumentList& arguments, CppVariant*) { // Not Implemented } -void LayoutTestController::observeStorageTrackerNotifications(const CppArgumentList&, CppVariant*) +void DRTTestRunner::observeStorageTrackerNotifications(const CppArgumentList&, CppVariant*) { // Not Implemented } -void LayoutTestController::syncLocalStorage(const CppArgumentList&, CppVariant*) +void DRTTestRunner::syncLocalStorage(const CppArgumentList&, CppVariant*) { // Not Implemented } -void LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() == 1 && arguments[0].isBool()) m_shouldStayOnPageAfterHandlingBeforeUnload = arguments[0].toBoolean(); @@ -2108,7 +2108,7 @@ void LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload(const Cp result->setNull(); } -void LayoutTestController::enableFixedLayoutMode(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::enableFixedLayoutMode(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isBool()) @@ -2117,7 +2117,7 @@ void LayoutTestController::enableFixedLayoutMode(const CppArgumentList& argument m_shell->webView()->enableFixedLayoutMode(enableFixedLayout); } -void LayoutTestController::setFixedLayoutSize(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setFixedLayoutSize(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber()) @@ -2127,17 +2127,17 @@ void LayoutTestController::setFixedLayoutSize(const CppArgumentList& arguments, m_shell->webView()->setFixedLayoutSize(WebSize(width, height)); } -void LayoutTestController::selectionAsMarkup(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::selectionAsMarkup(const CppArgumentList& arguments, CppVariant* result) { result->set(m_shell->webView()->mainFrame()->selectionAsMarkup().utf8()); } -void LayoutTestController::workerThreadCount(CppVariant* result) +void DRTTestRunner::workerThreadCount(CppVariant* result) { result->set(static_cast<int>(WebWorkerInfo::dedicatedWorkerCount())); } -void LayoutTestController::sendWebIntentResponse(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::sendWebIntentResponse(const CppArgumentList& arguments, CppVariant* result) { v8::HandleScope scope; v8::Local<v8::Context> ctx = m_shell->webView()->mainFrame()->mainWorldScriptContext(); @@ -2159,7 +2159,7 @@ void LayoutTestController::sendWebIntentResponse(const CppArgumentList& argument result->setNull(); } -void LayoutTestController::deliverWebIntent(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::deliverWebIntent(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() < 3) return; @@ -2180,7 +2180,7 @@ void LayoutTestController::deliverWebIntent(const CppArgumentList& arguments, Cp m_shell->webView()->mainFrame()->deliverIntent(intent, 0, m_intentClient.get()); } -void LayoutTestController::setTextSubpixelPositioning(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setTextSubpixelPositioning(const CppArgumentList& arguments, CppVariant* result) { #if OS(LINUX) || OS(ANDROID) // Since FontConfig doesn't provide a variable to control subpixel positioning, we'll fall back @@ -2191,10 +2191,10 @@ void LayoutTestController::setTextSubpixelPositioning(const CppArgumentList& arg result->setNull(); } -class InvokeCallbackTask : public MethodTask<LayoutTestController> { +class InvokeCallbackTask : public MethodTask<DRTTestRunner> { public: - InvokeCallbackTask(LayoutTestController* object, PassOwnArrayPtr<CppVariant> callbackArguments, uint32_t numberOfArguments) - : MethodTask<LayoutTestController>(object) + InvokeCallbackTask(DRTTestRunner* object, PassOwnArrayPtr<CppVariant> callbackArguments, uint32_t numberOfArguments) + : MethodTask<DRTTestRunner>(object) , m_callbackArguments(callbackArguments) , m_numberOfArguments(numberOfArguments) { @@ -2211,7 +2211,7 @@ private: uint32_t m_numberOfArguments; }; -void LayoutTestController::setBackingScaleFactor(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setBackingScaleFactor(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isObject()) return; @@ -2225,7 +2225,7 @@ void LayoutTestController::setBackingScaleFactor(const CppArgumentList& argument postTask(new InvokeCallbackTask(this, callbackArguments.release(), 1)); } -void LayoutTestController::setPluginsEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPluginsEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->pluginsEnabled = arguments[0].toBoolean(); @@ -2234,12 +2234,12 @@ void LayoutTestController::setPluginsEnabled(const CppArgumentList& arguments, C result->setNull(); } -void LayoutTestController::resetPageVisibility(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::resetPageVisibility(const CppArgumentList& arguments, CppVariant* result) { m_shell->webView()->setVisibilityState(WebPageVisibilityStateVisible, true); } -void LayoutTestController::setPageVisibility(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPageVisibility(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { string newVisibility = arguments[0].toString(); @@ -2254,12 +2254,12 @@ void LayoutTestController::setPageVisibility(const CppArgumentList& arguments, C } } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) +void DRTTestRunner::setAutomaticLinkDetectionEnabled(bool) { // Not Implemented } -void LayoutTestController::setTextDirection(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setTextDirection(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 1 || !arguments[0].isString()) @@ -2280,7 +2280,7 @@ void LayoutTestController::setTextDirection(const CppArgumentList& arguments, Cp m_shell->webView()->setTextDirection(direction); } -void LayoutTestController::setAudioData(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAudioData(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); @@ -2297,7 +2297,7 @@ void LayoutTestController::setAudioData(const CppArgumentList& arguments, CppVar setShouldDumpAsAudio(true); } -void LayoutTestController::setHasCustomFullScreenBehavior(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setHasCustomFullScreenBehavior(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isBool()) @@ -2306,26 +2306,26 @@ void LayoutTestController::setHasCustomFullScreenBehavior(const CppArgumentList& } #if ENABLE(POINTER_LOCK) -void LayoutTestController::didLosePointerLock(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::didLosePointerLock(const CppArgumentList&, CppVariant* result) { m_shell->webViewHost()->didLosePointerLock(); result->setNull(); } -void LayoutTestController::setPointerLockWillFailAsynchronously(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setPointerLockWillFailAsynchronously(const CppArgumentList&, CppVariant* result) { m_shell->webViewHost()->setPointerLockWillFailAsynchronously(); result->setNull(); } -void LayoutTestController::setPointerLockWillFailSynchronously(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, CppVariant* result) { m_shell->webViewHost()->setPointerLockWillFailSynchronously(); result->setNull(); } #endif -void LayoutTestController::textSurroundingNode(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::textSurroundingNode(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 4 || !arguments[0].isObject() || !arguments[1].isNumber() || !arguments[2].isNumber() || !arguments[3].isNumber()) diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.h b/Tools/DumpRenderTree/chromium/DRTTestRunner.h index 9cfd12359..e9c0171f9 100644 --- a/Tools/DumpRenderTree/chromium/LayoutTestController.h +++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.h @@ -30,28 +30,28 @@ */ /* - LayoutTestController class: - Bound to a JavaScript window.layoutTestController object using the + DRTTestRunner class: + Bound to a JavaScript window.testRunner object using the CppBoundClass::bindToJavascript(), this allows layout tests that are run in the test_shell (or, in principle, any web page loaded into a client app built with this class) to control various aspects of how the tests are run and what sort of output they produce. */ -#ifndef LayoutTestController_h -#define LayoutTestController_h +#ifndef DRTTestRunner_h +#define DRTTestRunner_h -#include "TestRunner.h" +#include "TestRunner/TestRunner.h" class TestShell; -class LayoutTestController : public TestRunner { +class DRTTestRunner : public TestRunner { public: // Builds the property and method lists needed to bind this class to a JS // object. - LayoutTestController(TestShell*); + DRTTestRunner(TestShell*); - ~LayoutTestController(); + ~DRTTestRunner(); // This function sets a flag that tells the test_shell to dump pages as // plain text, rather than as a text representation of the renderer's state. @@ -345,7 +345,7 @@ public: void setMockGeolocationPosition(const CppArgumentList&, CppVariant*); void setMockGeolocationError(const CppArgumentList&, CppVariant*); - // Empty stub method to keep parity with object model exposed by global LayoutTestController. + // Empty stub method to keep parity with object model exposed by global DRTTestRunner. void abortModal(const CppArgumentList&, CppVariant*); // Speech input related functions. @@ -528,7 +528,7 @@ private: // queueScript. class WorkQueue { public: - WorkQueue(LayoutTestController* controller) : m_frozen(false), m_controller(controller) { } + WorkQueue(DRTTestRunner* controller) : m_frozen(false), m_controller(controller) { } virtual ~WorkQueue(); void processWorkSoon(); @@ -552,7 +552,7 @@ private: TaskList m_taskList; Deque<WorkItem*> m_queue; bool m_frozen; - LayoutTestController* m_controller; + DRTTestRunner* m_controller; }; // Support for overridePreference. @@ -563,9 +563,9 @@ private: void logErrorToConsole(const std::string&); void completeNotifyDone(bool isTimeout); - class NotifyDoneTimedOutTask: public MethodTask<LayoutTestController> { + class NotifyDoneTimedOutTask: public MethodTask<DRTTestRunner> { public: - NotifyDoneTimedOutTask(LayoutTestController* object): MethodTask<LayoutTestController>(object) { } + NotifyDoneTimedOutTask(DRTTestRunner* object): MethodTask<DRTTestRunner>(object) { } virtual void runIfValid() { m_object->completeNotifyDone(true); } }; @@ -578,7 +578,7 @@ private: // Used for test timeouts. TaskList m_taskList; - // Non-owning pointer. The LayoutTestController is owned by the host. + // Non-owning pointer. The DRTTestRunner is owned by the host. TestShell* m_shell; // If true, the test_shell will produce a plain text dump rather than a @@ -717,4 +717,4 @@ private: bool m_hasCustomFullScreenBehavior; }; -#endif // LayoutTestController_h +#endif // DRTTestRunner_h diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp index ae5502cd2..9a8bd7fd4 100644 --- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp @@ -252,7 +252,7 @@ int main(int argc, char* argv[]) shell.callJSGC(); shell.callJSGC(); - // When we finish the last test, cleanup the LayoutTestController. + // When we finish the last test, cleanup the DRTTestRunner. // It may have references to not-yet-cleaned up windows. By cleaning up // here we help purify reports. shell.resetTestController(); diff --git a/Tools/DumpRenderTree/chromium/NotificationPresenter.h b/Tools/DumpRenderTree/chromium/NotificationPresenter.h index 5fed178da..e98cc7294 100644 --- a/Tools/DumpRenderTree/chromium/NotificationPresenter.h +++ b/Tools/DumpRenderTree/chromium/NotificationPresenter.h @@ -46,10 +46,10 @@ public: explicit NotificationPresenter(TestShell*) { } virtual ~NotificationPresenter(); - // Called by the LayoutTestController to simulate a user granting permission. + // Called by the DRTTestRunner to simulate a user granting permission. void grantPermission(const WebKit::WebString& origin); - // Called by the LayoutTestController to simulate a user clicking on a notification. + // Called by the DRTTestRunner to simulate a user clicking on a notification. bool simulateClick(const WebKit::WebString& notificationIdentifier); // WebKit::WebNotificationPresenter interface diff --git a/Tools/DumpRenderTree/chromium/TestShell.cpp b/Tools/DumpRenderTree/chromium/TestShell.cpp index 29a2a3130..9abb13fac 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.cpp +++ b/Tools/DumpRenderTree/chromium/TestShell.cpp @@ -33,9 +33,8 @@ #include "DRTDevToolsAgent.h" #include "DRTDevToolsClient.h" -#include "LayoutTestController.h" +#include "DRTTestRunner.h" #include "MockWebPrerenderingSupport.h" -#include "platform/WebArrayBufferView.h" #include "WebDataSource.h" #include "WebDocument.h" #include "WebElement.h" @@ -49,6 +48,7 @@ #include "WebSettings.h" #include "WebView.h" #include "WebViewHost.h" +#include "platform/WebArrayBufferView.h" #include "skia/ext/platform_canvas.h" #include "webkit/support/webkit_support.h" #include "webkit/support/webkit_support_gfx.h" @@ -119,6 +119,7 @@ TestShell::TestShell() , m_isDisplayingModalDialog(false) { WebRuntimeFeatures::enableDataTransferItems(true); + WebRuntimeFeatures::enableDeviceMotion(false); WebRuntimeFeatures::enableGeolocation(true); WebRuntimeFeatures::enablePointerLock(true); WebRuntimeFeatures::enableIndexedDatabase(true); @@ -151,7 +152,7 @@ void TestShell::initialize() { m_webPermissions = adoptPtr(new WebPermissions(this)); m_testInterfaces = adoptPtr(new TestInterfaces()); - m_layoutTestController = adoptPtr(new LayoutTestController(this)); + m_testRunner = adoptPtr(new DRTTestRunner(this)); #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) m_notificationPresenter = adoptPtr(new NotificationPresenter(this)); #endif @@ -240,11 +241,11 @@ void TestShell::runFileTest(const TestParams& params, bool shouldDumpPixels) m_params = params; string testUrl = m_params.testUrl.spec(); - m_layoutTestController->setShouldGeneratePixelResults(shouldDumpPixels); + m_testRunner->setShouldGeneratePixelResults(shouldDumpPixels); if (testUrl.find("loading/") != string::npos || testUrl.find("loading\\") != string::npos) - m_layoutTestController->setShouldDumpFrameLoadCallbacks(true); + m_testRunner->setShouldDumpFrameLoadCallbacks(true); if (testUrl.find("compositing/") != string::npos || testUrl.find("compositing\\") != string::npos) { m_prefs.acceleratedCompositingForVideoEnabled = true; @@ -256,8 +257,8 @@ void TestShell::runFileTest(const TestParams& params, bool shouldDumpPixels) if (testUrl.find("/dumpAsText/") != string::npos || testUrl.find("\\dumpAsText\\") != string::npos) { - m_layoutTestController->setShouldDumpAsText(true); - m_layoutTestController->setShouldGeneratePixelResults(false); + m_testRunner->setShouldDumpAsText(true); + m_testRunner->setShouldGeneratePixelResults(false); } if (testUrl.find("/inspector/") != string::npos @@ -265,7 +266,7 @@ void TestShell::runFileTest(const TestParams& params, bool shouldDumpPixels) showDevTools(); if (m_params.debugLayerTree) - m_layoutTestController->setShowDebugLayerTree(true); + m_testRunner->setShowDebugLayerTree(true); if (m_dumpWhenFinished) m_printer.handleTestHeader(testUrl.c_str()); @@ -298,7 +299,7 @@ void TestShell::resetTestController() resetWebSettings(*webView()); m_webPermissions->reset(); m_testInterfaces->resetAll(); - m_layoutTestController->reset(); + m_testRunner->reset(); m_webViewHost->reset(); #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) m_notificationPresenter->reset(); @@ -555,14 +556,14 @@ void TestShell::dump() WebFrame* frame = m_webView->mainFrame(); if (!frame) return; - bool shouldDumpAsText = m_layoutTestController->shouldDumpAsText(); - bool shouldDumpAsAudio = m_layoutTestController->shouldDumpAsAudio(); - bool shouldGeneratePixelResults = m_layoutTestController->shouldGeneratePixelResults(); - bool shouldDumpAsPrinted = m_layoutTestController->isPrinting(); + bool shouldDumpAsText = m_testRunner->shouldDumpAsText(); + bool shouldDumpAsAudio = m_testRunner->shouldDumpAsAudio(); + bool shouldGeneratePixelResults = m_testRunner->shouldGeneratePixelResults(); + bool shouldDumpAsPrinted = m_testRunner->isPrinting(); bool dumpedAnything = false; if (shouldDumpAsAudio) { - const WebKit::WebArrayBufferView& webArrayBufferView = m_layoutTestController->audioData(); + const WebKit::WebArrayBufferView& webArrayBufferView = m_testRunner->audioData(); m_printer.handleAudio(webArrayBufferView.baseAddress(), webArrayBufferView.byteLength()); m_printer.handleAudioFooter(); m_printer.handleTestFooter(true); @@ -586,7 +587,7 @@ void TestShell::dump() } } if (shouldDumpAsText) { - bool recursive = m_layoutTestController->shouldDumpChildFramesAsText(); + bool recursive = m_testRunner->shouldDumpChildFramesAsText(); string dataUtf8 = shouldDumpAsPrinted ? dumpFramesAsPrintedText(frame, recursive) : dumpFramesAsText(frame, recursive); if (fwrite(dataUtf8.c_str(), 1, dataUtf8.size(), stdout) != dataUtf8.size()) FATAL("Short write to stdout, disk full?\n"); @@ -597,10 +598,10 @@ void TestShell::dump() if (m_params.debugRenderTree) renderTextBehavior |= WebFrame::RenderAsTextDebug; printf("%s", frame->renderTreeAsText(renderTextBehavior).utf8().data()); - bool recursive = m_layoutTestController->shouldDumpChildFrameScrollPositions(); + bool recursive = m_testRunner->shouldDumpChildFrameScrollPositions(); dumpFrameScrollPosition(frame, recursive); } - if (m_layoutTestController->shouldDumpBackForwardList()) + if (m_testRunner->shouldDumpBackForwardList()) printf("%s", dumpAllBackForwardLists().c_str()); } if (dumpedAnything && m_params.printSeparators) @@ -612,18 +613,18 @@ void TestShell::dump() // stdout. dumpedAnything = true; m_webView->layout(); - if (m_layoutTestController->testRepaint()) { + if (m_testRunner->testRepaint()) { WebSize viewSize = m_webView->size(); int width = viewSize.width; int height = viewSize.height; - if (m_layoutTestController->sweepHorizontally()) { + if (m_testRunner->sweepHorizontally()) { for (WebRect column(0, 0, 1, height); column.x < width; column.x++) m_webViewHost->paintRect(column); } else { for (WebRect line(0, 0, width, 1); line.y < height; line.y++) m_webViewHost->paintRect(line); } - } else if (m_layoutTestController->isPrinting()) + } else if (m_testRunner->isPrinting()) m_webViewHost->paintPagesWithBoundaries(); else m_webViewHost->paintInvalidatedRegion(); @@ -631,7 +632,7 @@ void TestShell::dump() // See if we need to draw the selection bounds rect. Selection bounds // rect is the rect enclosing the (possibly transformed) selection. // The rect should be drawn after everything is laid out and painted. - if (m_layoutTestController->shouldDumpSelectionRect()) { + if (m_testRunner->shouldDumpSelectionRect()) { // If there is a selection rect - draw a red 1px border enclosing rect WebRect wr = frame->selectionBoundsRect(); if (!wr.isEmpty()) { @@ -725,8 +726,8 @@ void TestShell::bindJSObjectsToWindow(WebFrame* frame) { WebTestingSupport::injectInternalsObject(frame); m_testInterfaces->bindTo(frame); - m_layoutTestController->bindToJavascript(frame, WebString::fromUTF8("layoutTestController")); - m_layoutTestController->bindToJavascript(frame, WebString::fromUTF8("testRunner")); + m_testRunner->bindToJavascript(frame, WebString::fromUTF8("testRunner")); + m_testRunner->bindToJavascript(frame, WebString::fromUTF8("layoutTestController")); } WebViewHost* TestShell::createNewWindow(const WebKit::WebURL& url) diff --git a/Tools/DumpRenderTree/chromium/TestShell.h b/Tools/DumpRenderTree/chromium/TestShell.h index 005d374a2..405034a4e 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.h +++ b/Tools/DumpRenderTree/chromium/TestShell.h @@ -32,8 +32,8 @@ #define TestShell_h #include "AccessibilityControllerChromium.h" +#include "DRTTestRunner.h" #include "GamepadController.h" -#include "LayoutTestController.h" #include "NotificationPresenter.h" #include "TestEventPrinter.h" #include "TestInterfaces.h" @@ -87,7 +87,7 @@ public: WebKit::WebView* webView() const { return m_webView; } // Returns the host for the main WebView. WebViewHost* webViewHost() const { return m_webViewHost.get(); } - LayoutTestController* layoutTestController() const { return m_layoutTestController.get(); } + DRTTestRunner* testRunner() const { return m_testRunner.get(); } EventSender* eventSender() const { return m_testInterfaces->eventSender(); } AccessibilityController* accessibilityController() const { return m_testInterfaces->accessibilityController(); } #if ENABLE(NOTIFICATIONS) @@ -113,15 +113,15 @@ public: int navigationEntryCount() const; void setFocus(WebKit::WebWidget*, bool enable); - bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpFrameLoadCallbacks(); } - bool shouldDumpUserGestureInFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpUserGestureInFrameLoadCallbacks(); } - bool shouldDumpResourceLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceLoadCallbacks(); } - bool shouldDumpResourceResponseMIMETypes() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceResponseMIMETypes(); } + bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpFrameLoadCallbacks(); } + bool shouldDumpUserGestureInFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpUserGestureInFrameLoadCallbacks(); } + bool shouldDumpResourceLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpResourceLoadCallbacks(); } + bool shouldDumpResourceResponseMIMETypes() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpResourceResponseMIMETypes(); } void setIsLoading(bool flag) { m_isLoading = flag; } - // Called by the LayoutTestController to signal test completion. + // Called by the DRTTestRunner to signal test completion. void testFinished(); - // Called by LayoutTestController when a test hits the timeout, but does not + // Called by DRTTestRunner when a test hits the timeout, but does not // cause a hang. We can avoid killing TestShell in this case and still dump // the test results. void testTimedOut(); @@ -211,7 +211,7 @@ private: OwnPtr<DRTDevToolsAgent> m_drtDevToolsAgent; OwnPtr<DRTDevToolsClient> m_drtDevToolsClient; OwnPtr<TestInterfaces> m_testInterfaces; - OwnPtr<LayoutTestController> m_layoutTestController; + OwnPtr<DRTTestRunner> m_testRunner; #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) OwnPtr<NotificationPresenter> m_notificationPresenter; #endif diff --git a/Tools/DumpRenderTree/chromium/WebPermissions.cpp b/Tools/DumpRenderTree/chromium/WebPermissions.cpp index ee90a7b2c..2c7c9eee8 100644 --- a/Tools/DumpRenderTree/chromium/WebPermissions.cpp +++ b/Tools/DumpRenderTree/chromium/WebPermissions.cpp @@ -31,7 +31,7 @@ #include "config.h" #include "WebPermissions.h" -#include "LayoutTestController.h" +#include "DRTTestRunner.h" #include "TestShell.h" #include "platform/WebCString.h" #include "platform/WebURL.h" @@ -49,7 +49,7 @@ WebPermissions::~WebPermissions() bool WebPermissions::allowImage(WebKit::WebFrame*, bool enabledPerSettings, const WebKit::WebURL& imageURL) { bool allowed = enabledPerSettings && m_imagesAllowed; - if (layoutTestController()->shouldDumpPermissionClientCallbacks()) + if (testRunner()->shouldDumpPermissionClientCallbacks()) fprintf(stdout, "PERMISSION CLIENT: allowImage(%s): %s\n", m_shell->normalizeLayoutTestURL(imageURL.spec()).c_str(), allowed ? "true" : "false"); return allowed; } @@ -57,7 +57,7 @@ bool WebPermissions::allowImage(WebKit::WebFrame*, bool enabledPerSettings, cons bool WebPermissions::allowScriptFromSource(WebKit::WebFrame*, bool enabledPerSettings, const WebKit::WebURL& scriptURL) { bool allowed = enabledPerSettings && m_scriptsAllowed; - if (layoutTestController()->shouldDumpPermissionClientCallbacks()) + if (testRunner()->shouldDumpPermissionClientCallbacks()) fprintf(stdout, "PERMISSION CLIENT: allowScriptFromSource(%s): %s\n", m_shell->normalizeLayoutTestURL(scriptURL.spec()).c_str(), allowed ? "true" : "false"); return allowed; } @@ -126,7 +126,7 @@ void WebPermissions::reset() // Private functions ---------------------------------------------------------- -LayoutTestController* WebPermissions::layoutTestController() const +DRTTestRunner* WebPermissions::testRunner() const { - return m_shell->layoutTestController(); + return m_shell->testRunner(); } diff --git a/Tools/DumpRenderTree/chromium/WebPermissions.h b/Tools/DumpRenderTree/chromium/WebPermissions.h index 184046a0a..c625077e8 100644 --- a/Tools/DumpRenderTree/chromium/WebPermissions.h +++ b/Tools/DumpRenderTree/chromium/WebPermissions.h @@ -33,7 +33,7 @@ #include "WebPermissionClient.h" -class LayoutTestController; +class DRTTestRunner; class TestShell; class WebPermissions : public WebKit::WebPermissionClient { @@ -63,7 +63,7 @@ public: void reset(); private: - LayoutTestController* layoutTestController() const; + DRTTestRunner* testRunner() const; // Non-owning pointer. The WebPermissions instance is owned by this TestShell instance. TestShell* m_shell; diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp index 115c405ec..a67d1e304 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp +++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp @@ -31,8 +31,8 @@ #include "config.h" #include "WebViewHost.h" +#include "DRTTestRunner.h" #include "EventSender.h" -#include "LayoutTestController.h" #include "MockGrammarCheck.h" #include "MockWebSpeechInputController.h" #include "MockWebSpeechRecognizer.h" @@ -251,9 +251,9 @@ static string textAffinityDescription(WebTextAffinity affinity) WebView* WebViewHost::createView(WebFrame*, const WebURLRequest& request, const WebWindowFeatures&, const WebString&, WebNavigationPolicy) { - if (!layoutTestController()->canOpenWindows()) + if (!testRunner()->canOpenWindows()) return 0; - if (layoutTestController()->shouldDumpCreateView()) + if (testRunner()->shouldDumpCreateView()) fprintf(stdout, "createView(%s)\n", URLDescription(request.url()).c_str()); return m_shell->createNewWindow(WebURL())->webView(); } @@ -319,7 +319,7 @@ void WebViewHost::didStartLoading() void WebViewHost::didStopLoading() { - if (layoutTestController()->shouldDumpProgressFinishedCallback()) + if (testRunner()->shouldDumpProgressFinishedCallback()) fputs("postProgressFinishedNotification\n", stdout); m_shell->setIsLoading(false); } @@ -329,50 +329,50 @@ void WebViewHost::didStopLoading() bool WebViewHost::shouldBeginEditing(const WebRange& range) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { fputs("EDITING DELEGATE: shouldBeginEditingInDOMRange:", stdout); printRangeDescription(range); fputs("\n", stdout); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldEndEditing(const WebRange& range) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { fputs("EDITING DELEGATE: shouldEndEditingInDOMRange:", stdout); printRangeDescription(range); fputs("\n", stdout); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldInsertNode(const WebNode& node, const WebRange& range, WebEditingAction action) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { fputs("EDITING DELEGATE: shouldInsertNode:", stdout); printNodeDescription(node, 0); fputs(" replacingDOMRange:", stdout); printRangeDescription(range); printf(" givenAction:%s\n", editingActionDescription(action).c_str()); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldInsertText(const WebString& text, const WebRange& range, WebEditingAction action) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:", text.utf8().data()); printRangeDescription(range); printf(" givenAction:%s\n", editingActionDescription(action).c_str()); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldChangeSelectedRange( const WebRange& fromRange, const WebRange& toRange, WebTextAffinity affinity, bool stillSelecting) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { fputs("EDITING DELEGATE: shouldChangeSelectedDOMRange:", stdout); printRangeDescription(fromRange); fputs(" toDOMRange:", stdout); @@ -381,27 +381,27 @@ bool WebViewHost::shouldChangeSelectedRange( textAffinityDescription(affinity).c_str(), (stillSelecting ? "TRUE" : "FALSE")); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldDeleteRange(const WebRange& range) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { fputs("EDITING DELEGATE: shouldDeleteDOMRange:", stdout); printRangeDescription(range); fputs("\n", stdout); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldApplyStyle(const WebString& style, const WebRange& range) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:", style.utf8().data()); printRangeDescription(range); fputs("\n", stdout); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::isSmartInsertDeleteEnabled() @@ -416,28 +416,28 @@ bool WebViewHost::isSelectTrailingWhitespaceEnabled() void WebViewHost::didBeginEditing() { - if (!layoutTestController()->shouldDumpEditingCallbacks()) + if (!testRunner()->shouldDumpEditingCallbacks()) return; fputs("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n", stdout); } void WebViewHost::didChangeSelection(bool isEmptySelection) { - if (layoutTestController()->shouldDumpEditingCallbacks()) + if (testRunner()->shouldDumpEditingCallbacks()) fputs("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n", stdout); // No need to update clipboard with the selected text in DRT. } void WebViewHost::didChangeContents() { - if (!layoutTestController()->shouldDumpEditingCallbacks()) + if (!testRunner()->shouldDumpEditingCallbacks()) return; fputs("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n", stdout); } void WebViewHost::didEndEditing() { - if (!layoutTestController()->shouldDumpEditingCallbacks()) + if (!testRunner()->shouldDumpEditingCallbacks()) return; fputs("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n", stdout); } @@ -561,7 +561,7 @@ bool WebViewHost::runModalPromptDialog(WebFrame* frame, const WebString& message bool WebViewHost::runModalBeforeUnloadDialog(WebFrame*, const WebString& message) { printf("CONFIRM NAVIGATION: %s\n", message.utf8().data()); - return !layoutTestController()->shouldStayOnPageAfterHandlingBeforeUnload(); + return !testRunner()->shouldStayOnPageAfterHandlingBeforeUnload(); } void WebViewHost::showContextMenu(WebFrame*, const WebContextMenuData& contextMenuData) @@ -581,7 +581,7 @@ WebContextMenuData* WebViewHost::lastContextMenuData() const void WebViewHost::setStatusText(const WebString& text) { - if (!layoutTestController()->shouldDumpStatusCallbacks()) + if (!testRunner()->shouldDumpStatusCallbacks()) return; // When running tests, write to stdout. printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", text.utf8().data()); @@ -590,7 +590,7 @@ void WebViewHost::setStatusText(const WebString& text) void WebViewHost::startDragging(WebFrame*, const WebDragData& data, WebDragOperationsMask mask, const WebImage&, const WebPoint&) { WebDragData mutableDragData = data; - if (layoutTestController()->shouldAddFileToPasteboard()) { + if (testRunner()->shouldAddFileToPasteboard()) { // Add a file called DRTFakeFile to the drag&drop clipboard. addDRTFakeFileToDataObject(&mutableDragData); } @@ -1055,7 +1055,7 @@ WebNavigationPolicy WebViewHost::decidePolicyForNavigation( result = WebKit::WebNavigationPolicyIgnore; if (m_policyDelegateShouldNotifyDone) - layoutTestController()->policyDelegateDone(); + testRunner()->policyDelegateDone(); return result; } @@ -1113,7 +1113,7 @@ void WebViewHost::didCancelClientRedirect(WebFrame* frame) void WebViewHost::didCreateDataSource(WebFrame*, WebDataSource* ds) { ds->setExtraData(m_pendingExtraData.leakPtr()); - if (!layoutTestController()->deferMainResourceDataLoad()) + if (!testRunner()->deferMainResourceDataLoad()) ds->setDeferMainResourceDataLoad(false); } @@ -1130,7 +1130,7 @@ void WebViewHost::didStartProvisionalLoad(WebFrame* frame) if (!m_topLoadingFrame) m_topLoadingFrame = frame; - if (layoutTestController()->stopProvisionalFrameLoads()) { + if (testRunner()->stopProvisionalFrameLoads()) { printFrameDescription(frame); fputs(" - stopping load in didStartProvisionalLoadForFrame callback\n", stdout); frame->stopLoading(); @@ -1183,11 +1183,11 @@ void WebViewHost::didReceiveTitle(WebFrame* frame, const WebString& title, WebTe printf(" - didReceiveTitle: %s\n", title8.data()); } - if (layoutTestController()->shouldDumpTitleChanges()) + if (testRunner()->shouldDumpTitleChanges()) printf("TITLE CHANGED: %s\n", title8.data()); setPageTitle(title); - layoutTestController()->setTitleTextDirection(direction); + testRunner()->setTitleTextDirection(direction); } void WebViewHost::didFinishDocumentLoad(WebFrame* frame) @@ -1281,7 +1281,7 @@ void WebViewHost::willSendRequest(WebFrame* frame, unsigned identifier, WebURLRe string requestURL = url.possibly_invalid_spec(); GURL mainDocumentURL = request.firstPartyForCookies(); - if (layoutTestController()->shouldDumpResourceLoadCallbacks()) { + if (testRunner()->shouldDumpResourceLoadCallbacks()) { printResourceDescription(identifier); printf(" - willSendRequest <NSURLRequest URL %s, main document URL %s," " http method %s> redirectResponse ", @@ -1385,9 +1385,14 @@ void WebViewHost::openFileSystem(WebFrame* frame, WebFileSystem::Type type, long webkit_support::OpenFileSystem(frame, type, size, create, callbacks); } +void WebViewHost::deleteFileSystem(WebKit::WebFrame* frame, WebKit::WebFileSystem::Type type, WebKit::WebFileSystemCallbacks* callbacks) +{ + webkit_support::DeleteFileSystem(frame, type, callbacks); +} + bool WebViewHost::willCheckAndDispatchMessageEvent(WebFrame* source, WebSecurityOrigin target, WebDOMMessageEvent event) { - if (m_shell->layoutTestController()->shouldInterceptPostMessage()) { + if (m_shell->testRunner()->shouldInterceptPostMessage()) { fputs("intercepted postMessage\n", stdout); return true; } @@ -1638,9 +1643,9 @@ bool WebViewHost::navigate(const TestNavigationEntry& entry, bool reload) // Private functions ---------------------------------------------------------- -LayoutTestController* WebViewHost::layoutTestController() const +DRTTestRunner* WebViewHost::testRunner() const { - return m_shell->layoutTestController(); + return m_shell->testRunner(); } void WebViewHost::updateAddressBar(WebView* webView) @@ -1660,7 +1665,7 @@ void WebViewHost::locationChangeDone(WebFrame* frame) if (frame != m_topLoadingFrame) return; m_topLoadingFrame = 0; - layoutTestController()->locationChangeDone(); + testRunner()->locationChangeDone(); } void WebViewHost::updateForCommittedLoad(WebFrame* frame, bool isNewNavigation) @@ -1780,7 +1785,7 @@ void WebViewHost::setAddressBarURL(const WebURL&) void WebViewHost::enterFullScreenNow() { - if (layoutTestController()->hasCustomFullScreenBehavior()) + if (testRunner()->hasCustomFullScreenBehavior()) return; webView()->willEnterFullScreen(); @@ -1789,7 +1794,7 @@ void WebViewHost::enterFullScreenNow() void WebViewHost::exitFullScreenNow() { - if (layoutTestController()->hasCustomFullScreenBehavior()) + if (testRunner()->hasCustomFullScreenBehavior()) return; webView()->willExitFullScreen(); diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h index 13f2e1ec5..94ed4cd8d 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.h +++ b/Tools/DumpRenderTree/chromium/WebViewHost.h @@ -47,7 +47,7 @@ #include <wtf/Vector.h> #include <wtf/text/WTFString.h> -class LayoutTestController; +class DRTTestRunner; class MockWebSpeechInputController; class MockWebSpeechRecognizer; class SkCanvas; @@ -264,6 +264,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, virtual void didRunInsecureContent(WebKit::WebFrame*, const WebKit::WebSecurityOrigin&, const WebKit::WebURL&); virtual void didDetectXSS(WebKit::WebFrame*, const WebKit::WebURL&, bool didBlockEntirePage); virtual void openFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, long long size, bool create, WebKit::WebFileSystemCallbacks*); + virtual void deleteFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, WebKit::WebFileSystemCallbacks*); virtual bool willCheckAndDispatchMessageEvent(WebKit::WebFrame* source, WebKit::WebSecurityOrigin target, WebKit::WebDOMMessageEvent); virtual void registerIntentService(WebKit::WebFrame*, const WebKit::WebIntentServiceInfo&); virtual void dispatchIntent(WebKit::WebFrame*, const WebKit::WebIntentRequest&); @@ -277,7 +278,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, void finishLastTextCheck(); virtual void fillSpellingSuggestionList(const WebKit::WebString& word, Vector<WebKit::WebString>* suggestions) OVERRIDE; - // Geolocation client mocks for LayoutTestController + // Geolocation client mocks for DRTTestRunner WebKit::WebGeolocationClientMock* geolocationClientMock(); // Pending task list, Note taht the method is referred from MethodTask class. @@ -302,7 +303,7 @@ private: CallbackMethodType m_callback; }; - LayoutTestController* layoutTestController() const; + DRTTestRunner* testRunner() const; // Called the title of the page changes. // Can be used to update the title of the window. |