OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |