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

Side by Side Diff: third_party/WebKit/Source/core/events/PointerEventFactoryTest.cpp

Issue 2867093003: Do not increase the pointer id when type is eraser (Closed)
Patch Set: eraser id Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/events/PointerEventFactory.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "core/events/PointerEventFactory.h" 5 #include "core/events/PointerEventFactory.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/page/Page.h" 8 #include "core/page/Page.h"
9 #include "public/platform/WebPointerProperties.h" 9 #include "public/platform/WebPointerProperties.h"
10 #include <climits> 10 #include <climits>
11 #include <gtest/gtest.h> 11 #include <gtest/gtest.h>
12 12
13 namespace blink { 13 namespace blink {
14 14
15 namespace { 15 namespace {
16 16
17 const char* PointerTypeNameForWebPointPointerType( 17 const char* PointerTypeNameForWebPointPointerType(
18 WebPointerProperties::PointerType type) { 18 WebPointerProperties::PointerType type) {
19 switch (type) { 19 switch (type) {
20 case WebPointerProperties::PointerType::kUnknown: 20 case WebPointerProperties::PointerType::kUnknown:
21 return ""; 21 return "";
22 case WebPointerProperties::PointerType::kTouch: 22 case WebPointerProperties::PointerType::kTouch:
23 return "touch"; 23 return "touch";
24 case WebPointerProperties::PointerType::kPen: 24 case WebPointerProperties::PointerType::kPen:
25 case WebPointerProperties::PointerType::kEraser:
26 return "pen"; 25 return "pen";
27 case WebPointerProperties::PointerType::kMouse: 26 case WebPointerProperties::PointerType::kMouse:
28 return "mouse"; 27 return "mouse";
28 default:
29 NOTREACHED();
30 return "";
29 } 31 }
30 NOTREACHED();
31 return "";
32 } 32 }
33 } 33 }
34 34
35 class PointerEventFactoryTest : public ::testing::Test { 35 class PointerEventFactoryTest : public ::testing::Test {
36 protected: 36 protected:
37 void SetUp() override; 37 void SetUp() override;
38 PointerEvent* CreateAndCheckTouchCancel(WebPointerProperties::PointerType, 38 PointerEvent* CreateAndCheckTouchCancel(WebPointerProperties::PointerType,
39 int raw_id, 39 int raw_id,
40 int unique_id, 40 int unique_id,
41 bool is_primary); 41 bool is_primary);
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 TEST_F(PointerEventFactoryTest, CoalescedEvents) { 473 TEST_F(PointerEventFactoryTest, CoalescedEvents) {
474 CreateAndCheckMouseEvent(WebPointerProperties::PointerType::kMouse, 0, 474 CreateAndCheckMouseEvent(WebPointerProperties::PointerType::kMouse, 0,
475 expected_mouse_id_, true, 475 expected_mouse_id_, true,
476 WebInputEvent::kNoModifiers, 4); 476 WebInputEvent::kNoModifiers, 4);
477 CreateAndCheckTouchEvent(WebPointerProperties::PointerType::kTouch, 0, 477 CreateAndCheckTouchEvent(WebPointerProperties::PointerType::kTouch, 0,
478 mapped_id_start_, true, WebTouchPoint::kStateMoved, 478 mapped_id_start_, true, WebTouchPoint::kStateMoved,
479 3); 479 3);
480 } 480 }
481 481
482 } // namespace blink 482 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/PointerEventFactory.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698