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

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

Issue 247483002: Allow touch events to be uncancelable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix build on some platforms Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/tests/TouchActionTest.cpp ('k') | public/web/WebInputEvent.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 EXPECT_EQ(10, webGestureBuilder.globalX); 278 EXPECT_EQ(10, webGestureBuilder.globalX);
279 EXPECT_EQ(10, webGestureBuilder.globalY); 279 EXPECT_EQ(10, webGestureBuilder.globalY);
280 EXPECT_EQ(10, webGestureBuilder.data.scrollUpdate.deltaX); 280 EXPECT_EQ(10, webGestureBuilder.data.scrollUpdate.deltaX);
281 EXPECT_EQ(10, webGestureBuilder.data.scrollUpdate.deltaY); 281 EXPECT_EQ(10, webGestureBuilder.data.scrollUpdate.deltaY);
282 } 282 }
283 283
284 { 284 {
285 RefPtrWillBeRawPtr<Touch> touch = Touch::create(webViewImpl->page()->mai nFrame(), document.get(), 0, 10, 10, 10, 10, 10, 10, 0, 0); 285 RefPtrWillBeRawPtr<Touch> touch = Touch::create(webViewImpl->page()->mai nFrame(), document.get(), 0, 10, 10, 10, 10, 10, 10, 0, 0);
286 RefPtrWillBeRawPtr<TouchList> touchList = TouchList::create(); 286 RefPtrWillBeRawPtr<TouchList> touchList = TouchList::create();
287 touchList->append(touch); 287 touchList->append(touch);
288 RefPtrWillBeRawPtr<TouchEvent> touchEvent = TouchEvent::create(touchList .get(), touchList.get(), touchList.get(), WebCore::EventTypeNames::touchmove, do mWindow, 10, 10, 10, 10, false, false, false, false); 288 RefPtrWillBeRawPtr<TouchEvent> touchEvent = TouchEvent::create(touchList .get(), touchList.get(), touchList.get(), WebCore::EventTypeNames::touchmove, do mWindow, 10, 10, 10, 10, false, false, false, false, false);
289 289
290 WebTouchEventBuilder webTouchBuilder(view, docRenderer, *touchEvent); 290 WebTouchEventBuilder webTouchBuilder(view, docRenderer, *touchEvent);
291 ASSERT_EQ(1u, webTouchBuilder.touchesLength); 291 ASSERT_EQ(1u, webTouchBuilder.touchesLength);
292 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.x); 292 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.x);
293 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.y); 293 EXPECT_EQ(10, webTouchBuilder.touches[0].screenPosition.y);
294 EXPECT_EQ(10, webTouchBuilder.touches[0].position.x); 294 EXPECT_EQ(10, webTouchBuilder.touches[0].position.x);
295 EXPECT_EQ(10, webTouchBuilder.touches[0].position.y); 295 EXPECT_EQ(10, webTouchBuilder.touches[0].position.y);
296 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusX); 296 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusX);
297 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusY); 297 EXPECT_EQ(10, webTouchBuilder.touches[0].radiusY);
298 EXPECT_FALSE(webTouchBuilder.cancelable);
298 } 299 }
299 } 300 }
300 301
301 TEST(WebInputEventConversionTest, InputEventsTransform) 302 TEST(WebInputEventConversionTest, InputEventsTransform)
302 { 303 {
303 const std::string baseURL("http://www.test2.com/"); 304 const std::string baseURL("http://www.test2.com/");
304 const std::string fileName("fixed_layout.html"); 305 const std::string fileName("fixed_layout.html");
305 306
306 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_s tr()), WebString::fromUTF8("fixed_layout.html")); 307 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_s tr()), WebString::fromUTF8("fixed_layout.html"));
307 FrameTestHelpers::WebViewHelper webViewHelper; 308 FrameTestHelpers::WebViewHelper webViewHelper;
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 586
586 PlatformTouchEventBuilder platformTouchBuilder(view, webTouchEvent); 587 PlatformTouchEventBuilder platformTouchBuilder(view, webTouchEvent);
587 EXPECT_EQ(10, platformTouchBuilder.touchPoints()[0].screenPos().x()); 588 EXPECT_EQ(10, platformTouchBuilder.touchPoints()[0].screenPos().x());
588 EXPECT_EQ(10, platformTouchBuilder.touchPoints()[0].screenPos().y()); 589 EXPECT_EQ(10, platformTouchBuilder.touchPoints()[0].screenPos().y());
589 EXPECT_EQ(5 + pinchOffset.x(), platformTouchBuilder.touchPoints()[0].pos ().x()); 590 EXPECT_EQ(5 + pinchOffset.x(), platformTouchBuilder.touchPoints()[0].pos ().x());
590 EXPECT_EQ(5 + pinchOffset.y(), platformTouchBuilder.touchPoints()[0].pos ().y()); 591 EXPECT_EQ(5 + pinchOffset.y(), platformTouchBuilder.touchPoints()[0].pos ().y());
591 } 592 }
592 } 593 }
593 594
594 } // anonymous namespace 595 } // anonymous namespace
OLDNEW
« no previous file with comments | « Source/web/tests/TouchActionTest.cpp ('k') | public/web/WebInputEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698