diff options
Diffstat (limited to 'WebKitTools/DumpRenderTree')
18 files changed, 164 insertions, 20 deletions
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp index 52b539c..700b44c 100644 --- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp +++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp @@ -1545,6 +1545,20 @@ static JSValueRef numberOfActiveAnimationsCallback(JSContextRef context, JSObjec return JSValueMakeNumber(context, controller->numberOfActiveAnimations()); } +static JSValueRef suspendAnimationsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + controller->suspendAnimations(); + return JSValueMakeUndefined(context); +} + +static JSValueRef resumeAnimationsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + controller->resumeAnimations(); + return JSValueMakeUndefined(context); +} + static JSValueRef waitForPolicyDelegateCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t, const JSValueRef[], JSValueRef*) { LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); @@ -1850,6 +1864,8 @@ JSStaticFunction* LayoutTestController::staticFunctions() { "markerTextForListItem", markerTextForListItemCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "notifyDone", notifyDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "numberOfActiveAnimations", numberOfActiveAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "suspendAnimations", suspendAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "resumeAnimations", resumeAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "overridePreference", overridePreferenceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "pageNumberForElementById", pageNumberForElementByIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "pageSizeAndMarginsInPixels", pageSizeAndMarginsInPixelsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h index f76870b..2bab542 100644 --- a/WebKitTools/DumpRenderTree/LayoutTestController.h +++ b/WebKitTools/DumpRenderTree/LayoutTestController.h @@ -251,6 +251,8 @@ public: bool pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId); bool sampleSVGAnimationForElementAtTime(JSStringRef animationId, double time, JSStringRef elementId); unsigned numberOfActiveAnimations() const; + void suspendAnimations() const; + void resumeAnimations() const; void addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains); void removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains); diff --git a/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp index b05fe21..4736676 100644 --- a/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp +++ b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp @@ -84,11 +84,6 @@ WebCString DRTDevToolsAgent::injectedScriptSource() return webkit_support::GetDevToolsInjectedScriptSource(); } -WebCString DRTDevToolsAgent::injectedScriptDispatcherSource() -{ - return webkit_support::GetDevToolsInjectedScriptDispatcherSource(); -} - WebCString DRTDevToolsAgent::debuggerScriptSource() { return webkit_support::GetDevToolsDebuggerScriptSource(); diff --git a/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.h b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.h index df52866..899a23f 100644 --- a/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.h +++ b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.h @@ -62,7 +62,6 @@ public: virtual void forceRepaint(); virtual void runtimeFeatureStateChanged(const WebKit::WebString& feature, bool enabled); virtual WebKit::WebCString injectedScriptSource(); - virtual WebKit::WebCString injectedScriptDispatcherSource(); virtual WebKit::WebCString debuggerScriptSource(); void asyncCall(const DRTDevToolsCallArgs&); diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp index e82a65e..beae21e 100644 --- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp +++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp @@ -117,6 +117,8 @@ LayoutTestController::LayoutTestController(TestShell* shell) bindMethod("pauseTransitionAtTimeOnElementWithId", &LayoutTestController::pauseTransitionAtTimeOnElementWithId); bindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId); bindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations); + bindMethod("suspendAnimations", &LayoutTestController::suspendAnimations); + bindMethod("resumeAnimations", &LayoutTestController::resumeAnimations); bindMethod("disableImageLoading", &LayoutTestController::disableImageLoading); bindMethod("setIconDatabaseEnabled", &LayoutTestController::setIconDatabaseEnabled); bindMethod("setCustomPolicyDelegate", &LayoutTestController::setCustomPolicyDelegate); @@ -838,6 +840,32 @@ int LayoutTestController::numberOfActiveAnimations() return controller->numberOfActiveAnimations(); } +void LayoutTestController::suspendAnimations() +{ + WebFrame* webFrame = m_shell->webView()->mainFrame(); + if (!webFrame) + return; + + WebAnimationController* controller = webFrame->animationController(); + if (!controller) + return; + + controller->suspendAnimations(); +} + +void LayoutTestController::resumeAnimations() +{ + WebFrame* webFrame = m_shell->webView()->mainFrame(); + if (!webFrame) + return; + + WebAnimationController* controller = webFrame->animationController(); + if (!controller) + return; + + controller->resumeAnimations(); +} + void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result) { result->set(false); @@ -875,6 +903,18 @@ void LayoutTestController::numberOfActiveAnimations(const CppArgumentList&, CppV result->set(numberOfActiveAnimations()); } +void LayoutTestController::suspendAnimations(const CppArgumentList&, CppVariant* result) +{ + suspendAnimations(); + result->setNull(); +} + +void LayoutTestController::resumeAnimations(const CppArgumentList&, CppVariant* result) +{ + resumeAnimations(); + result->setNull(); +} + void LayoutTestController::disableImageLoading(const CppArgumentList&, CppVariant* result) { m_shell->webView()->settings()->setLoadsImagesAutomatically(false); diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h index fb91544..352e89f 100644 --- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h +++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h @@ -207,6 +207,8 @@ public: void pauseTransitionAtTimeOnElementWithId(const CppArgumentList&, CppVariant*); void elementDoesAutoCompleteForElementWithId(const CppArgumentList&, CppVariant*); void numberOfActiveAnimations(const CppArgumentList&, CppVariant*); + void suspendAnimations(const CppArgumentList&, CppVariant*); + void resumeAnimations(const CppArgumentList&, CppVariant*); void disableImageLoading(const CppArgumentList&, CppVariant*); @@ -395,6 +397,8 @@ private: bool pauseTransitionAtTimeOnElementWithId(const WebKit::WebString& propertyName, double time, const WebKit::WebString& elementId); bool elementDoesAutoCompleteForElementWithId(const WebKit::WebString&); int numberOfActiveAnimations(); + void suspendAnimations(); + void resumeAnimations(); // Used for test timeouts. ScopedRunnableMethodFactory<LayoutTestController> m_timeoutFactory; diff --git a/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp index fe70cab..0bf3802 100644 --- a/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp +++ b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp @@ -31,11 +31,12 @@ #include "config.h" #include "MockSpellCheck.h" -#include "public/WebString.h" #include <wtf/ASCIICType.h> #include <wtf/Assertions.h> +#include <wtf/text/WTFString.h> + +#include "public/WebString.h" -using namespace WebCore; using namespace WebKit; MockSpellCheck::MockSpellCheck() @@ -59,7 +60,7 @@ bool MockSpellCheck::spellCheckWord(const WebString& text, int* misspelledOffset // Convert to a String because we store String instances in // m_misspelledWords and WebString has no find(). - const String stringText(text.data(), text.length()); + const WTF::String stringText(text.data(), text.length()); // Extract the first possible English word from the given string. // The given string may include non-ASCII characters or numbers. So, we @@ -82,7 +83,7 @@ bool MockSpellCheck::spellCheckWord(const WebString& text, int* misspelledOffset // extracted word if this word is a known misspelled word. // (See the comment in MockSpellCheck::initializeIfNeeded() why we use a // misspelled-word table.) - String word = stringText.substring(wordOffset, wordLength); + WTF::String word = stringText.substring(wordOffset, wordLength); if (!m_misspelledWords.contains(word)) return true; @@ -137,7 +138,7 @@ bool MockSpellCheck::initializeIfNeeded() m_misspelledWords.clear(); for (size_t i = 0; i < arraysize(misspelledWords); ++i) - m_misspelledWords.add(String::fromUTF8(misspelledWords[i]), false); + m_misspelledWords.add(WTF::String::fromUTF8(misspelledWords[i]), false); // Mark as initialized to prevent this object from being initialized twice // or more. diff --git a/WebKitTools/DumpRenderTree/chromium/NotificationPresenter.cpp b/WebKitTools/DumpRenderTree/chromium/NotificationPresenter.cpp index 86903be..95353a7 100644 --- a/WebKitTools/DumpRenderTree/chromium/NotificationPresenter.cpp +++ b/WebKitTools/DumpRenderTree/chromium/NotificationPresenter.cpp @@ -31,36 +31,37 @@ #include "config.h" #include "NotificationPresenter.h" +#include <wtf/text/CString.h> +#include <wtf/text/WTFString.h> + #include "googleurl/src/gurl.h" #include "public/WebNotification.h" #include "public/WebNotificationPermissionCallback.h" #include "public/WebSecurityOrigin.h" #include "public/WebString.h" #include "public/WebURL.h" -#include <wtf/text/CString.h> -using namespace WebCore; using namespace WebKit; void NotificationPresenter::grantPermission(const WebString& origin) { // Make sure it's in the form of an origin. GURL url(origin); - m_allowedOrigins.add(String(url.GetOrigin().spec().c_str())); + m_allowedOrigins.add(WTF::String(url.GetOrigin().spec().c_str())); } // The output from all these methods matches what DumpRenderTree produces. bool NotificationPresenter::show(const WebNotification& notification) { if (!notification.replaceId().isEmpty()) { - String replaceId(notification.replaceId().data(), notification.replaceId().length()); + WTF::String replaceId(notification.replaceId().data(), notification.replaceId().length()); if (m_replacements.find(replaceId) != m_replacements.end()) printf("REPLACING NOTIFICATION %s\n", m_replacements.find(replaceId)->second.utf8().data()); WebString identifier = notification.isHTML() ? notification.url().spec().utf16() : notification.title(); - m_replacements.set(replaceId, String(identifier.data(), identifier.length())); + m_replacements.set(replaceId, WTF::String(identifier.data(), identifier.length())); } if (notification.isHTML()) { @@ -103,7 +104,7 @@ void NotificationPresenter::objectDestroyed(const WebKit::WebNotification& notif WebNotificationPresenter::Permission NotificationPresenter::checkPermission(const WebURL& url) { // Check with the layout test controller - String origin = String(static_cast<GURL>(url).GetOrigin().spec().c_str()); + WTF::String origin = WTF::String(static_cast<GURL>(url).GetOrigin().spec().c_str()); bool allowed = m_allowedOrigins.find(origin) != m_allowedOrigins.end(); return allowed ? WebNotificationPresenter::PermissionAllowed : WebNotificationPresenter::PermissionDenied; diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp index 64c20b0..7ea36e1 100644 --- a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp +++ b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp @@ -225,6 +225,8 @@ void TestShell::resetWebSettings(WebView& webView) #else settings->setEditingBehavior(WebSettings::EditingBehaviorWin); #endif + // FIXME: crbug.com/51879 + settings->setAcceleratedCompositingEnabled(false); } void TestShell::runFileTest(const TestParams& params) diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp index b0c1cba..db44a60 100644 --- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp +++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp @@ -52,6 +52,8 @@ bool webkit_web_frame_pause_animation(WebKitWebFrame* frame, const gchar* name, bool webkit_web_frame_pause_transition(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element); bool webkit_web_frame_pause_svg_animation(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element); unsigned int webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame); +void webkit_web_frame_suspend_animations(WebKitWebFrame* frame); +void webkit_web_frame_resume_animations(WebKitWebFrame* frame); void webkit_application_cache_set_maximum_size(unsigned long long size); unsigned int webkit_worker_thread_count(void); void webkit_white_list_access_from_origin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains); @@ -250,6 +252,15 @@ void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) SoupSession* session = webkit_get_default_session(); SoupCookieJar* jar = reinterpret_cast<SoupCookieJar*>(soup_session_get_feature(session, SOUP_TYPE_COOKIE_JAR)); + /* If the jar was not created - we create it on demand, i.e, just + in case we have HTTP requests - then we must create it here in + order to set the proper accept policy */ + if (!jar) { + jar = soup_cookie_jar_new(); + soup_session_add_feature(session, SOUP_SESSION_FEATURE(jar)); + g_object_unref(jar); + } + SoupCookieJarAcceptPolicy policy; if (alwaysAcceptCookies) @@ -620,6 +631,16 @@ unsigned LayoutTestController::numberOfActiveAnimations() const return webkit_web_frame_number_of_active_animations(mainFrame); } +void LayoutTestController::suspendAnimations() const +{ + webkit_web_frame_suspend_animations(mainFrame); +} + +void LayoutTestController::resumeAnimations() const +{ + webkit_web_frame_resume_animations(mainFrame); +} + void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value) { gchar* name = JSStringCopyUTF8CString(key); diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm index c0eb722..a85ac2e 100644 --- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm +++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm @@ -631,6 +631,16 @@ unsigned LayoutTestController::numberOfActiveAnimations() const return [mainFrame _numberOfActiveAnimations]; } +void LayoutTestController::suspendAnimations() const +{ + return [mainFrame _suspendAnimations]; +} + +void LayoutTestController::resumeAnimations() const +{ + return [mainFrame _resumeAnimations]; +} + void LayoutTestController::waitForPolicyDelegate() { setWaitToDump(true); diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp index c6c39b5..4a57d1d 100644 --- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp +++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp @@ -571,7 +571,7 @@ void DumpRenderTree::open(const QUrl& url) m_page->event(&ev); QWebSettings::clearMemoryCaches(); -#if !(defined(Q_WS_S60) && QT_VERSION <= QT_VERSION_CHECK(4, 6, 2)) +#if !(defined(Q_OS_SYMBIAN) && QT_VERSION <= QT_VERSION_CHECK(4, 6, 2)) QFontDatabase::removeAllApplicationFonts(); #endif #if defined(Q_WS_X11) diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp index e682fd0..74baf37 100644 --- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp +++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp @@ -484,6 +484,20 @@ unsigned LayoutTestController::numberOfActiveAnimations() const return DumpRenderTreeSupportQt::numberOfActiveAnimations(frame); } +void LayoutTestController::suspendAnimations() const +{ + QWebFrame* frame = m_drt->webPage()->mainFrame(); + Q_ASSERT(frame); + DumpRenderTreeSupportQt::suspendAnimations(frame); +} + +void LayoutTestController::resumeAnimations() const +{ + QWebFrame* frame = m_drt->webPage()->mainFrame(); + Q_ASSERT(frame); + DumpRenderTreeSupportQt::resumeAnimations(frame); +} + void LayoutTestController::disableImageLoading() { m_drt->webPage()->settings()->setAttribute(QWebSettings::AutoLoadImages, false); diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h index f9986b1..207e093 100644 --- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h +++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h @@ -167,6 +167,8 @@ public slots: bool elementDoesAutoCompleteForElementWithId(const QString& elementId); unsigned numberOfActiveAnimations() const; + void suspendAnimations() const; + void resumeAnimations() const; void addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains); void removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains); diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp index a1b72e1..67e5d4b 100644 --- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp +++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp @@ -1232,8 +1232,17 @@ RetainPtr<CFURLCacheRef> sharedCFURLCache() } #endif +static LONG WINAPI exceptionFilter(EXCEPTION_POINTERS*) +{ + fputs("#CRASHED\n", stderr); + fflush(stderr); + return EXCEPTION_CONTINUE_SEARCH; +} + int main(int argc, char* argv[]) { + ::SetUnhandledExceptionFilter(exceptionFilter); + leakChecking = false; _setmode(1, _O_BINARY); diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp index 31bc6ce..1ff88e5 100644 --- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp +++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp @@ -1060,6 +1060,24 @@ unsigned LayoutTestController::numberOfActiveAnimations() const return number; } +void LayoutTestController::suspendAnimations() const +{ + COMPtr<IWebFramePrivate> framePrivate(Query, frame); + if (!framePrivate) + return; + + framePrivate->suspendAnimations(); +} + +void LayoutTestController::resumeAnimations() const +{ + COMPtr<IWebFramePrivate> framePrivate(Query, frame); + if (!framePrivate) + return; + + framePrivate->resumeAnimations(); +} + static _bstr_t bstrT(JSStringRef jsString) { // The false parameter tells the _bstr_t constructor to adopt the BSTR we pass it. diff --git a/WebKitTools/DumpRenderTree/wscript b/WebKitTools/DumpRenderTree/wscript index 75d208f..4aaedb4 100644 --- a/WebKitTools/DumpRenderTree/wscript +++ b/WebKitTools/DumpRenderTree/wscript @@ -58,8 +58,8 @@ def build(bld): includes = ' '.join(include_paths), source = sources, target = 'DumpRenderTree', - uselib = 'JSCORE ICU WXWEBKIT WX ' + get_config(), + uselib = 'ICU WX ' + get_config(), libpath = [output_dir], - uselib_local = '', + uselib_local = 'jscore wxwebkit', install_path = output_dir) diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp index 7c80ff2..9fee1e3 100644 --- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp +++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp @@ -264,6 +264,16 @@ unsigned LayoutTestController::numberOfActiveAnimations() const return 0; } +void LayoutTestController::suspendAnimations() const +{ + // FIXME: implement +} + +void LayoutTestController::resumeAnimations() const +{ + // FIXME: implement +} + unsigned LayoutTestController::workerThreadCount() const { // FIXME: implement |