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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp

Issue 2173073003: Move WebInputEvent into public/platform from public/web (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix gn build failure with android Created 4 years, 5 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 EXPECT_EQ(WebTouchPoint::StateCancelled, webTouchBuilder.touches[1].stat e); 224 EXPECT_EQ(WebTouchPoint::StateCancelled, webTouchBuilder.touches[1].stat e);
225 EXPECT_EQ(p0.id, webTouchBuilder.touches[0].id); 225 EXPECT_EQ(p0.id, webTouchBuilder.touches[0].id);
226 EXPECT_EQ(p1.id, webTouchBuilder.touches[1].id); 226 EXPECT_EQ(p1.id, webTouchBuilder.touches[1].id);
227 EXPECT_EQ(WebInputEvent::EventNonBlocking, webTouchBuilder.dispatchType) ; 227 EXPECT_EQ(WebInputEvent::EventNonBlocking, webTouchBuilder.dispatchType) ;
228 } 228 }
229 229
230 // Test max point limit. 230 // Test max point limit.
231 { 231 {
232 TouchList* touchList = TouchList::create(); 232 TouchList* touchList = TouchList::create();
233 TouchList* changedTouchList = TouchList::create(); 233 TouchList* changedTouchList = TouchList::create();
234 for (int i = 0; i <= static_cast<int>(WebTouchEvent::touchesLengthCap) * 2; ++i) { 234 for (int i = 0; i <= static_cast<int>(WebTouchEvent::kTouchesLengthCap) * 2; ++i) {
235 Touch* touch = Touch::create(toLocalFrame(webViewImpl->page()->mainF rame()), document, i, p0.screenPosition, p0.position, FloatSize(p0.radiusX, p0.r adiusY), p0.rotationAngle, p0.force, String()); 235 Touch* touch = Touch::create(toLocalFrame(webViewImpl->page()->mainF rame()), document, i, p0.screenPosition, p0.position, FloatSize(p0.radiusX, p0.r adiusY), p0.rotationAngle, p0.force, String());
236 touchList->append(touch); 236 touchList->append(touch);
237 changedTouchList->append(touch); 237 changedTouchList->append(touch);
238 } 238 }
239 TouchEvent* touchEvent = TouchEvent::create(touchList, touchList, touchL ist, EventTypeNames::touchstart, domWindow, PlatformEvent::NoModifiers, false, f alse, true, 0); 239 TouchEvent* touchEvent = TouchEvent::create(touchList, touchList, touchL ist, EventTypeNames::touchstart, domWindow, PlatformEvent::NoModifiers, false, f alse, true, 0);
240 240
241 WebTouchEventBuilder webTouchBuilder(documentLayoutView, *touchEvent); 241 WebTouchEventBuilder webTouchBuilder(documentLayoutView, *touchEvent);
242 ASSERT_EQ(static_cast<unsigned>(WebTouchEvent::touchesLengthCap), webTou chBuilder.touchesLength); 242 ASSERT_EQ(static_cast<unsigned>(WebTouchEvent::kTouchesLengthCap), webTo uchBuilder.touchesLength);
243 } 243 }
244 } 244 }
245 245
246 TEST(WebInputEventConversionTest, InputEventsScaling) 246 TEST(WebInputEventConversionTest, InputEventsScaling)
247 { 247 {
248 const std::string baseURL("http://www.test1.com/"); 248 const std::string baseURL("http://www.test1.com/");
249 const std::string fileName("fixed_layout.html"); 249 const std::string fileName("fixed_layout.html");
250 250
251 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_s tr()), WebString::fromUTF8("fixed_layout.html")); 251 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_s tr()), WebString::fromUTF8("fixed_layout.html"));
252 FrameTestHelpers::WebViewHelper webViewHelper; 252 FrameTestHelpers::WebViewHelper webViewHelper;
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 EXPECT_EQ(10, platformGestureBuilder.globalPosition().x()); 1082 EXPECT_EQ(10, platformGestureBuilder.globalPosition().x());
1083 EXPECT_EQ(15, platformGestureBuilder.globalPosition().y()); 1083 EXPECT_EQ(15, platformGestureBuilder.globalPosition().y());
1084 EXPECT_EQ(ScrollInertialPhaseNonMomentum, platformGestureBuilder.inertia lPhase()); 1084 EXPECT_EQ(ScrollInertialPhaseNonMomentum, platformGestureBuilder.inertia lPhase());
1085 EXPECT_TRUE(platformGestureBuilder.synthetic()); 1085 EXPECT_TRUE(platformGestureBuilder.synthetic());
1086 EXPECT_EQ(ScrollGranularity::ScrollByPage, platformGestureBuilder.deltaU nits()); 1086 EXPECT_EQ(ScrollGranularity::ScrollByPage, platformGestureBuilder.deltaU nits());
1087 EXPECT_EQ(12345U, platformGestureBuilder.uniqueTouchEventId()); 1087 EXPECT_EQ(12345U, platformGestureBuilder.uniqueTouchEventId());
1088 } 1088 }
1089 } 1089 }
1090 1090
1091 } // namespace blink 1091 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebInputEventConversion.cpp ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698