| 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 "content/shell/renderer/test_runner/TestCommon.h" | 8 #include "content/shell/renderer/test_runner/TestCommon.h" |
| 9 #include "content/shell/renderer/test_runner/WebTestDelegate.h" | 9 #include "content/shell/renderer/test_runner/WebTestDelegate.h" |
| 10 #include "third_party/WebKit/public/platform/Platform.h" | 10 #include "third_party/WebKit/public/platform/Platform.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 | 79 |
| 80 BLINK_ASSERT_NOT_REACHED(); | 80 BLINK_ASSERT_NOT_REACHED(); |
| 81 return 0; | 81 return 0; |
| 82 } | 82 } |
| 83 | 83 |
| 84 void printTouchList(WebTestDelegate* delegate, const WebTouchPoint* points, int
length) | 84 void printTouchList(WebTestDelegate* delegate, const WebTouchPoint* points, int
length) |
| 85 { | 85 { |
| 86 for (int i = 0; i < length; ++i) { | 86 for (int i = 0; i < length; ++i) { |
| 87 char buffer[100]; | 87 char buffer[100]; |
| 88 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)); | 88 snprintf(buffer, |
| 89 sizeof(buffer), |
| 90 "* %f, %f: %s\n", |
| 91 points[i].position.x, |
| 92 points[i].position.y, |
| 93 pointState(points[i].state)); |
| 89 delegate->printMessage(buffer); | 94 delegate->printMessage(buffer); |
| 90 } | 95 } |
| 91 } | 96 } |
| 92 | 97 |
| 93 void printEventDetails(WebTestDelegate* delegate, const WebInputEvent& event) | 98 void printEventDetails(WebTestDelegate* delegate, const WebInputEvent& event) |
| 94 { | 99 { |
| 95 if (WebInputEvent::isTouchEventType(event.type)) { | 100 if (WebInputEvent::isTouchEventType(event.type)) { |
| 96 const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(event); | 101 const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(event); |
| 97 printTouchList(delegate, touch.touches, touch.touchesLength); | 102 printTouchList(delegate, touch.touches, touch.touchesLength); |
| 98 printTouchList(delegate, touch.changedTouches, touch.changedTouchesLengt
h); | 103 printTouchList(delegate, touch.changedTouches, touch.changedTouchesLengt
h); |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 } | 605 } |
| 601 | 606 |
| 602 bool TestPlugin::isSupportedMimeType(const WebString& mimeType) | 607 bool TestPlugin::isSupportedMimeType(const WebString& mimeType) |
| 603 { | 608 { |
| 604 return mimeType == TestPlugin::mimeType() | 609 return mimeType == TestPlugin::mimeType() |
| 605 || mimeType == pluginPersistsMimeType() | 610 || mimeType == pluginPersistsMimeType() |
| 606 || mimeType == canCreateWithoutRendererMimeType(); | 611 || mimeType == canCreateWithoutRendererMimeType(); |
| 607 } | 612 } |
| 608 | 613 |
| 609 } | 614 } |
| OLD | NEW |