| 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> |
| 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 "content/shell/test_runner/web_test_delegate.h" | 20 #include "content/shell/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/Platform.h" | 22 #include "third_party/WebKit/public/platform/Platform.h" |
| 23 #include "third_party/WebKit/public/platform/WebCoalescedInputEvent.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/WebMouseEvent.h" | 28 #include "third_party/WebKit/public/platform/WebMouseEvent.h" |
| 28 #include "third_party/WebKit/public/platform/WebThread.h" | 29 #include "third_party/WebKit/public/platform/WebThread.h" |
| 29 #include "third_party/WebKit/public/platform/WebTouchEvent.h" | 30 #include "third_party/WebKit/public/platform/WebTouchEvent.h" |
| 30 #include "third_party/WebKit/public/platform/WebTouchPoint.h" | 31 #include "third_party/WebKit/public/platform/WebTouchPoint.h" |
| 31 #include "third_party/WebKit/public/platform/WebTraceLocation.h" | 32 #include "third_party/WebKit/public/platform/WebTraceLocation.h" |
| 32 #include "third_party/WebKit/public/platform/WebURL.h" | 33 #include "third_party/WebKit/public/platform/WebURL.h" |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 } | 533 } |
| 533 if (vertex_shader) | 534 if (vertex_shader) |
| 534 gl_->DeleteShader(vertex_shader); | 535 gl_->DeleteShader(vertex_shader); |
| 535 if (fragment_shader) | 536 if (fragment_shader) |
| 536 gl_->DeleteShader(fragment_shader); | 537 gl_->DeleteShader(fragment_shader); |
| 537 | 538 |
| 538 return program; | 539 return program; |
| 539 } | 540 } |
| 540 | 541 |
| 541 blink::WebInputEventResult TestPlugin::HandleInputEvent( | 542 blink::WebInputEventResult TestPlugin::HandleInputEvent( |
| 542 const blink::WebInputEvent& event, | 543 const blink::WebCoalescedInputEvent& coalesced_event, |
| 543 blink::WebCursorInfo& info) { | 544 blink::WebCursorInfo& info) { |
| 545 const blink::WebInputEvent& event = coalesced_event.Event(); |
| 544 const char* event_name = blink::WebInputEvent::GetName(event.GetType()); | 546 const char* event_name = blink::WebInputEvent::GetName(event.GetType()); |
| 545 if (!strcmp(event_name, "") || !strcmp(event_name, "Undefined")) | 547 if (!strcmp(event_name, "") || !strcmp(event_name, "Undefined")) |
| 546 event_name = "unknown"; | 548 event_name = "unknown"; |
| 547 delegate_->PrintMessage(std::string("Plugin received event: ") + event_name + | 549 delegate_->PrintMessage(std::string("Plugin received event: ") + event_name + |
| 548 "\n"); | 550 "\n"); |
| 549 if (print_event_details_) | 551 if (print_event_details_) |
| 550 PrintEventDetails(delegate_, event); | 552 PrintEventDetails(delegate_, event); |
| 551 if (print_user_gesture_status_) | 553 if (print_user_gesture_status_) |
| 552 delegate_->PrintMessage( | 554 delegate_->PrintMessage( |
| 553 std::string("* ") + | 555 std::string("* ") + |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 return kPluginPersistsMimeType; | 615 return kPluginPersistsMimeType; |
| 614 } | 616 } |
| 615 | 617 |
| 616 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { | 618 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { |
| 617 return mime_type == TestPlugin::MimeType() || | 619 return mime_type == TestPlugin::MimeType() || |
| 618 mime_type == PluginPersistsMimeType() || | 620 mime_type == PluginPersistsMimeType() || |
| 619 mime_type == CanCreateWithoutRendererMimeType(); | 621 mime_type == CanCreateWithoutRendererMimeType(); |
| 620 } | 622 } |
| 621 | 623 |
| 622 } // namespace test_runner | 624 } // namespace test_runner |
| OLD | NEW |