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

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

Issue 436133002: Migrate TestCommon to Chromium c++ style and remove un-used header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated for layout test 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 3bd80a076e96bd44229f8f0033c59ee441250c8c..cb33167043671119c532df2d5330a03fe0bf0136 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,14 +87,10 @@ const char* pointState(WebTouchPoint::State state)
void printTouchList(WebTestDelegate* delegate, const WebTouchPoint* points, int length)
{
for (int i = 0; i < length; ++i) {
- 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);
+ delegate->printMessage(base::StringPrintf("* %.2f, %.2f: %s\n",
+ points[i].position.x,
+ points[i].position.y,
+ pointState(points[i].state)));
}
}
@@ -107,14 +103,12 @@ void printEventDetails(WebTestDelegate* delegate, const WebInputEvent& event)
printTouchList(delegate, touch.targetTouches, touch.targetTouchesLength);
} else if (WebInputEvent::isMouseEventType(event.type) || event.type == WebInputEvent::MouseWheel) {
const WebMouseEvent& mouse = static_cast<const WebMouseEvent&>(event);
- char buffer[100];
- snprintf(buffer, sizeof(buffer), "* %d, %d\n", mouse.x, mouse.y);
- delegate->printMessage(buffer);
+ delegate->printMessage(
+ base::StringPrintf("* %d, %d\n", mouse.x, mouse.y));
} else if (WebInputEvent::isGestureEventType(event.type)) {
const WebGestureEvent& gesture = static_cast<const WebGestureEvent&>(event);
- char buffer[100];
- snprintf(buffer, sizeof(buffer), "* %d, %d\n", gesture.x, gesture.y);
- delegate->printMessage(buffer);
+ delegate->printMessage(
+ base::StringPrintf("* %d, %d\n", gesture.x, gesture.y));
}
}
« 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