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 "components/test_runner/test_plugin.h" | 5 #include "components/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> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
15 #include "base/memory/shared_memory.h" | 15 #include "base/memory/shared_memory.h" |
16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
17 #include "cc/blink/web_layer_impl.h" | 17 #include "cc/blink/web_layer_impl.h" |
18 #include "cc/layers/texture_layer.h" | 18 #include "cc/layers/texture_layer.h" |
19 #include "cc/resources/shared_bitmap_manager.h" | 19 #include "cc/resources/shared_bitmap_manager.h" |
20 #include "components/test_runner/web_test_delegate.h" | 20 #include "components/test_runner/web_test_delegate.h" |
21 #include "gpu/command_buffer/client/gles2_interface.h" | 21 #include "gpu/command_buffer/client/gles2_interface.h" |
| 22 #include "third_party/WebKit/public/platform/CoalescedWebInputEvent.h" |
22 #include "third_party/WebKit/public/platform/Platform.h" | 23 #include "third_party/WebKit/public/platform/Platform.h" |
23 #include "third_party/WebKit/public/platform/WebCompositorSupport.h" | 24 #include "third_party/WebKit/public/platform/WebCompositorSupport.h" |
24 #include "third_party/WebKit/public/platform/WebGestureEvent.h" | 25 #include "third_party/WebKit/public/platform/WebGestureEvent.h" |
25 #include "third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h" | 26 #include "third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h" |
26 #include "third_party/WebKit/public/platform/WebInputEvent.h" | 27 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
27 #include "third_party/WebKit/public/platform/WebThread.h" | 28 #include "third_party/WebKit/public/platform/WebThread.h" |
28 #include "third_party/WebKit/public/platform/WebTouchPoint.h" | 29 #include "third_party/WebKit/public/platform/WebTouchPoint.h" |
29 #include "third_party/WebKit/public/platform/WebTraceLocation.h" | 30 #include "third_party/WebKit/public/platform/WebTraceLocation.h" |
30 #include "third_party/WebKit/public/platform/WebURL.h" | 31 #include "third_party/WebKit/public/platform/WebURL.h" |
31 #include "third_party/WebKit/public/web/WebFrame.h" | 32 #include "third_party/WebKit/public/web/WebFrame.h" |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 } | 530 } |
530 if (vertex_shader) | 531 if (vertex_shader) |
531 gl_->DeleteShader(vertex_shader); | 532 gl_->DeleteShader(vertex_shader); |
532 if (fragment_shader) | 533 if (fragment_shader) |
533 gl_->DeleteShader(fragment_shader); | 534 gl_->DeleteShader(fragment_shader); |
534 | 535 |
535 return program; | 536 return program; |
536 } | 537 } |
537 | 538 |
538 blink::WebInputEventResult TestPlugin::handleInputEvent( | 539 blink::WebInputEventResult TestPlugin::handleInputEvent( |
539 const blink::WebInputEvent& event, | 540 const blink::CoalescedWebInputEvent& coalescedEvent, |
540 blink::WebCursorInfo& info) { | 541 blink::WebCursorInfo& info) { |
541 const char* event_name = blink::WebInputEvent::GetName(event.type); | 542 const char* event_name = |
| 543 blink::WebInputEvent::GetName(coalescedEvent.event().type); |
542 if (!strcmp(event_name, "") || !strcmp(event_name, "Undefined")) | 544 if (!strcmp(event_name, "") || !strcmp(event_name, "Undefined")) |
543 event_name = "unknown"; | 545 event_name = "unknown"; |
544 delegate_->PrintMessage(std::string("Plugin received event: ") + event_name + | 546 delegate_->PrintMessage(std::string("Plugin received event: ") + event_name + |
545 "\n"); | 547 "\n"); |
546 if (print_event_details_) | 548 if (print_event_details_) |
547 PrintEventDetails(delegate_, event); | 549 PrintEventDetails(delegate_, coalescedEvent.event()); |
548 if (print_user_gesture_status_) | 550 if (print_user_gesture_status_) |
549 delegate_->PrintMessage( | 551 delegate_->PrintMessage( |
550 std::string("* ") + | 552 std::string("* ") + |
551 (blink::WebUserGestureIndicator::isProcessingUserGesture() ? "" | 553 (blink::WebUserGestureIndicator::isProcessingUserGesture() ? "" |
552 : "not ") + | 554 : "not ") + |
553 "handling user gesture\n"); | 555 "handling user gesture\n"); |
554 if (is_persistent_) | 556 if (is_persistent_) |
555 delegate_->PrintMessage(std::string("TestPlugin: isPersistent\n")); | 557 delegate_->PrintMessage(std::string("TestPlugin: isPersistent\n")); |
556 return blink::WebInputEventResult::NotHandled; | 558 return blink::WebInputEventResult::NotHandled; |
557 } | 559 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 return kPluginPersistsMimeType; | 614 return kPluginPersistsMimeType; |
613 } | 615 } |
614 | 616 |
615 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { | 617 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { |
616 return mime_type == TestPlugin::MimeType() || | 618 return mime_type == TestPlugin::MimeType() || |
617 mime_type == PluginPersistsMimeType() || | 619 mime_type == PluginPersistsMimeType() || |
618 mime_type == CanCreateWithoutRendererMimeType(); | 620 mime_type == CanCreateWithoutRendererMimeType(); |
619 } | 621 } |
620 | 622 |
621 } // namespace test_runner | 623 } // namespace test_runner |
OLD | NEW |