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

Unified Diff: third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp

Issue 1865813002: Remove RawPtr from Source/web/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp b/third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp
index b6df4fe74f114e12b93fb07016bba561e00e7e88..df3e75ef111bd790549160abe2667d6fb303cc4b 100644
--- a/third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebInputEventConversionTest.cpp
@@ -51,14 +51,14 @@
namespace blink {
-RawPtr<KeyboardEvent> createKeyboardEventWithLocation(KeyboardEvent::KeyLocationCode location)
+KeyboardEvent* createKeyboardEventWithLocation(KeyboardEvent::KeyLocationCode location)
{
return KeyboardEvent::create("keydown", true, true, 0, "", "", "", location, PlatformEvent::NoModifiers, 0);
}
int getModifiersForKeyLocationCode(KeyboardEvent::KeyLocationCode location)
{
- RawPtr<KeyboardEvent> event = createKeyboardEventWithLocation(location);
+ KeyboardEvent* event = createKeyboardEventWithLocation(location);
WebKeyboardEventBuilder convertedEvent(*event);
return convertedEvent.modifiers;
}
@@ -84,7 +84,7 @@ TEST(WebInputEventConversionTest, WebKeyboardEventBuilder)
TEST(WebInputEventConversionTest, WebMouseEventBuilder)
{
- RawPtr<TouchEvent> event = TouchEvent::create();
+ TouchEvent* event = TouchEvent::create();
WebMouseEventBuilder mouse(0, 0, *event);
EXPECT_EQ(WebInputEvent::Undefined, mouse.type);
}
@@ -102,7 +102,7 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
webViewImpl->resize(WebSize(pageWidth, pageHeight));
webViewImpl->updateAllLifecyclePhases();
- RawPtr<Document> document = toLocalFrame(webViewImpl->page()->mainFrame())->document();
+ Document* document = toLocalFrame(webViewImpl->page()->mainFrame())->document();
LocalDOMWindow* domWindow = document->domWindow();
LayoutView* documentLayoutView = document->layoutView();
@@ -118,14 +118,14 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
p0.rotationAngle = p1.rotationAngle = 1.f;
p0.force = p1.force = 25.f;
- RawPtr<Touch> touch0 = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document.get(), p0.id, p0.screenPosition, p0.position, FloatSize(p0.radiusX, p0.radiusY), p0.rotationAngle, p0.force, String());
- RawPtr<Touch> touch1 = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document.get(), p1.id, p1.screenPosition, p1.position, FloatSize(p1.radiusX, p1.radiusY), p1.rotationAngle, p1.force, String());
+ Touch* touch0 = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document, p0.id, p0.screenPosition, p0.position, FloatSize(p0.radiusX, p0.radiusY), p0.rotationAngle, p0.force, String());
+ Touch* touch1 = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document, p1.id, p1.screenPosition, p1.position, FloatSize(p1.radiusX, p1.radiusY), p1.rotationAngle, p1.force, String());
// Test touchstart.
{
- RawPtr<TouchList> touchList = TouchList::create();
+ TouchList* touchList = TouchList::create();
touchList->append(touch0);
- RawPtr<TouchEvent> touchEvent = TouchEvent::create(touchList.get(), touchList.get(), touchList.get(), EventTypeNames::touchstart, domWindow, PlatformEvent::NoModifiers, false, false, 0);
+ TouchEvent* touchEvent = TouchEvent::create(touchList, touchList, touchList, EventTypeNames::touchstart, domWindow, PlatformEvent::NoModifiers, false, false, 0);
WebTouchEventBuilder webTouchBuilder(documentLayoutView, *touchEvent);
ASSERT_EQ(1u, webTouchBuilder.touchesLength);
@@ -143,12 +143,12 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
// Test touchmove.
{
- RawPtr<TouchList> activeTouchList = TouchList::create();
- RawPtr<TouchList> movedTouchList = TouchList::create();
+ TouchList* activeTouchList = TouchList::create();
+ TouchList* movedTouchList = TouchList::create();
activeTouchList->append(touch0);
activeTouchList->append(touch1);
movedTouchList->append(touch0);
- RawPtr<TouchEvent> touchEvent = TouchEvent::create(activeTouchList.get(), activeTouchList.get(), movedTouchList.get(), EventTypeNames::touchmove, domWindow, PlatformEvent::NoModifiers, false, false, 0);
+ TouchEvent* touchEvent = TouchEvent::create(activeTouchList, activeTouchList, movedTouchList, EventTypeNames::touchmove, domWindow, PlatformEvent::NoModifiers, false, false, 0);
WebTouchEventBuilder webTouchBuilder(documentLayoutView, *touchEvent);
ASSERT_EQ(2u, webTouchBuilder.touchesLength);
@@ -161,12 +161,12 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
// Test touchmove, different point yields same ordering.
{
- RawPtr<TouchList> activeTouchList = TouchList::create();
- RawPtr<TouchList> movedTouchList = TouchList::create();
+ TouchList* activeTouchList = TouchList::create();
+ TouchList* movedTouchList = TouchList::create();
activeTouchList->append(touch0);
activeTouchList->append(touch1);
movedTouchList->append(touch1);
- RawPtr<TouchEvent> touchEvent = TouchEvent::create(activeTouchList.get(), activeTouchList.get(), movedTouchList.get(), EventTypeNames::touchmove, domWindow, PlatformEvent::NoModifiers, false, false, 0);
+ TouchEvent* touchEvent = TouchEvent::create(activeTouchList, activeTouchList, movedTouchList, EventTypeNames::touchmove, domWindow, PlatformEvent::NoModifiers, false, false, 0);
WebTouchEventBuilder webTouchBuilder(documentLayoutView, *touchEvent);
ASSERT_EQ(2u, webTouchBuilder.touchesLength);
@@ -179,11 +179,11 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
// Test touchend.
{
- RawPtr<TouchList> activeTouchList = TouchList::create();
- RawPtr<TouchList> releasedTouchList = TouchList::create();
+ TouchList* activeTouchList = TouchList::create();
+ TouchList* releasedTouchList = TouchList::create();
activeTouchList->append(touch0);
releasedTouchList->append(touch1);
- RawPtr<TouchEvent> touchEvent = TouchEvent::create(activeTouchList.get(), activeTouchList.get(), releasedTouchList.get(), EventTypeNames::touchend, domWindow, PlatformEvent::NoModifiers, false, false, 0);
+ TouchEvent* touchEvent = TouchEvent::create(activeTouchList, activeTouchList, releasedTouchList, EventTypeNames::touchend, domWindow, PlatformEvent::NoModifiers, false, false, 0);
WebTouchEventBuilder webTouchBuilder(documentLayoutView, *touchEvent);
ASSERT_EQ(2u, webTouchBuilder.touchesLength);
@@ -196,11 +196,11 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
// Test touchcancel.
{
- RawPtr<TouchList> activeTouchList = TouchList::create();
- RawPtr<TouchList> cancelledTouchList = TouchList::create();
+ TouchList* activeTouchList = TouchList::create();
+ TouchList* cancelledTouchList = TouchList::create();
cancelledTouchList->append(touch0);
cancelledTouchList->append(touch1);
- RawPtr<TouchEvent> touchEvent = TouchEvent::create(activeTouchList.get(), activeTouchList.get(), cancelledTouchList.get(), EventTypeNames::touchcancel, domWindow, PlatformEvent::NoModifiers, false, false, 0);
+ TouchEvent* touchEvent = TouchEvent::create(activeTouchList, activeTouchList, cancelledTouchList, EventTypeNames::touchcancel, domWindow, PlatformEvent::NoModifiers, false, false, 0);
WebTouchEventBuilder webTouchBuilder(documentLayoutView, *touchEvent);
ASSERT_EQ(2u, webTouchBuilder.touchesLength);
@@ -213,14 +213,14 @@ TEST(WebInputEventConversionTest, WebTouchEventBuilder)
// Test max point limit.
{
- RawPtr<TouchList> touchList = TouchList::create();
- RawPtr<TouchList> changedTouchList = TouchList::create();
+ TouchList* touchList = TouchList::create();
+ TouchList* changedTouchList = TouchList::create();
for (int i = 0; i <= static_cast<int>(WebTouchEvent::touchesLengthCap) * 2; ++i) {
- RawPtr<Touch> touch = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document.get(), i, p0.screenPosition, p0.position, FloatSize(p0.radiusX, p0.radiusY), p0.rotationAngle, p0.force, String());
+ Touch* touch = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document, i, p0.screenPosition, p0.position, FloatSize(p0.radiusX, p0.radiusY), p0.rotationAngle, p0.force, String());
touchList->append(touch);
changedTouchList->append(touch);
}
- RawPtr<TouchEvent> touchEvent = TouchEvent::create(touchList.get(), touchList.get(), touchList.get(), EventTypeNames::touchstart, domWindow, PlatformEvent::NoModifiers, false, false, 0);
+ TouchEvent* touchEvent = TouchEvent::create(touchList, touchList, touchList, EventTypeNames::touchstart, domWindow, PlatformEvent::NoModifiers, false, false, 0);
WebTouchEventBuilder webTouchBuilder(documentLayoutView, *touchEvent);
ASSERT_EQ(static_cast<unsigned>(WebTouchEvent::touchesLengthCap), webTouchBuilder.touchesLength);
@@ -244,7 +244,7 @@ TEST(WebInputEventConversionTest, InputEventsScaling)
webViewImpl->setPageScaleFactor(2);
FrameView* view = toLocalFrame(webViewImpl->page()->mainFrame())->view();
- RawPtr<Document> document = toLocalFrame(webViewImpl->page()->mainFrame())->document();
+ Document* document = toLocalFrame(webViewImpl->page()->mainFrame())->document();
LocalDOMWindow* domWindow = document->domWindow();
LayoutView* documentLayoutView = document->layoutView();
@@ -420,7 +420,7 @@ TEST(WebInputEventConversionTest, InputEventsScaling)
// which expect CSS pixel coordinates.
{
PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10), LeftButton, PlatformEvent::MouseMoved, 1, PlatformEvent::NoModifiers, PlatformMouseEvent::RealOrIndistinguishable, 0);
- RawPtr<MouseEvent> mouseEvent = MouseEvent::create(EventTypeNames::mousemove, domWindow, platformMouseEvent, 0, document);
+ MouseEvent* mouseEvent = MouseEvent::create(EventTypeNames::mousemove, domWindow, platformMouseEvent, 0, document);
WebMouseEventBuilder webMouseBuilder(view, documentLayoutView, *mouseEvent);
EXPECT_EQ(10, webMouseBuilder.x);
@@ -433,7 +433,7 @@ TEST(WebInputEventConversionTest, InputEventsScaling)
{
PlatformMouseEvent platformMouseEvent(IntPoint(10, 10), IntPoint(10, 10), NoButton, PlatformEvent::MouseMoved, 1, PlatformEvent::NoModifiers, PlatformMouseEvent::RealOrIndistinguishable, 0);
- RawPtr<MouseEvent> mouseEvent = MouseEvent::create(EventTypeNames::mousemove, domWindow, platformMouseEvent, 0, document);
+ MouseEvent* mouseEvent = MouseEvent::create(EventTypeNames::mousemove, domWindow, platformMouseEvent, 0, document);
WebMouseEventBuilder webMouseBuilder(view, documentLayoutView, *mouseEvent);
EXPECT_EQ(WebMouseEvent::ButtonNone, webMouseBuilder.button);
}
@@ -447,7 +447,7 @@ TEST(WebInputEventConversionTest, InputEventsScaling)
// coordinates (x, y, deltaX, deltaY) to the page scale. This
// may lead to unexpected bugs if a PlatformGestureEvent is
// transformed into WebGestureEvent and back.
- RawPtr<GestureEvent> gestureEvent = GestureEvent::create(domWindow, platformGestureEvent);
+ GestureEvent* gestureEvent = GestureEvent::create(domWindow, platformGestureEvent);
WebGestureEventBuilder webGestureBuilder(documentLayoutView, *gestureEvent);
EXPECT_EQ(10, webGestureBuilder.x);
@@ -464,10 +464,10 @@ TEST(WebInputEventConversionTest, InputEventsScaling)
}
{
- RawPtr<Touch> touch = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document.get(), 0, FloatPoint(10, 9.5), FloatPoint(3.5, 2), FloatSize(4, 4.5), 0, 0, String());
- RawPtr<TouchList> touchList = TouchList::create();
+ Touch* touch = Touch::create(toLocalFrame(webViewImpl->page()->mainFrame()), document, 0, FloatPoint(10, 9.5), FloatPoint(3.5, 2), FloatSize(4, 4.5), 0, 0, String());
+ TouchList* touchList = TouchList::create();
touchList->append(touch);
- RawPtr<TouchEvent> touchEvent = TouchEvent::create(touchList.get(), touchList.get(), touchList.get(), EventTypeNames::touchmove, domWindow, PlatformEvent::NoModifiers, false, false, 0);
+ TouchEvent* touchEvent = TouchEvent::create(touchList, touchList, touchList, EventTypeNames::touchmove, domWindow, PlatformEvent::NoModifiers, false, false, 0);
WebTouchEventBuilder webTouchBuilder(documentLayoutView, *touchEvent);
ASSERT_EQ(1u, webTouchBuilder.touchesLength);
@@ -649,7 +649,7 @@ TEST(WebInputEventConversionTest, InputEventsConversions)
webViewImpl->updateAllLifecyclePhases();
FrameView* view = toLocalFrame(webViewImpl->page()->mainFrame())->view();
- RawPtr<Document> document = toLocalFrame(webViewImpl->page()->mainFrame())->document();
+ Document* document = toLocalFrame(webViewImpl->page()->mainFrame())->document();
LocalDOMWindow* domWindow = document->domWindow();
LayoutView* documentLayoutView = document->layoutView();
@@ -672,7 +672,7 @@ TEST(WebInputEventConversionTest, InputEventsConversions)
EXPECT_EQ(10.f, platformGestureBuilder.globalPosition().y());
EXPECT_EQ(1, platformGestureBuilder.tapCount());
- RawPtr<GestureEvent> coreGestureEvent = GestureEvent::create(domWindow, platformGestureBuilder);
+ GestureEvent* coreGestureEvent = GestureEvent::create(domWindow, platformGestureBuilder);
WebGestureEventBuilder recreatedWebGestureEvent(documentLayoutView, *coreGestureEvent);
EXPECT_EQ(webGestureEvent.type, recreatedWebGestureEvent.type);
EXPECT_EQ(webGestureEvent.x, recreatedWebGestureEvent.x);
@@ -888,11 +888,11 @@ TEST(WebInputEventConversionTest, WebMouseWheelEventBuilder)
webViewImpl->resize(WebSize(pageWidth, pageHeight));
webViewImpl->updateAllLifecyclePhases();
- RawPtr<Document> document = toLocalFrame(webViewImpl->page()->mainFrame())->document();
- RawPtr<WheelEvent> event = WheelEvent::create(FloatPoint(1, 3), FloatPoint(5, 10),
- WheelEvent::DOM_DELTA_PAGE, document.get()->domWindow(), IntPoint(2, 6), IntPoint(10, 30),
+ Document* document = toLocalFrame(webViewImpl->page()->mainFrame())->document();
+ WheelEvent* event = WheelEvent::create(FloatPoint(1, 3), FloatPoint(5, 10),
+ WheelEvent::DOM_DELTA_PAGE, document->domWindow(), IntPoint(2, 6), IntPoint(10, 30),
PlatformEvent::CtrlKey, 0, 0, true, -1 /* null plugin id */, true /* hasPreciseScrollingDeltas */, Event::RailsModeHorizontal);
- WebMouseWheelEventBuilder webMouseWheel(toLocalFrame(webViewImpl->page()->mainFrame())->view(), document.get()->layoutView(), *event);
+ WebMouseWheelEventBuilder webMouseWheel(toLocalFrame(webViewImpl->page()->mainFrame())->view(), document->layoutView(), *event);
EXPECT_EQ(1, webMouseWheel.wheelTicksX);
EXPECT_EQ(3, webMouseWheel.wheelTicksY);
EXPECT_EQ(5, webMouseWheel.deltaX);
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebFrameTest.cpp ('k') | third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698