summaryrefslogtreecommitdiff
path: root/Tools/WebKitTestRunner
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-15 16:08:57 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-15 16:08:57 +0200
commit5466563f4b5b6b86523e3f89bb7f77e5b5270c78 (patch)
tree8caccf7cd03a15207cde3ba282c88bf132482a91 /Tools/WebKitTestRunner
parent33b26980cb24288b5a9f2590ccf32a949281bb79 (diff)
downloadqtwebkit-5466563f4b5b6b86523e3f89bb7f77e5b5270c78.tar.gz
Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)
WebKit update which introduces the QtWebKitWidgets module that contains the WK1 widgets based API. (In fact it renames QtWebKit to QtWebKitWidgets while we're working on completing the entire split as part of https://bugs.webkit.org/show_bug.cgi?id=99314
Diffstat (limited to 'Tools/WebKitTestRunner')
-rw-r--r--Tools/WebKitTestRunner/GeolocationProviderMock.cpp20
-rw-r--r--Tools/WebKitTestRunner/GeolocationProviderMock.h2
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl31
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarker.idl9
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarkerRange.idl9
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl267
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm6
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl59
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/GCController.idl13
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl316
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/TextInputController.idl16
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp58
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h5
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp7
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Target.pri10
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp61
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/TestRunner.h7
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp31
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h30
-rw-r--r--Tools/WebKitTestRunner/Target.pri2
-rw-r--r--Tools/WebKitTestRunner/TestController.cpp109
-rw-r--r--Tools/WebKitTestRunner/TestController.h17
-rw-r--r--Tools/WebKitTestRunner/TestInvocation.cpp50
-rw-r--r--Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp14
-rw-r--r--Tools/WebKitTestRunner/efl/main.cpp21
-rw-r--r--Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm10
-rw-r--r--Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp5
-rw-r--r--Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp4
-rw-r--r--Tools/WebKitTestRunner/qt/TestControllerQt.cpp5
-rw-r--r--Tools/WebKitTestRunner/qt/TestInvocationQt.cpp22
-rw-r--r--Tools/WebKitTestRunner/qt/main.cpp6
31 files changed, 724 insertions, 498 deletions
diff --git a/Tools/WebKitTestRunner/GeolocationProviderMock.cpp b/Tools/WebKitTestRunner/GeolocationProviderMock.cpp
index 5877c65f6..7fa0bdba9 100644
--- a/Tools/WebKitTestRunner/GeolocationProviderMock.cpp
+++ b/Tools/WebKitTestRunner/GeolocationProviderMock.cpp
@@ -58,9 +58,13 @@ GeolocationProviderMock::GeolocationProviderMock(WKContextRef context)
WKGeolocationManagerSetProvider(m_geolocationManager, &providerCallback);
}
-void GeolocationProviderMock::setPosition(double latitude, double longitude, double accuracy)
+void GeolocationProviderMock::setPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed)
{
- m_position.adopt(WKGeolocationPositionCreate(currentTime(), latitude, longitude, accuracy));
+ m_position.adopt(WKGeolocationPositionCreate_b(currentTime(), latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed));
+
+ m_hasError = false;
+ m_errorMessage.clear();
+
sendPositionIfNeeded();
}
@@ -68,6 +72,9 @@ void GeolocationProviderMock::setPositionUnavailableError(WKStringRef errorMessa
{
m_errorMessage = errorMessage;
m_hasError = true;
+
+ m_position.clear();
+
sendErrorIfNeeded();
}
@@ -89,19 +96,14 @@ void GeolocationProviderMock::stopUpdating(WKGeolocationManagerRef geolocationMa
void GeolocationProviderMock::sendPositionIfNeeded()
{
- if (m_isActive && m_position) {
+ if (m_isActive && m_position)
WKGeolocationManagerProviderDidChangePosition(m_geolocationManager, m_position.get());
- m_position.clear();
- }
}
void GeolocationProviderMock::sendErrorIfNeeded()
{
- if (m_isActive && m_hasError) {
- m_hasError = false;
+ if (m_isActive && m_hasError)
WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage(m_geolocationManager, m_errorMessage.get());
- m_errorMessage.clear();
- }
}
} // namespace WTR
diff --git a/Tools/WebKitTestRunner/GeolocationProviderMock.h b/Tools/WebKitTestRunner/GeolocationProviderMock.h
index 4a06f08f9..1ebf67d1b 100644
--- a/Tools/WebKitTestRunner/GeolocationProviderMock.h
+++ b/Tools/WebKitTestRunner/GeolocationProviderMock.h
@@ -34,7 +34,7 @@ class GeolocationProviderMock {
public:
GeolocationProviderMock(WKContextRef);
- void setPosition(double latitude, double longitude, double accuracy);
+ void setPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed);
void setPositionUnavailableError(WKStringRef errorMessage);
void startUpdating(WKGeolocationManagerRef);
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl
index bd05f1334..005ec8194 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl
@@ -23,22 +23,19 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-module WTR {
+interface AccessibilityController {
+ readonly attribute AccessibilityUIElement rootElement;
+ readonly attribute AccessibilityUIElement focusedElement;
+ AccessibilityUIElement elementAtPoint(in int x, in int y);
+ AccessibilityUIElement accessibleElementById(in DOMString id);
+
+ boolean addNotificationListener(in object functionCallback);
+ boolean removeNotificationListener();
- interface AccessibilityController {
- readonly attribute AccessibilityUIElement rootElement;
- readonly attribute AccessibilityUIElement focusedElement;
- AccessibilityUIElement elementAtPoint(in int x, in int y);
- AccessibilityUIElement accessibleElementById(in DOMString id);
-
- boolean addNotificationListener(in object functionCallback);
- boolean removeNotificationListener();
+ void logFocusEvents();
+ void logValueChangeEvents();
+ void logScrollingStartEvents();
+ void logAccessibilityEvents();
+ void resetToConsistentState();
+};
- void logFocusEvents();
- void logValueChangeEvents();
- void logScrollingStartEvents();
- void logAccessibilityEvents();
- void resetToConsistentState();
- };
-
-}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarker.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarker.idl
index 885584815..192fffc73 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarker.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarker.idl
@@ -23,10 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-module WTR {
+interface AccessibilityTextMarker {
+ boolean isEqual(in AccessibilityTextMarker otherMarker);
+};
- interface AccessibilityTextMarker {
- boolean isEqual(in AccessibilityTextMarker otherMarker);
- };
-
-}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarkerRange.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarkerRange.idl
index 6c2b60e57..a63a67216 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarkerRange.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarkerRange.idl
@@ -23,10 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-module WTR {
+interface AccessibilityTextMarkerRange {
+ boolean isEqual(in AccessibilityTextMarkerRange otherMarkerRange);
+};
- interface AccessibilityTextMarkerRange {
- boolean isEqual(in AccessibilityTextMarkerRange otherMarkerRange);
- };
-
-}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
index 312a1e328..96d8c6269 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
@@ -23,151 +23,148 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-module WTR {
+interface AccessibilityUIElement {
+ boolean isEqual(in AccessibilityUIElement otherElement);
- interface AccessibilityUIElement {
- boolean isEqual(in AccessibilityUIElement otherElement);
+ // Document information
+ readonly attribute DOMString documentEncoding;
+ readonly attribute DOMString documentURI;
- // Document information
- readonly attribute DOMString documentEncoding;
- readonly attribute DOMString documentURI;
-
- // Element access.
- AccessibilityUIElement elementAtPoint(in int x, in int y);
- AccessibilityUIElement childAtIndex(in unsigned long index);
- unsigned long indexOfChild(in AccessibilityUIElement child);
- AccessibilityUIElement linkedUIElementAtIndex(in unsigned long index);
- AccessibilityUIElement selectedChildAtIndex(in unsigned long index);
- void setSelectedChild(in AccessibilityUIElement element);
- AccessibilityUIElement titleUIElement();
- AccessibilityUIElement parentElement();
-
- readonly attribute DOMString role;
- readonly attribute DOMString subrole;
- readonly attribute DOMString roleDescription;
- readonly attribute DOMString title;
- readonly attribute DOMString description;
- readonly attribute DOMString language;
- readonly attribute DOMString helpText;
- readonly attribute DOMString valueDescription;
- readonly attribute DOMString url;
- readonly attribute DOMString speak;
- readonly attribute DOMString orientation;
- readonly attribute int insertionPointLineNumber;
- readonly attribute DOMString selectedTextRange;
+ // Element access.
+ AccessibilityUIElement elementAtPoint(in int x, in int y);
+ AccessibilityUIElement childAtIndex(in unsigned long index);
+ unsigned long indexOfChild(in AccessibilityUIElement child);
+ AccessibilityUIElement linkedUIElementAtIndex(in unsigned long index);
+ AccessibilityUIElement selectedChildAtIndex(in unsigned long index);
+ void setSelectedChild(in AccessibilityUIElement element);
+ AccessibilityUIElement titleUIElement();
+ AccessibilityUIElement parentElement();
- DOMString stringAttributeValue(in DOMString attr);
- double numberAttributeValue(in DOMString attr);
- AccessibilityUIElement uiElementAttributeValue(in DOMString attr);
- boolean boolAttributeValue(in DOMString attr);
- boolean isAttributeSupported(in DOMString attr);
- boolean isAttributeSettable(in DOMString attr);
- boolean isActionSupported(in DOMString attr);
+ readonly attribute DOMString role;
+ readonly attribute DOMString subrole;
+ readonly attribute DOMString roleDescription;
+ readonly attribute DOMString title;
+ readonly attribute DOMString description;
+ readonly attribute DOMString language;
+ readonly attribute DOMString helpText;
+ readonly attribute DOMString valueDescription;
+ readonly attribute DOMString url;
+ readonly attribute DOMString speak;
+ readonly attribute DOMString orientation;
+ readonly attribute int insertionPointLineNumber;
+ readonly attribute DOMString selectedTextRange;
+
+ DOMString stringAttributeValue(in DOMString attr);
+ double numberAttributeValue(in DOMString attr);
+ AccessibilityUIElement uiElementAttributeValue(in DOMString attr);
+ boolean boolAttributeValue(in DOMString attr);
+ boolean isAttributeSupported(in DOMString attr);
+ boolean isAttributeSettable(in DOMString attr);
+ boolean isActionSupported(in DOMString attr);
- readonly attribute DOMString stringValue;
- readonly attribute int intValue;
- readonly attribute int minValue;
- readonly attribute int maxValue;
-
- readonly attribute boolean isEnabled;
- readonly attribute boolean isRequired;
- readonly attribute boolean isFocused;
- readonly attribute boolean isFocusable;
- readonly attribute boolean isSelected;
- readonly attribute boolean isMultiSelectable;
- readonly attribute boolean isExpanded;
- readonly attribute boolean isChecked;
- readonly attribute boolean isVisible;
- readonly attribute boolean isCollapsed;
- readonly attribute boolean hasPopup;
- readonly attribute boolean isIgnored;
- readonly attribute boolean isOffScreen;
- readonly attribute boolean isValid;
- readonly attribute int hierarchicalLevel;
- readonly attribute boolean ariaIsGrabbed;
- readonly attribute DOMString ariaDropEffects;
-
- readonly attribute int x;
- readonly attribute int y;
- readonly attribute int width;
- readonly attribute int height;
- readonly attribute int clickPointX;
- readonly attribute int clickPointY;
+ readonly attribute DOMString stringValue;
+ readonly attribute int intValue;
+ readonly attribute int minValue;
+ readonly attribute int maxValue;
+
+ readonly attribute boolean isEnabled;
+ readonly attribute boolean isRequired;
+ readonly attribute boolean isFocused;
+ readonly attribute boolean isFocusable;
+ readonly attribute boolean isSelected;
+ readonly attribute boolean isMultiSelectable;
+ readonly attribute boolean isExpanded;
+ readonly attribute boolean isChecked;
+ readonly attribute boolean isVisible;
+ readonly attribute boolean isCollapsed;
+ readonly attribute boolean hasPopup;
+ readonly attribute boolean isIgnored;
+ readonly attribute boolean isOffScreen;
+ readonly attribute boolean isValid;
+ readonly attribute int hierarchicalLevel;
+ readonly attribute boolean ariaIsGrabbed;
+ readonly attribute DOMString ariaDropEffects;
+
+ readonly attribute int x;
+ readonly attribute int y;
+ readonly attribute int width;
+ readonly attribute int height;
+ readonly attribute int clickPointX;
+ readonly attribute int clickPointY;
- readonly attribute int childrenCount;
- readonly attribute int selectedChildrenCount;
- readonly attribute int rowCount;
- readonly attribute int columnCount;
+ readonly attribute int childrenCount;
+ readonly attribute int selectedChildrenCount;
+ readonly attribute int rowCount;
+ readonly attribute int columnCount;
- // Actions.
- void increment();
- void decrement();
- void press();
- void showMenu();
+ // Actions.
+ void increment();
+ void decrement();
+ void press();
+ void showMenu();
- // Attribute info.
- DOMString allAttributes();
- DOMString attributesOfChildren();
- DOMString attributesOfLinkedUIElements();
- DOMString attributesOfDocumentLinks();
-
- // Table info.
- DOMString attributesOfColumnHeaders();
- DOMString attributesOfRowHeaders();
- DOMString attributesOfColumns();
- DOMString attributesOfRows();
- DOMString attributesOfVisibleCells();
- DOMString attributesOfHeader();
- AccessibilityUIElement cellForColumnAndRow(in unsigned long column, in unsigned long row);
- AccessibilityUIElement selectedRowAtIndex(in unsigned long index);
- AccessibilityUIElement disclosedByRow();
- AccessibilityUIElement disclosedRowAtIndex(in unsigned long index);
- AccessibilityUIElement rowAtIndex(in unsigned long index);
- int indexInTable();
- DOMString rowIndexRange();
- DOMString columnIndexRange();
- int rowCount();
- int columnCount();
+ // Attribute info.
+ DOMString allAttributes();
+ DOMString attributesOfChildren();
+ DOMString attributesOfLinkedUIElements();
+ DOMString attributesOfDocumentLinks();
- AccessibilityUIElement ariaOwnsElementAtIndex(in unsigned long index);
- AccessibilityUIElement ariaFlowToElementAtIndex(in unsigned long index);
+ // Table info.
+ DOMString attributesOfColumnHeaders();
+ DOMString attributesOfRowHeaders();
+ DOMString attributesOfColumns();
+ DOMString attributesOfRows();
+ DOMString attributesOfVisibleCells();
+ DOMString attributesOfHeader();
+ AccessibilityUIElement cellForColumnAndRow(in unsigned long column, in unsigned long row);
+ AccessibilityUIElement selectedRowAtIndex(in unsigned long index);
+ AccessibilityUIElement disclosedByRow();
+ AccessibilityUIElement disclosedRowAtIndex(in unsigned long index);
+ AccessibilityUIElement rowAtIndex(in unsigned long index);
+ int indexInTable();
+ DOMString rowIndexRange();
+ DOMString columnIndexRange();
+ int rowCount();
+ int columnCount();
+
+ AccessibilityUIElement ariaOwnsElementAtIndex(in unsigned long index);
+ AccessibilityUIElement ariaFlowToElementAtIndex(in unsigned long index);
- // Paramaterized attributes.
- DOMString parameterizedAttributeNames();
- int lineForIndex(in int index);
- DOMString rangeForLine(in int index);
- DOMString rangeForPosition(in int x, in int y);
- DOMString boundsForRange(in unsigned long location, in unsigned long length);
- DOMString stringForRange(in unsigned long location, in unsigned long length);
- DOMString attributedStringForRange(in unsigned long location, in unsigned long length);
- boolean attributedStringRangeIsMisspelled(in unsigned long location, in unsigned long length);
- AccessibilityUIElement uiElementForSearchPredicate(in AccessibilityUIElement startElement, in boolean isDirectionNext, in DOMString searchKey, in DOMString searchText);
- void setSelectedTextRange(in unsigned long location, in unsigned long length);
+ // Paramaterized attributes.
+ DOMString parameterizedAttributeNames();
+ int lineForIndex(in int index);
+ DOMString rangeForLine(in int index);
+ DOMString rangeForPosition(in int x, in int y);
+ DOMString boundsForRange(in unsigned long location, in unsigned long length);
+ DOMString stringForRange(in unsigned long location, in unsigned long length);
+ DOMString attributedStringForRange(in unsigned long location, in unsigned long length);
+ boolean attributedStringRangeIsMisspelled(in unsigned long location, in unsigned long length);
+ AccessibilityUIElement uiElementForSearchPredicate(in AccessibilityUIElement startElement, in boolean isDirectionNext, in DOMString searchKey, in DOMString searchText);
+ void setSelectedTextRange(in unsigned long location, in unsigned long length);
- // Scroll area attributes.
- readonly attribute AccessibilityUIElement horizontalScrollbar;
- readonly attribute AccessibilityUIElement verticalScrollbar;
+ // Scroll area attributes.
+ readonly attribute AccessibilityUIElement horizontalScrollbar;
+ readonly attribute AccessibilityUIElement verticalScrollbar;
- // Text markers.
- AccessibilityTextMarkerRange textMarkerRangeForElement(in AccessibilityUIElement element);
- AccessibilityTextMarkerRange textMarkerRangeForMarkers(in AccessibilityTextMarker startMarker, in AccessibilityTextMarker endMarker);
- AccessibilityTextMarker startTextMarkerForTextMarkerRange(in AccessibilityTextMarkerRange range);
- AccessibilityTextMarker endTextMarkerForTextMarkerRange(in AccessibilityTextMarkerRange range);
- AccessibilityTextMarker textMarkerForPoint(in int x, in int y);
- AccessibilityTextMarker previousTextMarker(in AccessibilityTextMarker marker);
- AccessibilityTextMarker nextTextMarker(in AccessibilityTextMarker marker);
- AccessibilityUIElement accessibilityElementForTextMarker(in AccessibilityTextMarker marker);
- DOMString stringForTextMarkerRange(in AccessibilityTextMarkerRange range);
- int textMarkerRangeLength(in AccessibilityTextMarkerRange range);
- boolean attributedStringForTextMarkerRangeContainsAttribute(in DOMString attr, in AccessibilityTextMarkerRange range);
- int indexForTextMarker(in AccessibilityTextMarker marker);
- boolean isTextMarkerValid(in AccessibilityTextMarker marker);
- AccessibilityTextMarker textMarkerForIndex(in int textIndex);
+ // Text markers.
+ AccessibilityTextMarkerRange textMarkerRangeForElement(in AccessibilityUIElement element);
+ AccessibilityTextMarkerRange textMarkerRangeForMarkers(in AccessibilityTextMarker startMarker, in AccessibilityTextMarker endMarker);
+ AccessibilityTextMarker startTextMarkerForTextMarkerRange(in AccessibilityTextMarkerRange range);
+ AccessibilityTextMarker endTextMarkerForTextMarkerRange(in AccessibilityTextMarkerRange range);
+ AccessibilityTextMarker textMarkerForPoint(in int x, in int y);
+ AccessibilityTextMarker previousTextMarker(in AccessibilityTextMarker marker);
+ AccessibilityTextMarker nextTextMarker(in AccessibilityTextMarker marker);
+ AccessibilityUIElement accessibilityElementForTextMarker(in AccessibilityTextMarker marker);
+ DOMString stringForTextMarkerRange(in AccessibilityTextMarkerRange range);
+ int textMarkerRangeLength(in AccessibilityTextMarkerRange range);
+ boolean attributedStringForTextMarkerRangeContainsAttribute(in DOMString attr, in AccessibilityTextMarkerRange range);
+ int indexForTextMarker(in AccessibilityTextMarker marker);
+ boolean isTextMarkerValid(in AccessibilityTextMarker marker);
+ AccessibilityTextMarker textMarkerForIndex(in int textIndex);
- // Notification support.
- boolean addNotificationListener(in object callbackFunction);
- boolean removeNotificationListener();
-
- };
+ // Notification support.
+ boolean addNotificationListener(in object callbackFunction);
+ boolean removeNotificationListener();
+
+};
-}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm b/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm
index f2da64036..4429283e8 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm
@@ -465,7 +465,11 @@ sub _platformTypeVariableDeclaration
);
my $nullValue = "0";
- $nullValue = "$platformType()" if defined $nonPointerTypes{$platformType} && $platformType ne "double";
+ if ($platformType eq "JSValueRef") {
+ $nullValue = "JSValueMakeUndefined(context)";
+ } elsif (defined $nonPointerTypes{$platformType} && $platformType ne "double") {
+ $nullValue = "$platformType()";
+ }
$platformType .= "*" unless defined $nonPointerTypes{$platformType};
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl
index cff75f2c2..52a7a5b62 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl
@@ -23,41 +23,38 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-module WTR {
+interface EventSendingController {
+ void mouseDown(in long buttonNumber, in object modifierArray);
+ void mouseUp(in long buttonNumber, in object modifierArray);
+ void mouseMoveTo(in long x, in long y);
+ void mouseScrollBy(in long x, in long y);
+ void continuousMouseScrollBy(in long x, in long y, in [Optional] boolean paged);
+ void scheduleAsynchronousClick();
- interface EventSendingController {
- void mouseDown(in long buttonNumber, in object modifierArray);
- void mouseUp(in long buttonNumber, in object modifierArray);
- void mouseMoveTo(in long x, in long y);
- void mouseScrollBy(in long x, in long y);
- void continuousMouseScrollBy(in long x, in long y, in [Optional] boolean paged);
- void scheduleAsynchronousClick();
+ void leapForward(in long milliseconds);
- void leapForward(in long milliseconds);
+ void keyDown(in DOMString key, in object modifierArray, in long location);
- void keyDown(in DOMString key, in object modifierArray, in long location);
-
- // Zoom functions.
- void textZoomIn();
- void textZoomOut();
- void zoomPageIn();
- void zoomPageOut();
- void scalePageBy(in double scale, in double x, in double y);
+ // Zoom functions.
+ void textZoomIn();
+ void textZoomOut();
+ void zoomPageIn();
+ void zoomPageOut();
+ void scalePageBy(in double scale, in double x, in double y);
#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
- // Touch events.
- void addTouchPoint(in long x, in long y);
- void updateTouchPoint(in long index, in long x, in long y);
- void setTouchModifier(in DOMString modifier, in boolean enable);
- void setTouchPointRadius(in long radiusX, in long radiusY);
- void touchStart();
- void touchMove();
- void touchEnd();
- void touchCancel();
- void clearTouchPoints();
- void releaseTouchPoint(in long index);
- void cancelTouchPoint(in long index);
+ // Touch events.
+ void addTouchPoint(in long x, in long y);
+ void updateTouchPoint(in long index, in long x, in long y);
+ void setTouchModifier(in DOMString modifier, in boolean enable);
+ void setTouchPointRadius(in long radiusX, in long radiusY);
+ void touchStart();
+ void touchMove();
+ void touchEnd();
+ void touchCancel();
+ void clearTouchPoints();
+ void releaseTouchPoint(in long index);
+ void cancelTouchPoint(in long index);
#endif
- };
+};
-}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/GCController.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/GCController.idl
index eb3ddee7a..6c13b71ac 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/GCController.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/GCController.idl
@@ -23,12 +23,9 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-module WTR {
+interface GCController {
+ void collect();
+ void collectOnAlternateThread(in boolean waitUntilDone);
+ unsigned long long getJSObjectCount();
+};
- interface GCController {
- void collect();
- void collectOnAlternateThread(in boolean waitUntilDone);
- unsigned long long getJSObjectCount();
- };
-
-}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
index 6efd78e32..3a764e7ca 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
@@ -23,167 +23,163 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-module WTR {
-
- interface TestRunner {
- // The basics.
- void dumpAsText(in boolean dumpPixels);
- void dumpChildFramesAsText();
- void waitForPolicyDelegate();
- void waitUntilDone();
- void notifyDone();
- double preciseTime();
-
- // Other dumping.
- void dumpBackForwardList();
- void dumpChildFrameScrollPositions();
- void dumpEditingCallbacks();
- void dumpSelectionRect();
- void dumpStatusCallbacks();
- void dumpTitleChanges();
- void dumpFullScreenCallbacks();
- void dumpFrameLoadCallbacks();
- void dumpProgressFinishedCallback();
- void dumpResourceLoadCallbacks();
- void dumpResourceResponseMIMETypes();
- void dumpWillCacheResponse();
- void dumpApplicationCacheDelegateCallbacks();
- void dumpDatabaseCallbacks();
-
- // Special options.
- void keepWebHistory();
- void setAcceptsEditing(in boolean value);
- void setCanOpenWindows(in boolean value);
- void setCloseRemainingWindowsWhenComplete(in boolean value);
- void setXSSAuditorEnabled(in boolean value);
- void setAllowUniversalAccessFromFileURLs(in boolean value);
- void setAllowFileAccessFromFileURLs(in boolean value);
- void setFrameFlatteningEnabled(in boolean value);
- void setPluginsEnabled(in boolean value);
- void setJavaScriptCanAccessClipboard(in boolean value);
- void setPrivateBrowsingEnabled(in boolean value);
- void setPopupBlockingEnabled(in boolean value);
- void setAuthorAndUserStylesEnabled(in boolean value);
- void setCustomPolicyDelegate(in boolean enabled, in boolean permissive);
- void addOriginAccessWhitelistEntry(in DOMString sourceOrigin, in DOMString destinationProtocol, in DOMString destinationHost, in boolean allowDestinationSubdomains);
- void removeOriginAccessWhitelistEntry(in DOMString sourceOrigin, in DOMString destinationProtocol, in DOMString destinationHost, in boolean allowDestinationSubdomains);
- void setUserStyleSheetEnabled(in boolean value);
- void setUserStyleSheetLocation(in DOMString location);
- void setMinimumTimerInterval(in double interval); // Interval specified in seconds.
- void setSpatialNavigationEnabled(in boolean value);
- void setTabKeyCyclesThroughElements(in boolean enabled);
-
- // Special DOM functions.
- void clearBackForwardList();
- object computedStyleIncludingVisitedInfo(in object element);
- void execCommand(in DOMString name, in DOMString argument);
- boolean isCommandEnabled(in DOMString name);
- DOMString markerTextForListItem(in object element);
- unsigned long windowCount();
-
- // Special DOM variables.
- attribute boolean globalFlag;
- readonly attribute unsigned long workerThreadCount;
-
- // Repaint testing.
- void testRepaint();
- void repaintSweepHorizontally();
- void display();
-
- // Printing
- boolean isPageBoxVisible(in int pageIndex);
-
- [PassContext] void setValueForUser(in object element, in DOMString value);
-
- // Animation testing.
- int numberOfActiveAnimations();
- boolean pauseAnimationAtTimeOnElementWithId(in DOMString animationName, in double time, in DOMString elementId);
- boolean pauseTransitionAtTimeOnElementWithId(in DOMString propertyName, in double time, in DOMString elementId);
- void suspendAnimations();
-
- // UserContent testing.
- void addUserScript(in DOMString source, in boolean runAtStart, in boolean allFrames);
- void addUserStyleSheet(in DOMString source, in boolean allFrames);
-
- // Local storage API
- void clearAllDatabases();
- void setDatabaseQuota(in unsigned long long quota);
- DOMString pathToLocalResource(in DOMString url);
-
- // Application Cache API
- void clearAllApplicationCaches();
- void setAppCacheMaximumSize(in unsigned long long size);
- long long applicationCacheDiskUsageForOrigin(in DOMString origin);
- void clearApplicationCacheForOrigin(in DOMString name);
- void setApplicationCacheOriginQuota(in unsigned long long bytes);
- void disallowIncreaseForApplicationCacheQuota();
- object originsWithApplicationCache();
-
- // Compositing testing.
- DOMString layerTreeAsText();
-
- // Text search testing.
- boolean findString(in DOMString target, in object optionsArray);
-
- // Evaluating script in a special context.
- [PassContext] void evaluateScriptInIsolatedWorld(in unsigned long worldID, in DOMString script);
-
- // For Web Inspector tests
- void showWebInspector();
- void closeWebInspector();
- void evaluateInWebInspector(in long callID, in DOMString script);
-
- void setPOSIXLocale(in DOMString locale);
-
- void setTextDirection(in DOMString direction);
-
- void setWillSendRequestReturnsNull(in boolean flag);
- void setWillSendRequestReturnsNullOnRedirect(in boolean flag);
-
- void setShouldStayOnPageAfterHandlingBeforeUnload(in boolean flag);
-
- void setDefersLoading(in boolean flag);
- void setStopProvisionalFrameLoads();
-
- // Web intents testing.
- void sendWebIntentResponse(in DOMString reply);
- void deliverWebIntent(in DOMString action, in DOMString type, in DOMString data);
-
- // Focus testing.
- void addChromeInputField(in object callback);
- void removeChromeInputField(in object callback);
- void focusWebView(in object callback);
-
- void setBackingScaleFactor(in double backingScaleFactor, in object callback);
-
- void setWindowIsKey(in boolean isKey);
-
- // Cookies testing
- void setAlwaysAcceptCookies(in boolean accept);
-
- void overridePreference(in DOMString preference, in DOMString value);
-
- // Page Visibility API
- void setPageVisibility(in DOMString state);
- void resetPageVisibility();
-
- readonly attribute DOMString platformName;
+interface TestRunner {
+ // The basics.
+ void dumpAsText(in boolean dumpPixels);
+ void dumpChildFramesAsText();
+ void waitForPolicyDelegate();
+ void waitUntilDone();
+ void notifyDone();
+ double preciseTime();
+
+ // Other dumping.
+ void dumpBackForwardList();
+ void dumpChildFrameScrollPositions();
+ void dumpEditingCallbacks();
+ void dumpSelectionRect();
+ void dumpStatusCallbacks();
+ void dumpTitleChanges();
+ void dumpFullScreenCallbacks();
+ void dumpFrameLoadCallbacks();
+ void dumpProgressFinishedCallback();
+ void dumpResourceLoadCallbacks();
+ void dumpResourceResponseMIMETypes();
+ void dumpWillCacheResponse();
+ void dumpApplicationCacheDelegateCallbacks();
+ void dumpDatabaseCallbacks();
+
+ // Special options.
+ void keepWebHistory();
+ void setAcceptsEditing(in boolean value);
+ void setCanOpenWindows(in boolean value);
+ void setCloseRemainingWindowsWhenComplete(in boolean value);
+ void setXSSAuditorEnabled(in boolean value);
+ void setAllowUniversalAccessFromFileURLs(in boolean value);
+ void setAllowFileAccessFromFileURLs(in boolean value);
+ void setFrameFlatteningEnabled(in boolean value);
+ void setPluginsEnabled(in boolean value);
+ void setJavaScriptCanAccessClipboard(in boolean value);
+ void setPrivateBrowsingEnabled(in boolean value);
+ void setPopupBlockingEnabled(in boolean value);
+ void setAuthorAndUserStylesEnabled(in boolean value);
+ void setCustomPolicyDelegate(in boolean enabled, in boolean permissive);
+ void addOriginAccessWhitelistEntry(in DOMString sourceOrigin, in DOMString destinationProtocol, in DOMString destinationHost, in boolean allowDestinationSubdomains);
+ void removeOriginAccessWhitelistEntry(in DOMString sourceOrigin, in DOMString destinationProtocol, in DOMString destinationHost, in boolean allowDestinationSubdomains);
+ void setUserStyleSheetEnabled(in boolean value);
+ void setUserStyleSheetLocation(in DOMString location);
+ void setMinimumTimerInterval(in double interval); // Interval specified in seconds.
+ void setSpatialNavigationEnabled(in boolean value);
+ void setTabKeyCyclesThroughElements(in boolean enabled);
+ void setSerializeHTTPLoads();
+ void dispatchPendingLoadRequests();
+
+ // Special DOM functions.
+ void clearBackForwardList();
+ object computedStyleIncludingVisitedInfo(in object element);
+ void execCommand(in DOMString name, in DOMString argument);
+ boolean isCommandEnabled(in DOMString name);
+ DOMString markerTextForListItem(in object element);
+ unsigned long windowCount();
+
+ // Special DOM variables.
+ attribute boolean globalFlag;
+ readonly attribute unsigned long workerThreadCount;
+
+ // Repaint testing.
+ void testRepaint();
+ void repaintSweepHorizontally();
+ void display();
+
+ // Printing
+ boolean isPageBoxVisible(in int pageIndex);
+
+ [PassContext] void setValueForUser(in object element, in DOMString value);
+
+ // Animation testing.
+ int numberOfActiveAnimations();
+ boolean pauseAnimationAtTimeOnElementWithId(in DOMString animationName, in double time, in DOMString elementId);
+ boolean pauseTransitionAtTimeOnElementWithId(in DOMString propertyName, in double time, in DOMString elementId);
+ void suspendAnimations();
+
+ // UserContent testing.
+ void addUserScript(in DOMString source, in boolean runAtStart, in boolean allFrames);
+ void addUserStyleSheet(in DOMString source, in boolean allFrames);
+
+ // Local storage API
+ void clearAllDatabases();
+ void setDatabaseQuota(in unsigned long long quota);
+ DOMString pathToLocalResource(in DOMString url);
+
+ // Application Cache API
+ void clearAllApplicationCaches();
+ void setAppCacheMaximumSize(in unsigned long long size);
+ long long applicationCacheDiskUsageForOrigin(in DOMString origin);
+ void clearApplicationCacheForOrigin(in DOMString name);
+ void setApplicationCacheOriginQuota(in unsigned long long bytes);
+ void disallowIncreaseForApplicationCacheQuota();
+ object originsWithApplicationCache();
+
+ // Text search testing.
+ boolean findString(in DOMString target, in object optionsArray);
+
+ // Evaluating script in a special context.
+ [PassContext] void evaluateScriptInIsolatedWorld(in unsigned long worldID, in DOMString script);
+
+ // For Web Inspector tests
+ void showWebInspector();
+ void closeWebInspector();
+ void evaluateInWebInspector(in long callID, in DOMString script);
+
+ void setPOSIXLocale(in DOMString locale);
+
+ void setTextDirection(in DOMString direction);
+
+ void setWillSendRequestReturnsNull(in boolean flag);
+ void setWillSendRequestReturnsNullOnRedirect(in boolean flag);
+
+ void setShouldStayOnPageAfterHandlingBeforeUnload(in boolean flag);
+
+ void setDefersLoading(in boolean flag);
+ void setStopProvisionalFrameLoads();
+
+ // Web intents testing.
+ void sendWebIntentResponse(in DOMString reply);
+ void deliverWebIntent(in DOMString action, in DOMString type, in DOMString data);
+
+ // Focus testing.
+ void addChromeInputField(in object callback);
+ void removeChromeInputField(in object callback);
+ void focusWebView(in object callback);
+
+ void setBackingScaleFactor(in double backingScaleFactor, in object callback);
+
+ void setWindowIsKey(in boolean isKey);
+
+ // Cookies testing
+ void setAlwaysAcceptCookies(in boolean accept);
+
+ void overridePreference(in DOMString preference, in DOMString value);
+
+ // Page Visibility API
+ void setPageVisibility(in DOMString state);
+ void resetPageVisibility();
+
+ readonly attribute DOMString platformName;
+
+ // Control full screen behavior.
+ void setHasCustomFullScreenBehavior(in boolean value);
- // Control full screen behavior.
- void setHasCustomFullScreenBehavior(in boolean value);
+ // Web notifications support
+ void grantWebNotificationPermission(in DOMString origin);
+ void denyWebNotificationPermission(in DOMString origin);
+ void removeAllWebNotificationPermissions();
+ void simulateWebNotificationClick(in object notification);
- // Web notifications support
- void grantWebNotificationPermission(in DOMString origin);
- void denyWebNotificationPermission(in DOMString origin);
- void removeAllWebNotificationPermissions();
- void simulateWebNotificationClick(in object notification);
+ // Geolocation
+ void setGeolocationPermission(in boolean value);
+ void setMockGeolocationPosition(in double latitude, in double longitude, in double accuracy, in [Optional=DefaultIsUndefined] object altitude, in [Optional] object altitudeAccuracy, in [Optional] object heading, in [Optional] object speed);
+ void setMockGeolocationPositionUnavailableError(in DOMString errorMessage);
- // Geolocation
- void setGeolocationPermission(in boolean value);
- void setMockGeolocationPosition(in double latitude, in double longitude, in double accuracy);
- void setMockGeolocationPositionUnavailableError(in DOMString errorMessage);
+ boolean callShouldCloseOnWebView();
+};
- boolean callShouldCloseOnWebView();
- };
-
-}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TextInputController.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TextInputController.idl
index ceb3a004e..039988af0 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TextInputController.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TextInputController.idl
@@ -23,14 +23,10 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-module WTR {
-
- interface TextInputController {
- void setMarkedText(in DOMString string, in long from, in long length);
- boolean hasMarkedText();
- void unmarkText();
- void insertText(in DOMString string);
- };
-
-}
+interface TextInputController {
+ void setMarkedText(in DOMString string, in long from, in long length);
+ boolean hasMarkedText();
+ void unmarkText();
+ void insertText(in DOMString string);
+};
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
index 13765c0ff..2f35c51fe 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
@@ -245,6 +245,8 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings)
WKBundleSetAllowFileAccessFromFileURLs(m_bundle, m_pageGroup, true);
WKBundleSetPluginsEnabled(m_bundle, m_pageGroup, true);
WKBundleSetPopupBlockingEnabled(m_bundle, m_pageGroup, false);
+ WKBundleSetAlwaysAcceptCookies(m_bundle, false);
+ WKBundleSetSerialLoadingEnabled(m_bundle, false);
WKBundleRemoveAllUserContent(m_bundle, m_pageGroup);
@@ -260,7 +262,10 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings)
WKBundleClearAllDatabases(m_bundle);
WKBundleClearApplicationCache(m_bundle);
WKBundleResetOriginAccessWhitelists(m_bundle);
- WKBundleSetDatabaseQuota(m_bundle, 5 * 1024 * 1024);
+
+ // [WK2] REGRESSION(r128623): It made layout tests extremely slow
+ // https://bugs.webkit.org/show_bug.cgi?id=96862
+ // WKBundleSetDatabaseQuota(m_bundle, 5 * 1024 * 1024);
}
void InjectedBundle::done()
@@ -365,7 +370,7 @@ void InjectedBundle::setGeolocationPermission(bool enabled)
WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get());
}
-void InjectedBundle::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
+void InjectedBundle::setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed)
{
WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetMockGeolocationPosition"));
@@ -383,6 +388,38 @@ void InjectedBundle::setMockGeolocationPosition(double latitude, double longitud
WKRetainPtr<WKDoubleRef> accuracyWK(AdoptWK, WKDoubleCreate(accuracy));
WKDictionaryAddItem(messageBody.get(), accuracyKeyWK.get(), accuracyWK.get());
+ WKRetainPtr<WKStringRef> providesAltitudeKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesAltitude"));
+ WKRetainPtr<WKBooleanRef> providesAltitudeWK(AdoptWK, WKBooleanCreate(providesAltitude));
+ WKDictionaryAddItem(messageBody.get(), providesAltitudeKeyWK.get(), providesAltitudeWK.get());
+
+ WKRetainPtr<WKStringRef> altitudeKeyWK(AdoptWK, WKStringCreateWithUTF8CString("altitude"));
+ WKRetainPtr<WKDoubleRef> altitudeWK(AdoptWK, WKDoubleCreate(altitude));
+ WKDictionaryAddItem(messageBody.get(), altitudeKeyWK.get(), altitudeWK.get());
+
+ WKRetainPtr<WKStringRef> providesAltitudeAccuracyKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesAltitudeAccuracy"));
+ WKRetainPtr<WKBooleanRef> providesAltitudeAccuracyWK(AdoptWK, WKBooleanCreate(providesAltitudeAccuracy));
+ WKDictionaryAddItem(messageBody.get(), providesAltitudeAccuracyKeyWK.get(), providesAltitudeAccuracyWK.get());
+
+ WKRetainPtr<WKStringRef> altitudeAccuracyKeyWK(AdoptWK, WKStringCreateWithUTF8CString("altitudeAccuracy"));
+ WKRetainPtr<WKDoubleRef> altitudeAccuracyWK(AdoptWK, WKDoubleCreate(altitudeAccuracy));
+ WKDictionaryAddItem(messageBody.get(), altitudeAccuracyKeyWK.get(), altitudeAccuracyWK.get());
+
+ WKRetainPtr<WKStringRef> providesHeadingKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesHeading"));
+ WKRetainPtr<WKBooleanRef> providesHeadingWK(AdoptWK, WKBooleanCreate(providesHeading));
+ WKDictionaryAddItem(messageBody.get(), providesHeadingKeyWK.get(), providesHeadingWK.get());
+
+ WKRetainPtr<WKStringRef> headingKeyWK(AdoptWK, WKStringCreateWithUTF8CString("heading"));
+ WKRetainPtr<WKDoubleRef> headingWK(AdoptWK, WKDoubleCreate(heading));
+ WKDictionaryAddItem(messageBody.get(), headingKeyWK.get(), headingWK.get());
+
+ WKRetainPtr<WKStringRef> providesSpeedKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesSpeed"));
+ WKRetainPtr<WKBooleanRef> providesSpeedWK(AdoptWK, WKBooleanCreate(providesSpeed));
+ WKDictionaryAddItem(messageBody.get(), providesSpeedKeyWK.get(), providesSpeedWK.get());
+
+ WKRetainPtr<WKStringRef> speedKeyWK(AdoptWK, WKStringCreateWithUTF8CString("speed"));
+ WKRetainPtr<WKDoubleRef> speedWK(AdoptWK, WKDoubleCreate(speed));
+ WKDictionaryAddItem(messageBody.get(), speedKeyWK.get(), speedWK.get());
+
WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get());
}
@@ -392,4 +429,21 @@ void InjectedBundle::setMockGeolocationPositionUnavailableError(WKStringRef erro
WKBundlePostMessage(m_bundle, messageName.get(), errorMessage);
}
+void InjectedBundle::setCustomPolicyDelegate(bool enabled, bool permissive)
+{
+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetCustomPolicyDelegate"));
+
+ WKRetainPtr<WKMutableDictionaryRef> messageBody(AdoptWK, WKMutableDictionaryCreate());
+
+ WKRetainPtr<WKStringRef> enabledKeyWK(AdoptWK, WKStringCreateWithUTF8CString("enabled"));
+ WKRetainPtr<WKBooleanRef> enabledWK(AdoptWK, WKBooleanCreate(enabled));
+ WKDictionaryAddItem(messageBody.get(), enabledKeyWK.get(), enabledWK.get());
+
+ WKRetainPtr<WKStringRef> permissiveKeyWK(AdoptWK, WKStringCreateWithUTF8CString("permissive"));
+ WKRetainPtr<WKBooleanRef> permissiveWK(AdoptWK, WKBooleanCreate(permissive));
+ WKDictionaryAddItem(messageBody.get(), permissiveKeyWK.get(), permissiveWK.get());
+
+ WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get());
+}
+
} // namespace WTR
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
index e296142c1..89ec10a59 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
@@ -92,9 +92,12 @@ public:
// Geolocation.
void setGeolocationPermission(bool);
- void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
+ void setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed);
void setMockGeolocationPositionUnavailableError(WKStringRef errorMessage);
+ // Policy delegate.
+ void setCustomPolicyDelegate(bool enabled, bool permissive);
+
private:
InjectedBundle();
~InjectedBundle();
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index 782829f39..1389b289e 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -1330,6 +1330,13 @@ WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForNewWindowAction(WKBu
WKBundlePagePolicyAction InjectedBundlePage::decidePolicyForResponse(WKBundlePageRef page, WKBundleFrameRef, WKURLResponseRef response, WKURLRequestRef, WKTypeRef*)
{
+ if (WKURLResponseIsAttachment(response)) {
+ WKRetainPtr<WKStringRef> filename = adoptWK(WKURLResponseCopySuggestedFilename(response));
+ InjectedBundle::shared().stringBuilder()->appendLiteral("Policy delegate: resource is an attachment, suggested file name \'");
+ InjectedBundle::shared().stringBuilder()->append(toWTFString(filename));
+ InjectedBundle::shared().stringBuilder()->appendLiteral("\'\n");
+ }
+
WKRetainPtr<WKStringRef> mimeType = adoptWK(WKURLResponseCopyMIMEType(response));
return WKBundlePageCanShowMIMEType(page, mimeType.get()) ? WKBundlePagePolicyActionUse : WKBundlePagePolicyActionPassThrough;
}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Target.pri b/Tools/WebKitTestRunner/InjectedBundle/Target.pri
index 32769ac5d..a46b9300d 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Target.pri
+++ b/Tools/WebKitTestRunner/InjectedBundle/Target.pri
@@ -8,7 +8,6 @@ TEMPLATE = lib
TARGET = WTRInjectedBundle
SOURCES += \
- $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt/QtInitializeTestFonts.cpp \
AccessibilityController.cpp \
AccessibilityTextMarker.cpp \
AccessibilityTextMarkerRange.cpp \
@@ -29,13 +28,13 @@ SOURCES += \
Bindings/JSWrapper.cpp \
qt/ActivateFontsQt.cpp \
qt/InjectedBundleQt.cpp \
+ qt/QtInitializeTestFonts.cpp \
qt/TestRunnerQt.cpp
# Adds the generated sources to SOURCES
include(DerivedSources.pri)
HEADERS += \
- $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt/QtInitializeTestFonts.h \
AccessibilityController.h \
AccessibilityTextMarker.h \
AccessibilityTextMarkerRange.h \
@@ -47,10 +46,11 @@ HEADERS += \
InjectedBundlePage.h \
TestRunner.h \
TextInputController.h \
+ qt/QtInitializeTestFonts.h
DESTDIR = $${ROOT_BUILD_DIR}/lib
-QT += widgets webkit
+QT += widgets webkitwidgets
WEBKIT += wtf javascriptcore webcore
@@ -59,11 +59,11 @@ CONFIG += plugin rpath
have?(FONTCONFIG): PKGCONFIG += fontconfig
INCLUDEPATH += \
+ $$PWD \
$$PWD/.. \
$$PWD/Bindings \
$${ROOT_WEBKIT_DIR}/Source/WebCore/testing/js \
- $${ROOT_WEBKIT_DIR}/Source/WebKit/qt/WebCoreSupport \
- $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt
+ $${ROOT_WEBKIT_DIR}/Source/WebKit/qt/WebCoreSupport
PREFIX_HEADER = $$PWD/../WebKitTestRunnerPrefix.h
*-g++*:QMAKE_CXXFLAGS += "-include $$PREFIX_HEADER"
diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
index c2fd342e1..2bd2dd641 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
@@ -123,11 +123,12 @@ void TestRunner::dumpAsText(bool dumpPixels)
m_dumpPixels = dumpPixels;
}
-// FIXME: Needs a full implementation see https://bugs.webkit.org/show_bug.cgi?id=42546
void TestRunner::setCustomPolicyDelegate(bool enabled, bool permissive)
{
m_policyDelegateEnabled = enabled;
m_policyDelegatePermissive = permissive;
+
+ InjectedBundle::shared().setCustomPolicyDelegate(enabled, permissive);
}
void TestRunner::waitForPolicyDelegate()
@@ -193,13 +194,6 @@ void TestRunner::suspendAnimations()
WKBundleFrameSuspendAnimations(mainFrame);
}
-JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const
-{
- WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
- WKRetainPtr<WKStringRef> text(AdoptWK, WKBundleFrameCopyLayerTreeAsText(mainFrame));
- return toJS(text);
-}
-
void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
WKRetainPtr<WKStringRef> sourceWK = toWK(source);
@@ -489,8 +483,8 @@ unsigned TestRunner::worldIDForWorld(WKBundleScriptWorldRef world)
{
WorldMap::const_iterator end = worldMap().end();
for (WorldMap::const_iterator it = worldMap().begin(); it != end; ++it) {
- if (it->second == world)
- return it->first;
+ if (it->value == world)
+ return it->key;
}
return 0;
@@ -504,7 +498,7 @@ void TestRunner::evaluateScriptInIsolatedWorld(JSContextRef context, unsigned wo
if (!worldID)
world.adopt(WKBundleScriptWorldCreateWorld());
else {
- WKRetainPtr<WKBundleScriptWorldRef>& worldSlot = worldMap().add(worldID, 0).iterator->second;
+ WKRetainPtr<WKBundleScriptWorldRef>& worldSlot = worldMap().add(worldID, 0).iterator->value;
if (!worldSlot)
worldSlot.adopt(WKBundleScriptWorldCreateWorld());
world = worldSlot;
@@ -749,6 +743,16 @@ void TestRunner::setTabKeyCyclesThroughElements(bool enabled)
WKBundleSetTabKeyCyclesThroughElements(InjectedBundle::shared().bundle(), InjectedBundle::shared().page()->page(), enabled);
}
+void TestRunner::setSerializeHTTPLoads()
+{
+ WKBundleSetSerialLoadingEnabled(InjectedBundle::shared().bundle(), true);
+}
+
+void TestRunner::dispatchPendingLoadRequests()
+{
+ WKBundleDispatchPendingLoadRequests(InjectedBundle::shared().bundle());
+}
+
void TestRunner::grantWebNotificationPermission(JSStringRef origin)
{
WKRetainPtr<WKStringRef> originWK = toWK(origin);
@@ -780,9 +784,40 @@ void TestRunner::setGeolocationPermission(bool enabled)
InjectedBundle::shared().setGeolocationPermission(enabled);
}
-void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
+void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy, JSValueRef jsAltitude, JSValueRef jsAltitudeAccuracy, JSValueRef jsHeading, JSValueRef jsSpeed)
{
- InjectedBundle::shared().setMockGeolocationPosition(latitude, longitude, accuracy);
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
+
+ bool providesAltitude = false;
+ double altitude = 0.;
+ if (!JSValueIsUndefined(context, jsAltitude)) {
+ providesAltitude = true;
+ altitude = JSValueToNumber(context, jsAltitude, 0);
+ }
+
+ bool providesAltitudeAccuracy = false;
+ double altitudeAccuracy = 0.;
+ if (!JSValueIsUndefined(context, jsAltitudeAccuracy)) {
+ providesAltitudeAccuracy = true;
+ altitudeAccuracy = JSValueToNumber(context, jsAltitudeAccuracy, 0);
+ }
+
+ bool providesHeading = false;
+ double heading = 0.;
+ if (!JSValueIsUndefined(context, jsHeading)) {
+ providesHeading = true;
+ heading = JSValueToNumber(context, jsHeading, 0);
+ }
+
+ bool providesSpeed = false;
+ double speed = 0.;
+ if (!JSValueIsUndefined(context, jsSpeed)) {
+ providesSpeed = true;
+ speed = JSValueToNumber(context, jsSpeed, 0);
+ }
+
+ InjectedBundle::shared().setMockGeolocationPosition(latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed);
}
void TestRunner::setMockGeolocationPositionUnavailableError(JSStringRef message)
diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
index 8458943fc..e808634e3 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
@@ -110,6 +110,8 @@ public:
void setMinimumTimerInterval(double seconds); // Interval specified in seconds.
void setSpatialNavigationEnabled(bool);
void setTabKeyCyclesThroughElements(bool);
+ void setSerializeHTTPLoads();
+ void dispatchPendingLoadRequests();
// Special DOM functions.
JSValueRef computedStyleIncludingVisitedInfo(JSValueRef element);
@@ -130,9 +132,6 @@ public:
bool pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId);
void suspendAnimations();
- // Compositing testing.
- JSRetainPtr<JSStringRef> layerTreeAsText() const;
-
// UserContent testing.
void addUserScript(JSStringRef source, bool runAtStart, bool allFrames);
void addUserStyleSheet(JSStringRef source, bool allFrames);
@@ -251,7 +250,7 @@ public:
// Geolocation.
void setGeolocationPermission(bool);
- void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
+ void setMockGeolocationPosition(double latitude, double longitude, double accuracy, JSValueRef altitude, JSValueRef altitudeAccuracy, JSValueRef heading, JSValueRef speed);
void setMockGeolocationPositionUnavailableError(JSStringRef message);
JSRetainPtr<JSStringRef> platformName();
diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp b/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp
new file mode 100644
index 000000000..fcacf9778
--- /dev/null
+++ b/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "../../../DumpRenderTree/qt/QtInitializeTestFonts.cpp"
+
diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h b/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h
new file mode 100644
index 000000000..87fa87bfa
--- /dev/null
+++ b/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "../../../DumpRenderTree/qt/QtInitializeTestFonts.h"
+
diff --git a/Tools/WebKitTestRunner/Target.pri b/Tools/WebKitTestRunner/Target.pri
index 3c47cab38..71bfb823a 100644
--- a/Tools/WebKitTestRunner/Target.pri
+++ b/Tools/WebKitTestRunner/Target.pri
@@ -31,7 +31,7 @@ SOURCES += \
DESTDIR = $${ROOT_BUILD_DIR}/bin
-QT = core gui gui-private widgets network testlib quick quick-private webkit
+QT = core gui gui-private widgets network testlib quick quick-private webkitwidgets
WEBKIT += wtf javascriptcore webkit2
diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp
index 33d913fdb..7eb082762 100644
--- a/Tools/WebKitTestRunner/TestController.cpp
+++ b/Tools/WebKitTestRunner/TestController.cpp
@@ -93,6 +93,8 @@ TestController::TestController(int argc, const char* argv[])
, m_beforeUnloadReturnValue(true)
, m_isGeolocationPermissionSet(false)
, m_isGeolocationPermissionAllowed(false)
+ , m_policyDelegateEnabled(false)
+ , m_policyDelegatePermissive(false)
#if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
, m_eventSenderProxy(new EventSenderProxy(this))
#endif
@@ -107,35 +109,22 @@ TestController::~TestController()
{
}
-static WKRect getWindowFrameMainPage(WKPageRef page, const void* clientInfo)
-{
- PlatformWebView* view = static_cast<TestController*>(const_cast<void*>(clientInfo))->mainWebView();
- return view->windowFrame();
-}
-
-static void setWindowFrameMainPage(WKPageRef page, WKRect frame, const void* clientInfo)
-{
- PlatformWebView* view = static_cast<TestController*>(const_cast<void*>(clientInfo))->mainWebView();
- view->setWindowFrame(frame);
-}
-
-static WKRect getWindowFrameOtherPage(WKPageRef page, const void* clientInfo)
+static WKRect getWindowFrame(WKPageRef page, const void* clientInfo)
{
PlatformWebView* view = static_cast<PlatformWebView*>(const_cast<void*>(clientInfo));
return view->windowFrame();
}
-static void setWindowFrameOtherPage(WKPageRef page, WKRect frame, const void* clientInfo)
+static void setWindowFrame(WKPageRef page, WKRect frame, const void* clientInfo)
{
PlatformWebView* view = static_cast<PlatformWebView*>(const_cast<void*>(clientInfo));
view->setWindowFrame(frame);
}
-static bool runBeforeUnloadConfirmPanel(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo)
+static bool runBeforeUnloadConfirmPanel(WKPageRef page, WKStringRef message, WKFrameRef frame, const void*)
{
- TestController* testController = static_cast<TestController*>(const_cast<void*>(clientInfo));
printf("CONFIRM NAVIGATION: %s\n", toSTD(message).c_str());
- return testController->beforeUnloadReturnValue();
+ return TestController::shared().beforeUnloadReturnValue();
}
static unsigned long long exceededDatabaseQuota(WKPageRef, WKFrameRef, WKSecurityOriginRef, WKStringRef, WKStringRef, unsigned long long, unsigned long long, unsigned long long, unsigned long long, const void*)
@@ -163,6 +152,7 @@ static void closeOtherPage(WKPageRef page, const void* clientInfo)
static void focus(WKPageRef page, const void* clientInfo)
{
PlatformWebView* view = static_cast<PlatformWebView*>(const_cast<void*>(clientInfo));
+ view->focus();
view->setWindowIsKey(true);
}
@@ -174,8 +164,7 @@ static void unfocus(WKPageRef page, const void* clientInfo)
static void decidePolicyForGeolocationPermissionRequest(WKPageRef, WKFrameRef, WKSecurityOriginRef, WKGeolocationPermissionRequestRef permissionRequest, const void* clientInfo)
{
- TestController* testController = static_cast<TestController*>(const_cast<void*>(clientInfo));
- testController->handleGeolocationPermissionRequest(permissionRequest);
+ TestController::shared().handleGeolocationPermissionRequest(permissionRequest);
}
WKPageRef TestController::createOtherPage(WKPageRef oldPage, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void*)
@@ -210,8 +199,8 @@ WKPageRef TestController::createOtherPage(WKPageRef oldPage, WKURLRequestRef, WK
0, // setStatusBarIsVisible
0, // isResizable
0, // setIsResizable
- getWindowFrameOtherPage,
- setWindowFrameOtherPage,
+ getWindowFrame,
+ setWindowFrame,
runBeforeUnloadConfirmPanel,
0, // didDraw
0, // pageDidScroll
@@ -358,13 +347,13 @@ void TestController::initialize(int argc, const char* argv[])
WKPageUIClient pageUIClient = {
kWKPageUIClientCurrentVersion,
- this,
+ m_mainWebView.get(),
0, // createNewPage_deprecatedForUseWithV0
0, // showPage
0, // close
0, // takeFocus
- 0, // focus
- 0, // unfocus
+ focus,
+ unfocus,
0, // runJavaScriptAlert
0, // runJavaScriptConfirm
0, // runJavaScriptPrompt
@@ -381,8 +370,8 @@ void TestController::initialize(int argc, const char* argv[])
0, // setStatusBarIsVisible
0, // isResizable
0, // setIsResizable
- getWindowFrameMainPage,
- setWindowFrameMainPage,
+ getWindowFrame,
+ setWindowFrame,
runBeforeUnloadConfirmPanel,
0, // didDraw
0, // pageDidScroll
@@ -445,6 +434,16 @@ void TestController::initialize(int argc, const char* argv[])
0, // didLayout
};
WKPageSetPageLoaderClient(m_mainWebView->page(), &pageLoaderClient);
+
+ WKPagePolicyClient pagePolicyClient = {
+ kWKPagePolicyClientCurrentVersion,
+ this,
+ decidePolicyForNavigationAction,
+ 0, // decidePolicyForNewWindowAction
+ decidePolicyForResponse,
+ 0, // unableToImplementPolicy
+ };
+ WKPageSetPagePolicyClient(m_mainWebView->page(), &pagePolicyClient);
}
bool TestController::resetStateToConsistentValues()
@@ -491,12 +490,7 @@ bool TestController::resetStateToConsistentValues()
WKPreferencesSetArtificialPluginInitializationDelayEnabled(preferences, false);
WKPreferencesSetTabToLinksEnabled(preferences, false);
WKPreferencesSetInteractiveFormValidationEnabled(preferences, true);
-
-// [Qt][WK2]REGRESSION(r104881):It broke hundreds of tests
-// FIXME: https://bugs.webkit.org/show_bug.cgi?id=76247
-#if !PLATFORM(QT)
WKPreferencesSetMockScrollbarsEnabled(preferences, true);
-#endif
#if !PLATFORM(QT)
static WKStringRef standardFontFamily = WKStringCreateWithUTF8CString("Times");
@@ -533,6 +527,9 @@ bool TestController::resetStateToConsistentValues()
m_isGeolocationPermissionSet = false;
m_isGeolocationPermissionAllowed = false;
+ // Reset Custom Policy Delegate.
+ setCustomPolicyDelegate(false, false);
+
// Reset main page back to about:blank
m_doneResetting = false;
@@ -1011,9 +1008,9 @@ void TestController::setGeolocationPermission(bool enabled)
decidePolicyForGeolocationPermissionRequestIfPossible();
}
-void TestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
+void TestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed)
{
- m_geolocationProvider->setPosition(latitude, longitude, accuracy);
+ m_geolocationProvider->setPosition(latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed);
}
void TestController::setMockGeolocationPositionUnavailableError(WKStringRef errorMessage)
@@ -1027,23 +1024,30 @@ void TestController::handleGeolocationPermissionRequest(WKGeolocationPermissionR
decidePolicyForGeolocationPermissionRequestIfPossible();
}
+void TestController::setCustomPolicyDelegate(bool enabled, bool permissive)
+{
+ m_policyDelegateEnabled = enabled;
+ m_policyDelegatePermissive = permissive;
+}
+
void TestController::decidePolicyForGeolocationPermissionRequestIfPossible()
{
if (!m_isGeolocationPermissionSet)
return;
for (size_t i = 0; i < m_geolocationPermissionRequests.size(); ++i) {
- WKGeolocationPermissionRequestRef& permissionRequest = m_geolocationPermissionRequests[i];
+ WKGeolocationPermissionRequestRef permissionRequest = m_geolocationPermissionRequests[i].get();
if (m_isGeolocationPermissionAllowed)
WKGeolocationPermissionRequestAllow(permissionRequest);
else
WKGeolocationPermissionRequestDeny(permissionRequest);
}
+ m_geolocationPermissionRequests.clear();
}
-void TestController::decidePolicyForNotificationPermissionRequest(WKPageRef page, WKSecurityOriginRef origin, WKNotificationPermissionRequestRef request, const void* clientInfo)
+void TestController::decidePolicyForNotificationPermissionRequest(WKPageRef page, WKSecurityOriginRef origin, WKNotificationPermissionRequestRef request, const void*)
{
- static_cast<TestController*>(const_cast<void*>(clientInfo))->decidePolicyForNotificationPermissionRequest(page, origin, request);
+ TestController::shared().decidePolicyForNotificationPermissionRequest(page, origin, request);
}
void TestController::decidePolicyForNotificationPermissionRequest(WKPageRef, WKSecurityOriginRef, WKNotificationPermissionRequestRef request)
@@ -1051,4 +1055,37 @@ void TestController::decidePolicyForNotificationPermissionRequest(WKPageRef, WKS
WKNotificationPermissionRequestAllow(request);
}
+void TestController::decidePolicyForNavigationAction(WKPageRef, WKFrameRef, WKFrameNavigationType, WKEventModifiers, WKEventMouseButton, WKURLRequestRef, WKFramePolicyListenerRef listener, WKTypeRef, const void* clientInfo)
+{
+ static_cast<TestController*>(const_cast<void*>(clientInfo))->decidePolicyForNavigationAction(listener);
+}
+
+void TestController::decidePolicyForNavigationAction(WKFramePolicyListenerRef listener)
+{
+ if (m_policyDelegateEnabled && !m_policyDelegatePermissive) {
+ WKFramePolicyListenerIgnore(listener);
+ return;
+ }
+
+ WKFramePolicyListenerUse(listener);
+}
+
+void TestController::decidePolicyForResponse(WKPageRef, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef, WKFramePolicyListenerRef listener, WKTypeRef, const void* clientInfo)
+{
+ static_cast<TestController*>(const_cast<void*>(clientInfo))->decidePolicyForResponse(frame, response, listener);
+}
+
+void TestController::decidePolicyForResponse(WKFrameRef frame, WKURLResponseRef response, WKFramePolicyListenerRef listener)
+{
+ // Even though Response was already checked by WKBundlePagePolicyClient, the check did not include plugins
+ // so we have to re-check again.
+ WKRetainPtr<WKStringRef> wkMIMEType(AdoptWK, WKURLResponseCopyMIMEType(response));
+ if (WKFrameCanShowMIMEType(frame, wkMIMEType.get())) {
+ WKFramePolicyListenerUse(listener);
+ return;
+ }
+
+ WKFramePolicyListenerIgnore(listener);
+}
+
} // namespace WTR
diff --git a/Tools/WebKitTestRunner/TestController.h b/Tools/WebKitTestRunner/TestController.h
index f7888923b..89daf9d7c 100644
--- a/Tools/WebKitTestRunner/TestController.h
+++ b/Tools/WebKitTestRunner/TestController.h
@@ -69,10 +69,13 @@ public:
// Geolocation.
void setGeolocationPermission(bool);
- void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
+ void setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed);
void setMockGeolocationPositionUnavailableError(WKStringRef errorMessage);
void handleGeolocationPermissionRequest(WKGeolocationPermissionRequestRef);
+ // Policy delegate.
+ void setCustomPolicyDelegate(bool enabled, bool permissive);
+
bool resetStateToConsistentValues();
private:
@@ -110,6 +113,13 @@ private:
static void decidePolicyForNotificationPermissionRequest(WKPageRef, WKSecurityOriginRef, WKNotificationPermissionRequestRef, const void*);
void decidePolicyForNotificationPermissionRequest(WKPageRef, WKSecurityOriginRef, WKNotificationPermissionRequestRef);
+ // WKPagePolicyClient
+ static void decidePolicyForNavigationAction(WKPageRef, WKFrameRef, WKFrameNavigationType, WKEventModifiers, WKEventMouseButton, WKURLRequestRef, WKFramePolicyListenerRef, WKTypeRef, const void*);
+ void decidePolicyForNavigationAction(WKFramePolicyListenerRef);
+
+ static void decidePolicyForResponse(WKPageRef, WKFrameRef, WKURLResponseRef, WKURLRequestRef, WKFramePolicyListenerRef, WKTypeRef, const void*);
+ void decidePolicyForResponse(WKFrameRef, WKURLResponseRef, WKFramePolicyListenerRef);
+
static WKPageRef createOtherPage(WKPageRef oldPage, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void*);
static void runModal(WKPageRef, const void* clientInfo);
@@ -154,10 +164,13 @@ private:
bool m_beforeUnloadReturnValue;
OwnPtr<GeolocationProviderMock> m_geolocationProvider;
- Vector<WKGeolocationPermissionRequestRef> m_geolocationPermissionRequests;
+ Vector<WKRetainPtr<WKGeolocationPermissionRequestRef> > m_geolocationPermissionRequests;
bool m_isGeolocationPermissionSet;
bool m_isGeolocationPermissionAllowed;
+ bool m_policyDelegateEnabled;
+ bool m_policyDelegatePermissive;
+
EventSenderProxy* m_eventSenderProxy;
};
diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp
index 9ca75aef7..a6254d9fd 100644
--- a/Tools/WebKitTestRunner/TestInvocation.cpp
+++ b/Tools/WebKitTestRunner/TestInvocation.cpp
@@ -371,7 +371,39 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName
WKDoubleRef accuracyWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, accuracyKeyWK.get()));
double accuracy = WKDoubleGetValue(accuracyWK);
- TestController::shared().setMockGeolocationPosition(latitude, longitude, accuracy);
+ WKRetainPtr<WKStringRef> providesAltitudeKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesAltitude"));
+ WKBooleanRef providesAltitudeWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, providesAltitudeKeyWK.get()));
+ bool providesAltitude = WKBooleanGetValue(providesAltitudeWK);
+
+ WKRetainPtr<WKStringRef> altitudeKeyWK(AdoptWK, WKStringCreateWithUTF8CString("altitude"));
+ WKDoubleRef altitudeWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, altitudeKeyWK.get()));
+ double altitude = WKDoubleGetValue(altitudeWK);
+
+ WKRetainPtr<WKStringRef> providesAltitudeAccuracyKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesAltitudeAccuracy"));
+ WKBooleanRef providesAltitudeAccuracyWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, providesAltitudeAccuracyKeyWK.get()));
+ bool providesAltitudeAccuracy = WKBooleanGetValue(providesAltitudeAccuracyWK);
+
+ WKRetainPtr<WKStringRef> altitudeAccuracyKeyWK(AdoptWK, WKStringCreateWithUTF8CString("altitudeAccuracy"));
+ WKDoubleRef altitudeAccuracyWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, altitudeAccuracyKeyWK.get()));
+ double altitudeAccuracy = WKDoubleGetValue(altitudeAccuracyWK);
+
+ WKRetainPtr<WKStringRef> providesHeadingKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesHeading"));
+ WKBooleanRef providesHeadingWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, providesHeadingKeyWK.get()));
+ bool providesHeading = WKBooleanGetValue(providesHeadingWK);
+
+ WKRetainPtr<WKStringRef> headingKeyWK(AdoptWK, WKStringCreateWithUTF8CString("heading"));
+ WKDoubleRef headingWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, headingKeyWK.get()));
+ double heading = WKDoubleGetValue(headingWK);
+
+ WKRetainPtr<WKStringRef> providesSpeedKeyWK(AdoptWK, WKStringCreateWithUTF8CString("providesSpeed"));
+ WKBooleanRef providesSpeedWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, providesSpeedKeyWK.get()));
+ bool providesSpeed = WKBooleanGetValue(providesSpeedWK);
+
+ WKRetainPtr<WKStringRef> speedKeyWK(AdoptWK, WKStringCreateWithUTF8CString("speed"));
+ WKDoubleRef speedWK = static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, speedKeyWK.get()));
+ double speed = WKDoubleGetValue(speedWK);
+
+ TestController::shared().setMockGeolocationPosition(latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed);
return;
}
@@ -382,6 +414,22 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName
return;
}
+ if (WKStringIsEqualToUTF8CString(messageName, "SetCustomPolicyDelegate")) {
+ ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
+ WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
+
+ WKRetainPtr<WKStringRef> enabledKeyWK(AdoptWK, WKStringCreateWithUTF8CString("enabled"));
+ WKBooleanRef enabledWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, enabledKeyWK.get()));
+ bool enabled = WKBooleanGetValue(enabledWK);
+
+ WKRetainPtr<WKStringRef> permissiveKeyWK(AdoptWK, WKStringCreateWithUTF8CString("permissive"));
+ WKBooleanRef permissiveWK = static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, permissiveKeyWK.get()));
+ bool permissive = WKBooleanGetValue(permissiveWK);
+
+ TestController::shared().setCustomPolicyDelegate(enabled, permissive);
+ return;
+ }
+
ASSERT_NOT_REACHED();
}
diff --git a/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp b/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
index 0bdb236dd..06187a066 100644
--- a/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
+++ b/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
@@ -28,11 +28,9 @@ using namespace WebKit;
namespace WTR {
-static bool useX11Window = false;
-
static Ecore_Evas* initEcoreEvas()
{
- Ecore_Evas* ecoreEvas = useX11Window ? ecore_evas_new(0, 0, 0, 800, 600, 0) : ecore_evas_buffer_new(800, 600);
+ Ecore_Evas* ecoreEvas = ecore_evas_new(0, 0, 0, 800, 600, 0);
if (!ecoreEvas)
return 0;
@@ -76,16 +74,18 @@ void PlatformWebView::focus()
WKRect PlatformWebView::windowFrame()
{
- Evas_Coord x, y, width, height;
- evas_object_geometry_get(m_view, &x, &y, &width, &height);
+ int x, y, width, height;
+
+ Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(m_view));
+ ecore_evas_request_geometry_get(ee, &x, &y, &width, &height);
return WKRectMake(x, y, width, height);
}
void PlatformWebView::setWindowFrame(WKRect frame)
{
- evas_object_move(m_view, frame.origin.x, frame.origin.y);
- resizeTo(frame.size.width, frame.size.height);
+ Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(m_view));
+ ecore_evas_move_resize(ee, frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);
}
void PlatformWebView::addChromeInputField()
diff --git a/Tools/WebKitTestRunner/efl/main.cpp b/Tools/WebKitTestRunner/efl/main.cpp
index 98bcde2a7..70b2a4485 100644
--- a/Tools/WebKitTestRunner/efl/main.cpp
+++ b/Tools/WebKitTestRunner/efl/main.cpp
@@ -24,10 +24,6 @@
#include <wtf/Assertions.h>
#include <stdlib.h>
-#ifdef HAVE_ECORE_X
-#include <Ecore_X.h>
-#endif
-
int main(int argc, char** argv)
{
WTFInstallReportBacktraceOnCrashHook();
@@ -35,26 +31,9 @@ int main(int argc, char** argv)
if (!ewk_init())
return 1;
-#ifdef HAVE_ECORE_X
- const char* display = getenv("DISPLAY");
- int intialized = 0;
- if (display) {
- intialized = ecore_x_init(0);
- if (!intialized) {
- ewk_shutdown();
- return 1;
- }
- }
-#endif
-
// Prefer the not installed web and plugin processes.
WTR::TestController controller(argc, const_cast<const char**>(argv));
-#ifdef HAVE_ECORE_X
- if (intialized)
- ecore_x_shutdown();
-#endif
-
ewk_shutdown();
return 0;
diff --git a/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm b/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
index c9bcc3d2a..db5d1197c 100644
--- a/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
+++ b/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
@@ -33,7 +33,6 @@
@interface WebKitTestRunnerWindow : NSWindow {
WTR::PlatformWebView* _platformWebView;
NSPoint _fakeOrigin;
- bool _shouldUseFakeOrigin;
}
@property (nonatomic, assign) WTR::PlatformWebView* platformWebView;
@end
@@ -49,7 +48,6 @@
- (void)setFrameOrigin:(NSPoint)point
{
_fakeOrigin = point;
- _shouldUseFakeOrigin = YES;
}
- (void)setFrame:(NSRect)windowFrame display:(BOOL)displayViews animate:(BOOL)performAnimation
@@ -57,7 +55,6 @@
NSRect currentFrame = [super frame];
_fakeOrigin = windowFrame.origin;
- _shouldUseFakeOrigin = YES;
[super setFrame:NSMakeRect(currentFrame.origin.x, currentFrame.origin.y, windowFrame.size.width, windowFrame.size.height) display:displayViews animate:performAnimation];
}
@@ -67,7 +64,6 @@
NSRect currentFrame = [super frame];
_fakeOrigin = windowFrame.origin;
- _shouldUseFakeOrigin = YES;
[super setFrame:NSMakeRect(currentFrame.origin.x, currentFrame.origin.y, windowFrame.size.width, windowFrame.size.height) display:displayViews];
}
@@ -75,11 +71,7 @@
- (NSRect)frameRespectingFakeOrigin
{
NSRect currentFrame = [self frame];
-
- if (_shouldUseFakeOrigin)
- return NSMakeRect(_fakeOrigin.x, _fakeOrigin.y, currentFrame.size.width, currentFrame.size.height);
-
- return currentFrame;
+ return NSMakeRect(_fakeOrigin.x, _fakeOrigin.y, currentFrame.size.width, currentFrame.size.height);
}
@end
diff --git a/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp b/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp
index 5d4de9d20..7619d3160 100644
--- a/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp
+++ b/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp
@@ -418,7 +418,10 @@ void EventSenderProxy::sendTouchEvent(QEvent::Type type)
QWindowSystemInterface::registerTouchDevice(device);
}
- QTouchEvent event(type, device, m_touchModifiers);
+ Qt::TouchPointStates eventStates;
+ for (int i = 0; i < m_touchPoints.count(); i++)
+ eventStates |= m_touchPoints[i].state();
+ QTouchEvent event(type, device, m_touchModifiers, eventStates);
event.setTouchPoints(m_touchPoints);
m_testController->mainWebView()->sendEvent(&event);
QList<QTouchEvent::TouchPoint>::Iterator it = m_touchPoints.begin();
diff --git a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
index 22e3fc596..1e53b0885 100644
--- a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
+++ b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
@@ -34,6 +34,7 @@
#include <QEventLoop>
#include <QQmlProperty>
#include <QtQuick/QQuickView>
+#include <WebKit2/WKImageQt.h>
#include <qpa/qwindowsysteminterface.h>
namespace WTR {
@@ -94,7 +95,8 @@ void PlatformWebView::resizeTo(unsigned width, unsigned height)
// resized to what the layout test expects.
if (!m_window->handle()) {
QRect newGeometry(m_window->x(), m_window->y(), width, height);
- QWindowSystemInterface::handleSynchronousGeometryChange(m_window, newGeometry);
+ QWindowSystemInterface::handleGeometryChange(m_window, newGeometry);
+ QWindowSystemInterface::flushWindowSystemEvents();
}
m_window->resize(width, height);
diff --git a/Tools/WebKitTestRunner/qt/TestControllerQt.cpp b/Tools/WebKitTestRunner/qt/TestControllerQt.cpp
index dedb18aa6..04ddb8b76 100644
--- a/Tools/WebKitTestRunner/qt/TestControllerQt.cpp
+++ b/Tools/WebKitTestRunner/qt/TestControllerQt.cpp
@@ -104,10 +104,7 @@ void TestController::initializeInjectedBundlePath()
void TestController::initializeTestPluginDirectory()
{
- // FIXME: the test plugin cause some trouble for us, so we don't load it for the time being.
- // See: https://bugs.webkit.org/show_bug.cgi?id=86620
-
- // m_testPluginDirectory.adopt(WKStringCreateWithUTF8CString(qgetenv("QTWEBKIT_PLUGIN_PATH").constData()));
+ m_testPluginDirectory.adopt(WKStringCreateWithUTF8CString(qgetenv("QTWEBKIT_PLUGIN_PATH").constData()));
}
void TestController::platformInitializeContext()
diff --git a/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp b/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp
index 01630d98a..981c2032a 100644
--- a/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp
+++ b/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp
@@ -29,6 +29,7 @@
#include <QBuffer>
#include <QCryptographicHash>
+#include <QtGui/QPainter>
#include <WebKit2/WKImageQt.h>
#include <stdio.h>
#include <wtf/Assertions.h>
@@ -64,10 +65,25 @@ static void dumpImage(const QImage& image)
void TestInvocation::dumpPixelsAndCompareWithExpected(WKImageRef imageRef, WKArrayRef repaintRects)
{
- //FIXME: https://bugs.webkit.org/show_bug.cgi?id=68870
- UNUSED_PARAM(repaintRects);
-
QImage image = WKImageCreateQImage(imageRef);
+
+ if (repaintRects) {
+ QImage mask(image.size(), image.format());
+ mask.fill(QColor(0, 0, 0, 0.66 * 255));
+
+ QPainter maskPainter(&mask);
+ maskPainter.setCompositionMode(QPainter::CompositionMode_Source);
+ size_t count = WKArrayGetSize(repaintRects);
+ for (size_t i = 0; i < count; ++i) {
+ WKRect wkRect = WKRectGetValue(static_cast<WKRectRef>(WKArrayGetItemAtIndex(repaintRects, i)));
+ QRectF rect(wkRect.origin.x, wkRect.origin.y, wkRect.size.width, wkRect.size.height);
+ maskPainter.fillRect(rect, Qt::transparent);
+ }
+
+ QPainter painter(&image);
+ painter.drawImage(image.rect(), mask);
+ }
+
QCryptographicHash hash(QCryptographicHash::Md5);
for (unsigned row = 0; row < image.height(); ++row)
hash.addData(reinterpret_cast<const char*>(image.constScanLine(row)), image.bytesPerLine());
diff --git a/Tools/WebKitTestRunner/qt/main.cpp b/Tools/WebKitTestRunner/qt/main.cpp
index d7abf16e6..31b750681 100644
--- a/Tools/WebKitTestRunner/qt/main.cpp
+++ b/Tools/WebKitTestRunner/qt/main.cpp
@@ -74,10 +74,10 @@ static void sigcontHandler(int)
}
#endif
-void messageHandler(QtMsgType type, const char* message)
+void messageHandler(QtMsgType type, const QMessageLogContext&, const QString& message)
{
if (type == QtCriticalMsg) {
- fprintf(stderr, "%s\n", message);
+ fprintf(stderr, "%s\n", qPrintable(message));
return;
}
@@ -112,7 +112,7 @@ int main(int argc, char** argv)
// Has to be done before QApplication is constructed in case
// QApplication itself produces debug output.
if (suppressQtDebugOutput) {
- qInstallMsgHandler(messageHandler);
+ qInstallMessageHandler(messageHandler);
if (qgetenv("QT_WEBKIT_SUPPRESS_WEB_PROCESS_OUTPUT").isEmpty())
qputenv("QT_WEBKIT_SUPPRESS_WEB_PROCESS_OUTPUT", "1");
}