Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: components/test_runner/event_sender.cc

Issue 1760183002: Fixed missing pointerTypes for touch events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/event_sender.h" 5 #include "components/test_runner/event_sender.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "build/build_config.h" 15 #include "build/build_config.h"
16 #include "components/test_runner/mock_spell_check.h" 16 #include "components/test_runner/mock_spell_check.h"
17 #include "components/test_runner/test_interfaces.h" 17 #include "components/test_runner/test_interfaces.h"
18 #include "components/test_runner/web_test_delegate.h" 18 #include "components/test_runner/web_test_delegate.h"
19 #include "components/test_runner/web_test_proxy.h" 19 #include "components/test_runner/web_test_proxy.h"
20 #include "gin/handle.h" 20 #include "gin/handle.h"
21 #include "gin/object_template_builder.h" 21 #include "gin/object_template_builder.h"
22 #include "gin/wrappable.h" 22 #include "gin/wrappable.h"
23 #include "third_party/WebKit/public/platform/WebPointerProperties.h"
23 #include "third_party/WebKit/public/platform/WebString.h" 24 #include "third_party/WebKit/public/platform/WebString.h"
24 #include "third_party/WebKit/public/platform/WebVector.h" 25 #include "third_party/WebKit/public/platform/WebVector.h"
25 #include "third_party/WebKit/public/web/WebContextMenuData.h" 26 #include "third_party/WebKit/public/web/WebContextMenuData.h"
26 #include "third_party/WebKit/public/web/WebFrame.h" 27 #include "third_party/WebKit/public/web/WebFrame.h"
27 #include "third_party/WebKit/public/web/WebKit.h" 28 #include "third_party/WebKit/public/web/WebKit.h"
28 #include "third_party/WebKit/public/web/WebPagePopup.h" 29 #include "third_party/WebKit/public/web/WebPagePopup.h"
29 #include "third_party/WebKit/public/web/WebView.h" 30 #include "third_party/WebKit/public/web/WebView.h"
30 #include "ui/events/keycodes/dom/keycode_converter.h" 31 #include "ui/events/keycodes/dom/keycode_converter.h"
31 #include "ui/events/keycodes/keyboard_codes.h" 32 #include "ui/events/keycodes/keyboard_codes.h"
32 #include "v8/include/v8.h" 33 #include "v8/include/v8.h"
33 34
34 using blink::WebContextMenuData; 35 using blink::WebContextMenuData;
35 using blink::WebDragData; 36 using blink::WebDragData;
36 using blink::WebDragOperationsMask; 37 using blink::WebDragOperationsMask;
37 using blink::WebFloatPoint; 38 using blink::WebFloatPoint;
38 using blink::WebFrame; 39 using blink::WebFrame;
39 using blink::WebGestureEvent; 40 using blink::WebGestureEvent;
40 using blink::WebInputEvent; 41 using blink::WebInputEvent;
41 using blink::WebInputEventResult; 42 using blink::WebInputEventResult;
42 using blink::WebKeyboardEvent; 43 using blink::WebKeyboardEvent;
43 using blink::WebMenuItemInfo; 44 using blink::WebMenuItemInfo;
44 using blink::WebMouseEvent; 45 using blink::WebMouseEvent;
45 using blink::WebMouseWheelEvent; 46 using blink::WebMouseWheelEvent;
46 using blink::WebPagePopup; 47 using blink::WebPagePopup;
47 using blink::WebPoint; 48 using blink::WebPoint;
49 using blink::WebPointerProperties;
48 using blink::WebString; 50 using blink::WebString;
49 using blink::WebTouchEvent; 51 using blink::WebTouchEvent;
50 using blink::WebTouchPoint; 52 using blink::WebTouchPoint;
51 using blink::WebVector; 53 using blink::WebVector;
52 using blink::WebView; 54 using blink::WebView;
53 55
54 namespace test_runner { 56 namespace test_runner {
55 57
56 namespace { 58 namespace {
57 59
(...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 void EventSender::UpdateTouchPoint(unsigned index, 1712 void EventSender::UpdateTouchPoint(unsigned index,
1711 float x, 1713 float x,
1712 float y, 1714 float y,
1713 gin::Arguments* args) { 1715 gin::Arguments* args) {
1714 if (index >= touch_points_.size()) { 1716 if (index >= touch_points_.size()) {
1715 ThrowTouchPointError(); 1717 ThrowTouchPointError();
1716 return; 1718 return;
1717 } 1719 }
1718 1720
1719 WebTouchPoint* touch_point = &touch_points_[index]; 1721 WebTouchPoint* touch_point = &touch_points_[index];
1722 touch_point->pointerType = WebPointerProperties::PointerType::Touch;
1720 touch_point->state = WebTouchPoint::StateMoved; 1723 touch_point->state = WebTouchPoint::StateMoved;
1721 touch_point->position = WebFloatPoint(x, y); 1724 touch_point->position = WebFloatPoint(x, y);
1722 touch_point->screenPosition = touch_point->position; 1725 touch_point->screenPosition = touch_point->position;
1723 1726
1724 InitPointerProperties(args, touch_point, &touch_point->radiusX, 1727 InitPointerProperties(args, touch_point, &touch_point->radiusX,
1725 &touch_point->radiusY); 1728 &touch_point->radiusY);
1726 } 1729 }
1727 1730
1728 void EventSender::CancelTouchPoint(unsigned index) { 1731 void EventSender::CancelTouchPoint(unsigned index) {
1729 if (index >= touch_points_.size()) { 1732 if (index >= touch_points_.size()) {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1890 // need/want that. 1893 // need/want that.
1891 is_drag_mode_ = false; 1894 is_drag_mode_ = false;
1892 1895
1893 // Make the rest of eventSender think a drag is in progress. 1896 // Make the rest of eventSender think a drag is in progress.
1894 pressed_button_ = WebMouseEvent::ButtonLeft; 1897 pressed_button_ = WebMouseEvent::ButtonLeft;
1895 current_buttons_ |= GetWebMouseEventModifierForButton(pressed_button_); 1898 current_buttons_ |= GetWebMouseEventModifierForButton(pressed_button_);
1896 } 1899 }
1897 1900
1898 void EventSender::AddTouchPoint(float x, float y, gin::Arguments* args) { 1901 void EventSender::AddTouchPoint(float x, float y, gin::Arguments* args) {
1899 WebTouchPoint touch_point; 1902 WebTouchPoint touch_point;
1903 touch_point.pointerType = WebPointerProperties::PointerType::Touch;
1900 touch_point.state = WebTouchPoint::StatePressed; 1904 touch_point.state = WebTouchPoint::StatePressed;
1901 touch_point.position = WebFloatPoint(x, y); 1905 touch_point.position = WebFloatPoint(x, y);
1902 touch_point.screenPosition = touch_point.position; 1906 touch_point.screenPosition = touch_point.position;
1903 1907
1904 int highest_id = -1; 1908 int highest_id = -1;
1905 for (size_t i = 0; i < touch_points_.size(); i++) { 1909 for (size_t i = 0; i < touch_points_.size(); i++) {
1906 if (touch_points_[i].id > highest_id) 1910 if (touch_points_[i].id > highest_id)
1907 highest_id = touch_points_[i].id; 1911 highest_id = touch_points_[i].id;
1908 } 1912 }
1909 touch_point.id = highest_id + 1; 1913 touch_point.id = highest_id + 1;
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
2675 last_event_timestamp_ = event.timeStampSeconds; 2679 last_event_timestamp_ = event.timeStampSeconds;
2676 2680
2677 if (WebPagePopup* popup = view_->pagePopup()) { 2681 if (WebPagePopup* popup = view_->pagePopup()) {
2678 if (!WebInputEvent::isKeyboardEventType(event.type)) 2682 if (!WebInputEvent::isKeyboardEventType(event.type))
2679 return popup->handleInputEvent(event); 2683 return popup->handleInputEvent(event);
2680 } 2684 }
2681 return view_->handleInputEvent(event); 2685 return view_->handleInputEvent(event);
2682 } 2686 }
2683 2687
2684 } // namespace test_runner 2688 } // namespace test_runner
OLDNEW
« no previous file with comments | « no previous file | content/renderer/pepper/event_conversion.cc » ('j') | third_party/WebKit/Source/web/WebInputEventConversion.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698