| 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/test_plugin.h" | 5 #include "content/shell/renderer/test_runner/test_plugin.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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 PointState(points[i].state))); | 92 PointState(points[i].state))); |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 | 95 |
| 96 void PrintEventDetails(WebTestDelegate* delegate, | 96 void PrintEventDetails(WebTestDelegate* delegate, |
| 97 const blink::WebInputEvent& event) { | 97 const blink::WebInputEvent& event) { |
| 98 if (blink::WebInputEvent::isTouchEventType(event.type)) { | 98 if (blink::WebInputEvent::isTouchEventType(event.type)) { |
| 99 const blink::WebTouchEvent& touch = | 99 const blink::WebTouchEvent& touch = |
| 100 static_cast<const blink::WebTouchEvent&>(event); | 100 static_cast<const blink::WebTouchEvent&>(event); |
| 101 PrintTouchList(delegate, touch.touches, touch.touchesLength); | 101 PrintTouchList(delegate, touch.touches, touch.touchesLength); |
| 102 PrintTouchList(delegate, touch.changedTouches, touch.changedTouchesLength); | |
| 103 PrintTouchList(delegate, touch.targetTouches, touch.targetTouchesLength); | |
| 104 } else if (blink::WebInputEvent::isMouseEventType(event.type) || | 102 } else if (blink::WebInputEvent::isMouseEventType(event.type) || |
| 105 event.type == blink::WebInputEvent::MouseWheel) { | 103 event.type == blink::WebInputEvent::MouseWheel) { |
| 106 const blink::WebMouseEvent& mouse = | 104 const blink::WebMouseEvent& mouse = |
| 107 static_cast<const blink::WebMouseEvent&>(event); | 105 static_cast<const blink::WebMouseEvent&>(event); |
| 108 delegate->printMessage(base::StringPrintf("* %d, %d\n", mouse.x, mouse.y)); | 106 delegate->printMessage(base::StringPrintf("* %d, %d\n", mouse.x, mouse.y)); |
| 109 } else if (blink::WebInputEvent::isGestureEventType(event.type)) { | 107 } else if (blink::WebInputEvent::isGestureEventType(event.type)) { |
| 110 const blink::WebGestureEvent& gesture = | 108 const blink::WebGestureEvent& gesture = |
| 111 static_cast<const blink::WebGestureEvent&>(event); | 109 static_cast<const blink::WebGestureEvent&>(event); |
| 112 delegate->printMessage( | 110 delegate->printMessage( |
| 113 base::StringPrintf("* %d, %d\n", gesture.x, gesture.y)); | 111 base::StringPrintf("* %d, %d\n", gesture.x, gesture.y)); |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 return kPluginPersistsMimeType; | 752 return kPluginPersistsMimeType; |
| 755 } | 753 } |
| 756 | 754 |
| 757 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { | 755 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { |
| 758 return mime_type == TestPlugin::MimeType() || | 756 return mime_type == TestPlugin::MimeType() || |
| 759 mime_type == PluginPersistsMimeType() || | 757 mime_type == PluginPersistsMimeType() || |
| 760 mime_type == CanCreateWithoutRendererMimeType(); | 758 mime_type == CanCreateWithoutRendererMimeType(); |
| 761 } | 759 } |
| 762 | 760 |
| 763 } // namespace content | 761 } // namespace content |
| OLD | NEW |