Title: [137439] trunk/Tools
Revision
137439
Author
joc...@chromium.org
Date
2012-12-12 02:37:31 -0800 (Wed, 12 Dec 2012)

Log Message

[chromium] WebTestPlugin must not depend on WTF::String
https://bugs.webkit.org/show_bug.cgi?id=104783

Reviewed by Kent Tamura.

In a component build, we can't access the WTF that is part of the
WebKit component. Accessing WTF instead will pull in a separate copy
into the TestRunner library. Instead of WTF::String::number use
snprintf() to print numbers.

* DumpRenderTree/chromium/TestRunner/src/WebTestPlugin.cpp:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (137438 => 137439)


--- trunk/Tools/ChangeLog	2012-12-12 10:23:51 UTC (rev 137438)
+++ trunk/Tools/ChangeLog	2012-12-12 10:37:31 UTC (rev 137439)
@@ -1,3 +1,17 @@
+2012-12-12  Jochen Eisinger  <joc...@chromium.org>
+
+        [chromium] WebTestPlugin must not depend on WTF::String
+        https://bugs.webkit.org/show_bug.cgi?id=104783
+
+        Reviewed by Kent Tamura.
+
+        In a component build, we can't access the WTF that is part of the
+        WebKit component. Accessing WTF instead will pull in a separate copy
+        into the TestRunner library. Instead of WTF::String::number use
+        snprintf() to print numbers.
+
+        * DumpRenderTree/chromium/TestRunner/src/WebTestPlugin.cpp:
+
 2012-12-12  Jocelyn Turcotte  <jocelyn.turco...@digia.com>
 
         [Qt] Do not automatically enable force_static_libs_as_shared when using debug_and_release

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestPlugin.cpp (137438 => 137439)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestPlugin.cpp	2012-12-12 10:23:51 UTC (rev 137438)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestPlugin.cpp	2012-12-12 10:37:31 UTC (rev 137439)
@@ -37,7 +37,6 @@
 #include "platform/WebKitPlatformSupport.h"
 #include <wtf/Assertions.h>
 #include <wtf/text/CString.h>
-#include <wtf/text/WTFString.h>
 
 using namespace WebKit;
 
@@ -104,8 +103,11 @@
 
 void printTouchList(WebTestDelegate* delegate, const WebTouchPoint* points, int length)
 {
-    for (int i = 0; i < length; ++i)
-        delegate->printMessage(std::string("* ") + String::number(points[i].position.x).ascii().data() + ", " + String::number(points[i].position.y).ascii().data() + ": " + pointState(points[i].state) + "\n");
+    for (int i = 0; i < length; ++i) {
+        char buffer[100];
+        snprintf(buffer, sizeof(buffer), "* %d, %d: %s\n", points[i].position.x, points[i].position.y, pointState(points[i].state));
+        delegate->printMessage(buffer);
+    }
 }
 
 void printEventDetails(WebTestDelegate* delegate, const WebInputEvent& event)
@@ -117,10 +119,14 @@
         printTouchList(delegate, touch.targetTouches, touch.targetTouchesLength);
     } else if (WebInputEvent::isMouseEventType(event.type) || event.type == WebInputEvent::MouseWheel) {
         const WebMouseEvent& mouse = static_cast<const WebMouseEvent&>(event);
-        delegate->printMessage(std::string("* ") + String::number(mouse.x).ascii().data() + ", " + String::number(mouse.y).ascii().data() + "\n");
+        char buffer[100];
+        snprintf(buffer, sizeof(buffer), "* %d, %d\n", mouse.x, mouse.y);
+        delegate->printMessage(buffer);
     } else if (WebInputEvent::isGestureEventType(event.type)) {
         const WebGestureEvent& gesture = static_cast<const WebGestureEvent&>(event);
-        delegate->printMessage(std::string("* ") + String::number(gesture.x).ascii().data() + ", " + String::number(gesture.y).ascii().data() + "\n");
+        char buffer[100];
+        snprintf(buffer, sizeof(buffer), "* %d, %d\n", gesture.x, gesture.y);
+        delegate->printMessage(buffer);
     }
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to