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/test_runner/test_plugin.h" | 5 #include "content/shell/test_runner/test_plugin.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 void PrintEventDetails(WebTestDelegate* delegate, | 81 void PrintEventDetails(WebTestDelegate* delegate, |
82 const blink::WebInputEvent& event) { | 82 const blink::WebInputEvent& event) { |
83 if (blink::WebInputEvent::isTouchEventType(event.type())) { | 83 if (blink::WebInputEvent::isTouchEventType(event.type())) { |
84 const blink::WebTouchEvent& touch = | 84 const blink::WebTouchEvent& touch = |
85 static_cast<const blink::WebTouchEvent&>(event); | 85 static_cast<const blink::WebTouchEvent&>(event); |
86 PrintTouchList(delegate, touch.touches, touch.touchesLength); | 86 PrintTouchList(delegate, touch.touches, touch.touchesLength); |
87 } else if (blink::WebInputEvent::isMouseEventType(event.type()) || | 87 } else if (blink::WebInputEvent::isMouseEventType(event.type()) || |
88 event.type() == blink::WebInputEvent::MouseWheel) { | 88 event.type() == blink::WebInputEvent::MouseWheel) { |
89 const blink::WebMouseEvent& mouse = | 89 const blink::WebMouseEvent& mouse = |
90 static_cast<const blink::WebMouseEvent&>(event); | 90 static_cast<const blink::WebMouseEvent&>(event); |
91 delegate->PrintMessage(base::StringPrintf("* %d, %d\n", mouse.x, mouse.y)); | 91 delegate->PrintMessage(base::StringPrintf("* %.2f, %.2f\n", |
| 92 mouse.positionInWidget().x, |
| 93 mouse.positionInWidget().y)); |
92 } else if (blink::WebInputEvent::isGestureEventType(event.type())) { | 94 } else if (blink::WebInputEvent::isGestureEventType(event.type())) { |
93 const blink::WebGestureEvent& gesture = | 95 const blink::WebGestureEvent& gesture = |
94 static_cast<const blink::WebGestureEvent&>(event); | 96 static_cast<const blink::WebGestureEvent&>(event); |
95 delegate->PrintMessage( | 97 delegate->PrintMessage( |
96 base::StringPrintf("* %d, %d\n", gesture.x, gesture.y)); | 98 base::StringPrintf("* %d, %d\n", gesture.x, gesture.y)); |
97 } | 99 } |
98 } | 100 } |
99 | 101 |
100 blink::WebPluginContainer::TouchEventRequestType ParseTouchEventRequestType( | 102 blink::WebPluginContainer::TouchEventRequestType ParseTouchEventRequestType( |
101 const blink::WebString& string) { | 103 const blink::WebString& string) { |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 return kPluginPersistsMimeType; | 612 return kPluginPersistsMimeType; |
611 } | 613 } |
612 | 614 |
613 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { | 615 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { |
614 return mime_type == TestPlugin::MimeType() || | 616 return mime_type == TestPlugin::MimeType() || |
615 mime_type == PluginPersistsMimeType() || | 617 mime_type == PluginPersistsMimeType() || |
616 mime_type == CanCreateWithoutRendererMimeType(); | 618 mime_type == CanCreateWithoutRendererMimeType(); |
617 } | 619 } |
618 | 620 |
619 } // namespace test_runner | 621 } // namespace test_runner |
OLD | NEW |