Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2733)

Unified Diff: content/shell/renderer/test_runner/TestPlugin.cpp

Issue 439973002: Revert of Migrate TestCommon to Chromium c++ style and remove un-used header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/shell/renderer/test_runner/TestPlugin.cpp
diff --git a/content/shell/renderer/test_runner/TestPlugin.cpp b/content/shell/renderer/test_runner/TestPlugin.cpp
index a42721b89623fbb07d3e2beb0211145e8db37621..3bd80a076e96bd44229f8f0033c59ee441250c8c 100644
--- a/content/shell/renderer/test_runner/TestPlugin.cpp
+++ b/content/shell/renderer/test_runner/TestPlugin.cpp
@@ -8,8 +8,8 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/memory/shared_memory.h"
-#include "base/strings/stringprintf.h"
#include "content/public/renderer/render_thread.h"
+#include "content/shell/renderer/test_runner/TestCommon.h"
#include "content/shell/renderer/test_runner/WebTestDelegate.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
@@ -87,10 +87,14 @@
void printTouchList(WebTestDelegate* delegate, const WebTouchPoint* points, int length)
{
for (int i = 0; i < length; ++i) {
- base::StringPrintf("* %.2f, %.2f: %s\n",
- points[i].position.x,
- points[i].position.y,
- pointState(points[i].state));
+ char buffer[100];
+ snprintf(buffer,
+ sizeof(buffer),
+ "* %.2f, %.2f: %s\n",
+ points[i].position.x,
+ points[i].position.y,
+ pointState(points[i].state));
+ delegate->printMessage(buffer);
}
}
@@ -103,10 +107,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);
- base::StringPrintf("* %d, %d\n", mouse.x, mouse.y);
+ 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);
- base::StringPrintf("* %d, %d\n", gesture.x, gesture.y);
+ char buffer[100];
+ snprintf(buffer, sizeof(buffer), "* %d, %d\n", gesture.x, gesture.y);
+ delegate->printMessage(buffer);
}
}
« no previous file with comments | « content/shell/renderer/test_runner/TestCommon.cpp ('k') | content/shell/renderer/test_runner/mock_color_chooser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698