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

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

Issue 2227563003: Refactoring button field and its type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix new instances Created 4 years, 4 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 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>
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 EXPECT_EQ(isPrimary, pointerEvent->isPrimary()); 106 EXPECT_EQ(isPrimary, pointerEvent->isPrimary());
107 return pointerEvent; 107 return pointerEvent;
108 } 108 }
109 109
110 PointerEvent* PointerEventFactoryTest::createAndCheckMouseEvent( 110 PointerEvent* PointerEventFactoryTest::createAndCheckMouseEvent(
111 WebPointerProperties::PointerType pointerType, 111 WebPointerProperties::PointerType pointerType,
112 int rawId, int uniqueId, bool isPrimary, 112 int rawId, int uniqueId, bool isPrimary,
113 PlatformEvent::Modifiers modifiers) 113 PlatformEvent::Modifiers modifiers)
114 { 114 {
115 PointerEvent* pointerEvent = m_pointerEventFactory.create( 115 PointerEvent* pointerEvent = m_pointerEventFactory.create(
116 EventTypeNames::mousedown, PlatformMouseEventBuilder(pointerType, rawId, modifiers), nullptr, nullptr); 116 EventTypeNames::mousedown, PlatformMouseEventBuilder(pointerType, rawId, modifiers), nullptr);
117 EXPECT_EQ(uniqueId, pointerEvent->pointerId()); 117 EXPECT_EQ(uniqueId, pointerEvent->pointerId());
118 EXPECT_EQ(isPrimary, pointerEvent->isPrimary()); 118 EXPECT_EQ(isPrimary, pointerEvent->isPrimary());
119 return pointerEvent; 119 return pointerEvent;
120 } 120 }
121 121
122 TEST_F(PointerEventFactoryTest, MousePointer) 122 TEST_F(PointerEventFactoryTest, MousePointer)
123 { 123 {
124 EXPECT_TRUE(m_pointerEventFactory.isActive(m_expectedMouseId)); 124 EXPECT_TRUE(m_pointerEventFactory.isActive(m_expectedMouseId));
125 EXPECT_FALSE(m_pointerEventFactory.isActiveButtonsState(m_expectedMouseId)); 125 EXPECT_FALSE(m_pointerEventFactory.isActiveButtonsState(m_expectedMouseId));
126 126
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 createAndCheckMouseEvent(WebPointerProperties::PointerType::Touch, i, m_ mappedIdStart+i, i == 0); 314 createAndCheckMouseEvent(WebPointerProperties::PointerType::Touch, i, m_ mappedIdStart+i, i == 0);
315 } 315 }
316 316
317 for (int i = 0; i < 100; ++i) { 317 for (int i = 0; i < 100; ++i) {
318 createAndCheckTouchEvent(WebPointerProperties::PointerType::Mouse, i, m_ expectedMouseId, true); 318 createAndCheckTouchEvent(WebPointerProperties::PointerType::Mouse, i, m_ expectedMouseId, true);
319 } 319 }
320 createAndCheckTouchCancel(WebPointerProperties::PointerType::Mouse, 0, m_exp ectedMouseId, true); 320 createAndCheckTouchCancel(WebPointerProperties::PointerType::Mouse, 0, m_exp ectedMouseId, true);
321 } 321 }
322 322
323 } // namespace blink 323 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698