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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, | 92 snprintf(buffer, |
93 sizeof(buffer), | 93 sizeof(buffer), |
94 "* %f, %f: %s\n", | 94 "* %.2f, %.2f: %s\n", |
95 points[i].position.x, | 95 points[i].position.x, |
96 points[i].position.y, | 96 points[i].position.y, |
97 pointState(points[i].state)); | 97 pointState(points[i].state)); |
98 delegate->printMessage(buffer); | 98 delegate->printMessage(buffer); |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 void printEventDetails(WebTestDelegate* delegate, const WebInputEvent& event) | 102 void printEventDetails(WebTestDelegate* delegate, const WebInputEvent& event) |
103 { | 103 { |
104 if (WebInputEvent::isTouchEventType(event.type)) { | 104 if (WebInputEvent::isTouchEventType(event.type)) { |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 } | 692 } |
693 | 693 |
694 bool TestPlugin::isSupportedMimeType(const WebString& mimeType) | 694 bool TestPlugin::isSupportedMimeType(const WebString& mimeType) |
695 { | 695 { |
696 return mimeType == TestPlugin::mimeType() | 696 return mimeType == TestPlugin::mimeType() |
697 || mimeType == pluginPersistsMimeType() | 697 || mimeType == pluginPersistsMimeType() |
698 || mimeType == canCreateWithoutRendererMimeType(); | 698 || mimeType == canCreateWithoutRendererMimeType(); |
699 } | 699 } |
700 | 700 |
701 } | 701 } |
OLD | NEW |