Title: [88432] trunk
Revision
88432
Author
[email protected]
Date
2011-06-09 00:35:28 -0700 (Thu, 09 Jun 2011)

Log Message

2011-06-09  Mario Sanchez Prada  <[email protected]>

        Reviewed by Chris Fleizach.

        [GTK] Provide a way in DRT to check the platform name
        https://bugs.webkit.org/show_bug.cgi?id=56855

        New layout test and expected results to check the new function.

        * accessibility/platform-name.html: Added.
        * platform/gtk/accessibility/platform-name-expected.txt: Added.
        * platform/mac/accessibility/platform-name-expected.txt: Added.
        * platform/win/accessibility/platform-name-expected.txt: Added.
2011-06-09  Mario Sanchez Prada  <[email protected]>

        Reviewed by Chris Fleizach.

        [GTK] Provide a way in DRT to check the platform name
        https://bugs.webkit.org/show_bug.cgi?id=56855

        Patch for adding 'platformName' static property to DRT's
        LayoutController and provide platform specific implementations.

        In principle, this feature will be only of interest for writing
        accessibility tests, so that's why it's only implemented in the
        Mac, Gtk and Win platforms.

        * DumpRenderTree/LayoutTestController.h: New method platformName().
        * DumpRenderTree/LayoutTestController.cpp:
        (getPlatformNameCallback): New callback for 'platformName'.
        (LayoutTestController::staticValues): New static property.

        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
        (LayoutTestController::platformName): Implemented.

        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
        (LayoutTestController::platformName): Implemented.

        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
        (LayoutTestController::platformName): Implemented.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (88431 => 88432)


--- trunk/LayoutTests/ChangeLog	2011-06-09 06:55:33 UTC (rev 88431)
+++ trunk/LayoutTests/ChangeLog	2011-06-09 07:35:28 UTC (rev 88432)
@@ -1,3 +1,17 @@
+2011-06-09  Mario Sanchez Prada  <[email protected]>
+
+        Reviewed by Chris Fleizach.
+
+        [GTK] Provide a way in DRT to check the platform name
+        https://bugs.webkit.org/show_bug.cgi?id=56855
+
+        New layout test and expected results to check the new function.
+
+        * accessibility/platform-name.html: Added.
+        * platform/gtk/accessibility/platform-name-expected.txt: Added.
+        * platform/mac/accessibility/platform-name-expected.txt: Added.
+        * platform/win/accessibility/platform-name-expected.txt: Added.
+
 2011-06-08  Kent Tamura  <[email protected]>
 
         [Chromium] Rebaseline for r87881 and r88415.

Added: trunk/LayoutTests/accessibility/platform-name.html (0 => 88432)


--- trunk/LayoutTests/accessibility/platform-name.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/platform-name.html	2011-06-09 07:35:28 UTC (rev 88432)
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script>
+var successfullyParsed = false;
+</script>
+<script src=""
+</head>
+<body id="body">
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("This test just prints the name of the current platform.");
+if (window.layoutTestController) {
+  layoutTestController.dumpAsText();
+
+  debug("Platform name: " + layoutTestController.platformName);
+}
+successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/platform/gtk/accessibility/platform-name-expected.txt (0 => 88432)


--- trunk/LayoutTests/platform/gtk/accessibility/platform-name-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/accessibility/platform-name-expected.txt	2011-06-09 07:35:28 UTC (rev 88432)
@@ -0,0 +1,10 @@
+This test just prints the name of the current platform.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Platform name: gtk
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/mac/accessibility/platform-name-expected.txt (0 => 88432)


--- trunk/LayoutTests/platform/mac/accessibility/platform-name-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/platform-name-expected.txt	2011-06-09 07:35:28 UTC (rev 88432)
@@ -0,0 +1,10 @@
+This test just prints the name of the current platform.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Platform name: mac
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/win/accessibility/platform-name-expected.txt (0 => 88432)


--- trunk/LayoutTests/platform/win/accessibility/platform-name-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/win/accessibility/platform-name-expected.txt	2011-06-09 07:35:28 UTC (rev 88432)
@@ -0,0 +1,10 @@
+This test just prints the name of the current platform.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Platform name: win
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/Tools/ChangeLog (88431 => 88432)


--- trunk/Tools/ChangeLog	2011-06-09 06:55:33 UTC (rev 88431)
+++ trunk/Tools/ChangeLog	2011-06-09 07:35:28 UTC (rev 88432)
@@ -1,3 +1,31 @@
+2011-06-09  Mario Sanchez Prada  <[email protected]>
+
+        Reviewed by Chris Fleizach.
+
+        [GTK] Provide a way in DRT to check the platform name
+        https://bugs.webkit.org/show_bug.cgi?id=56855
+
+        Patch for adding 'platformName' static property to DRT's
+        LayoutController and provide platform specific implementations.
+
+        In principle, this feature will be only of interest for writing
+        accessibility tests, so that's why it's only implemented in the
+        Mac, Gtk and Win platforms.
+
+        * DumpRenderTree/LayoutTestController.h: New method platformName().
+        * DumpRenderTree/LayoutTestController.cpp:
+        (getPlatformNameCallback): New callback for 'platformName'.
+        (LayoutTestController::staticValues): New static property.
+
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::platformName): Implemented.
+
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        (LayoutTestController::platformName): Implemented.
+
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::platformName): Implemented.
+
 2011-06-08  Mike Lawther  <[email protected]>
 
         Reviewed by James Robinson.

Modified: trunk/Tools/DumpRenderTree/LayoutTestController.cpp (88431 => 88432)


--- trunk/Tools/DumpRenderTree/LayoutTestController.cpp	2011-06-09 06:55:33 UTC (rev 88431)
+++ trunk/Tools/DumpRenderTree/LayoutTestController.cpp	2011-06-09 07:35:28 UTC (rev 88432)
@@ -2192,6 +2192,17 @@
     return JSValueMakeNumber(context, controller->workerThreadCount());
 }
 
+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(WIN)
+static JSValueRef getPlatformNameCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    JSRetainPtr<JSStringRef> platformName(controller->platformName());
+    if (!platformName.get())
+        return JSValueMakeUndefined(context);
+    return JSValueMakeString(context, platformName.get());
+}
+#endif
+
 static bool setGlobalFlagCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception)
 {
     LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -2262,6 +2273,9 @@
         { "globalFlag", getGlobalFlagCallback, setGlobalFlagCallback, kJSPropertyAttributeNone },
         { "webHistoryItemCount", getWebHistoryItemCountCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "workerThreadCount", getWorkerThreadCountCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(WIN)
+        { "platformName", getPlatformNameCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+#endif
         { 0, 0, 0, 0 }
     };
     return staticValues;

Modified: trunk/Tools/DumpRenderTree/LayoutTestController.h (88431 => 88432)


--- trunk/Tools/DumpRenderTree/LayoutTestController.h	2011-06-09 06:55:33 UTC (rev 88431)
+++ trunk/Tools/DumpRenderTree/LayoutTestController.h	2011-06-09 07:35:28 UTC (rev 88432)
@@ -139,6 +139,10 @@
     unsigned workerThreadCount() const;
     int windowCount();
     
+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(WIN)
+    JSRetainPtr<JSStringRef> platformName() const;
+#endif
+
     void grantDesktopNotificationPermission(JSStringRef origin);
     bool checkDesktopNotificationPermission(JSStringRef origin);
 

Modified: trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp (88431 => 88432)


--- trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp	2011-06-09 06:55:33 UTC (rev 88431)
+++ trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp	2011-06-09 07:35:28 UTC (rev 88432)
@@ -185,6 +185,12 @@
     return DumpRenderTreeSupportGtk::workerThreadCount();
 }
 
+JSRetainPtr<JSStringRef> LayoutTestController::platformName() const
+{
+    JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("gtk"));
+    return platformName;
+}
+
 void LayoutTestController::notifyDone()
 {
     if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count())

Modified: trunk/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm (88431 => 88432)


--- trunk/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm	2011-06-09 06:55:33 UTC (rev 88431)
+++ trunk/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm	2011-06-09 07:35:28 UTC (rev 88432)
@@ -352,6 +352,12 @@
     return [WebWorkersPrivate workerThreadCount];
 }
 
+JSRetainPtr<JSStringRef> LayoutTestController::platformName() const
+{
+    JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("mac"));
+    return platformName;
+}
+
 void LayoutTestController::notifyDone()
 {
     if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count())

Modified: trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp (88431 => 88432)


--- trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp	2011-06-09 06:55:33 UTC (rev 88431)
+++ trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp	2011-06-09 07:35:28 UTC (rev 88432)
@@ -297,6 +297,12 @@
     return count;
 }
 
+JSRetainPtr<JSStringRef> LayoutTestController::platformName() const
+{
+    JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("win"));
+    return platformName;
+}
+
 void LayoutTestController::notifyDone()
 {
     // Same as on mac.  This can be shared.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to