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

Side by Side Diff: content/shell/renderer/test_runner/TestPlugin.cpp

Issue 148453012: Chrome requires WebTouchPoint to store WebFloatPoint, instead of WebPoint. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing ugly floating point error fix Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/renderer/test_runner/TestPlugin.h" 5 #include "content/shell/renderer/test_runner/TestPlugin.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return "Cancelled"; 82 return "Cancelled";
83 default: 83 default:
84 return "Unknown"; 84 return "Unknown";
85 } 85 }
86 } 86 }
87 87
88 void printTouchList(WebTestDelegate* delegate, const WebTouchPoint* points, int length) 88 void printTouchList(WebTestDelegate* delegate, const WebTouchPoint* points, int length)
89 { 89 {
90 for (int i = 0; i < length; ++i) { 90 for (int i = 0; i < length; ++i) {
91 char buffer[100]; 91 char buffer[100];
92 snprintf(buffer, sizeof(buffer), "* %d, %d: %s\n", static_cast<int>(poin ts[i].position.x), static_cast<int>(points[i].position.y), pointState(points[i]. state)); 92 snprintf(buffer,
93 sizeof(buffer),
94 "* %f, %f: %s\n",
95 points[i].position.x,
96 points[i].position.y,
97 pointState(points[i].state));
93 delegate->printMessage(buffer); 98 delegate->printMessage(buffer);
94 } 99 }
95 } 100 }
96 101
97 void printEventDetails(WebTestDelegate* delegate, const WebInputEvent& event) 102 void printEventDetails(WebTestDelegate* delegate, const WebInputEvent& event)
98 { 103 {
99 if (WebInputEvent::isTouchEventType(event.type)) { 104 if (WebInputEvent::isTouchEventType(event.type)) {
100 const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(event); 105 const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(event);
101 printTouchList(delegate, touch.touches, touch.touchesLength); 106 printTouchList(delegate, touch.touches, touch.touchesLength);
102 printTouchList(delegate, touch.changedTouches, touch.changedTouchesLengt h); 107 printTouchList(delegate, touch.changedTouches, touch.changedTouchesLengt h);
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 } 692 }
688 693
689 bool TestPlugin::isSupportedMimeType(const WebString& mimeType) 694 bool TestPlugin::isSupportedMimeType(const WebString& mimeType)
690 { 695 {
691 return mimeType == TestPlugin::mimeType() 696 return mimeType == TestPlugin::mimeType()
692 || mimeType == pluginPersistsMimeType() 697 || mimeType == pluginPersistsMimeType()
693 || mimeType == canCreateWithoutRendererMimeType(); 698 || mimeType == canCreateWithoutRendererMimeType();
694 } 699 }
695 700
696 } 701 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698