Log Message
Add missing methods used by fast/notifications tests to LayoutTestController https://bugs.webkit.org/show_bug.cgi?id=63616
Patch by Alexandre Mazari <[email protected]> on 2011-12-04 Reviewed by Martin Robinson. Add missing simulateDesktopNotificationClick method used by fast/notifications. Provide a default implementation for areDesktopNotificationPermissionRequestsIgnored and ignoreDesktopNotificationPermissionRequests. * DumpRenderTree/LayoutTestController.cpp: (LayoutTestController::LayoutTestController): call into the port implementation. (simulateDesktopNotificationClickCallback): ditto. (ignoreDesktopNotificationPermissionRequestsCallback): default implementation. (LayoutTestController::staticFunctions): declare new methods. (LayoutTestController::ignoreDesktopNotificationPermissionRequests): default implementation. * DumpRenderTree/LayoutTestController.h: (LayoutTestController::areDesktopNotificationPermissionRequestsIgnored): * DumpRenderTree/efl/LayoutTestControllerEfl.cpp: (LayoutTestController::simulateDesktopNotificationClick): dummy implementation. * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: (LayoutTestController::simulateDesktopNotificationClick): ditto. * DumpRenderTree/mac/LayoutTestControllerMac.mm: (LayoutTestController::simulateDesktopNotificationClick): ditto. * DumpRenderTree/win/LayoutTestControllerWin.cpp: (LayoutTestController::simulateDesktopNotificationClick): ditto. * DumpRenderTree/wx/LayoutTestControllerWx.cpp: (LayoutTestController::simulateDesktopNotificationClick): ditto.
Modified Paths
- trunk/Tools/ChangeLog
- trunk/Tools/DumpRenderTree/LayoutTestController.cpp
- trunk/Tools/DumpRenderTree/LayoutTestController.h
- trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp
- trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
- trunk/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm
- trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp
- trunk/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
Diff
Modified: trunk/Tools/ChangeLog (101952 => 101953)
--- trunk/Tools/ChangeLog 2011-12-04 11:32:26 UTC (rev 101952)
+++ trunk/Tools/ChangeLog 2011-12-04 11:56:22 UTC (rev 101953)
@@ -1,3 +1,34 @@
+2011-12-04 Alexandre Mazari <[email protected]>
+
+ Add missing methods used by fast/notifications tests to LayoutTestController
+ https://bugs.webkit.org/show_bug.cgi?id=63616
+
+ Reviewed by Martin Robinson.
+
+ Add missing simulateDesktopNotificationClick method used by
+ fast/notifications. Provide a default implementation for
+ areDesktopNotificationPermissionRequestsIgnored and
+ ignoreDesktopNotificationPermissionRequests.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController): call into the port implementation.
+ (simulateDesktopNotificationClickCallback): ditto.
+ (ignoreDesktopNotificationPermissionRequestsCallback): default implementation.
+ (LayoutTestController::staticFunctions): declare new methods.
+ (LayoutTestController::ignoreDesktopNotificationPermissionRequests): default implementation.
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::areDesktopNotificationPermissionRequestsIgnored):
+ * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+ (LayoutTestController::simulateDesktopNotificationClick): dummy implementation.
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::simulateDesktopNotificationClick): ditto.
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::simulateDesktopNotificationClick): ditto.
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::simulateDesktopNotificationClick): ditto.
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::simulateDesktopNotificationClick): ditto.
+
2011-12-03 Mario Sanchez Prada <[email protected]>
[GTK] Don't log document events in DRT
Modified: trunk/Tools/DumpRenderTree/LayoutTestController.cpp (101952 => 101953)
--- trunk/Tools/DumpRenderTree/LayoutTestController.cpp 2011-12-04 11:32:26 UTC (rev 101952)
+++ trunk/Tools/DumpRenderTree/LayoutTestController.cpp 2011-12-04 11:56:22 UTC (rev 101953)
@@ -92,6 +92,7 @@
, m_shouldStayOnPageAfterHandlingBeforeUnload(false)
, m_testPathOrURL(testPathOrURL)
, m_expectedPixelHash(expectedPixelHash)
+ , m_areDesktopNotificationPermissionRequestsIgnored(false)
{
}
@@ -2244,6 +2245,21 @@
return true;
}
+static JSValueRef ignoreDesktopNotificationPermissionRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->ignoreDesktopNotificationPermissionRequests();
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef simulateDesktopNotificationClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ JSRetainPtr<JSStringRef> title(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+ controller->simulateDesktopNotificationClick(title.get());
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef setMinimumTimerIntervalCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
if (argumentCount < 1)
@@ -2373,6 +2389,7 @@
{ "grantDesktopNotificationPermission", grantDesktopNotificationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "hasSpellingMarker", hasSpellingMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "hasGrammarMarker", hasGrammarMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "ignoreDesktopNotificationPermissionRequests", ignoreDesktopNotificationPermissionRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isCommandEnabled", isCommandEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isPageBoxVisible", isPageBoxVisibleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "keepWebHistory", keepWebHistoryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -2464,6 +2481,7 @@
{ "setXSSAuditorEnabled", setXSSAuditorEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setAsynchronousSpellCheckingEnabled", setAsynchronousSpellCheckingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "showWebInspector", showWebInspectorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "simulateDesktopNotificationClick", simulateDesktopNotificationClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "testOnscreen", testOnscreenCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "testRepaint", testRepaintCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "waitForPolicyDelegate", waitForPolicyDelegateCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -2544,6 +2562,11 @@
return false;
}
+void LayoutTestController::ignoreDesktopNotificationPermissionRequests()
+{
+ m_areDesktopNotificationPermissionRequestsIgnored = false;
+}
+
void LayoutTestController::waitToDumpWatchdogTimerFired()
{
const char* message = "FAIL: Timed out waiting for notifyDone to be called\n";
Modified: trunk/Tools/DumpRenderTree/LayoutTestController.h (101952 => 101953)
--- trunk/Tools/DumpRenderTree/LayoutTestController.h 2011-12-04 11:32:26 UTC (rev 101952)
+++ trunk/Tools/DumpRenderTree/LayoutTestController.h 2011-12-04 11:56:22 UTC (rev 101953)
@@ -141,6 +141,9 @@
void grantDesktopNotificationPermission(JSStringRef origin);
bool checkDesktopNotificationPermission(JSStringRef origin);
+ void ignoreDesktopNotificationPermissionRequests();
+ bool areDesktopNotificationPermissionRequestsIgnored() const { return m_areDesktopNotificationPermissionRequestsIgnored; }
+ void simulateDesktopNotificationClick(JSStringRef title);
bool elementDoesAutoCompleteForElementWithId(JSStringRef id);
@@ -413,6 +416,7 @@
bool m_deferMainResourceDataLoad;
bool m_shouldPaintBrokenImage;
bool m_shouldStayOnPageAfterHandlingBeforeUnload;
+ bool m_areDesktopNotificationPermissionRequestsIgnored;
std::string m_authenticationUsername;
std::string m_authenticationPassword;
Modified: trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp (101952 => 101953)
--- trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp 2011-12-04 11:32:26 UTC (rev 101952)
+++ trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp 2011-12-04 11:56:22 UTC (rev 101953)
@@ -779,3 +779,7 @@
{
notImplemented();
}
+
+void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title)
+{
+}
Modified: trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp (101952 => 101953)
--- trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp 2011-12-04 11:32:26 UTC (rev 101952)
+++ trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp 2011-12-04 11:56:22 UTC (rev 101953)
@@ -1032,3 +1032,7 @@
void LayoutTestController::setBackingScaleFactor(double)
{
}
+
+void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title)
+{
+}
Modified: trunk/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm (101952 => 101953)
--- trunk/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm 2011-12-04 11:32:26 UTC (rev 101952)
+++ trunk/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm 2011-12-04 11:56:22 UTC (rev 101953)
@@ -1236,3 +1236,8 @@
{
[[mainFrame webView] _setCustomBackingScaleFactor:backingScaleFactor];
}
+
+void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title)
+{
+ // FIXME: Implement.
+}
Modified: trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp (101952 => 101953)
--- trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp 2011-12-04 11:32:26 UTC (rev 101952)
+++ trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp 2011-12-04 11:56:22 UTC (rev 101953)
@@ -1556,3 +1556,8 @@
void LayoutTestController::setBackingScaleFactor(double)
{
}
+
+void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title)
+{
+ // FIXME: Implement.
+}
Modified: trunk/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp (101952 => 101953)
--- trunk/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp 2011-12-04 11:32:26 UTC (rev 101952)
+++ trunk/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp 2011-12-04 11:56:22 UTC (rev 101953)
@@ -661,3 +661,8 @@
void LayoutTestController::setBackingScaleFactor(double)
{
}
+
+void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title)
+{
+ // FIXME: Implement.
+}
_______________________________________________ webkit-changes mailing list [email protected] http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
