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

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

Issue 1403893003: Plumb gesture source value through Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Convert more tests (related to CL) to use Touchscreen. Created 5 years, 2 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 1593
1594 IntPoint hitPoint = IntPoint(30, 30); // button size is 100x100 1594 IntPoint hitPoint = IntPoint(30, 30); // button size is 100x100
1595 1595
1596 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->main Frame()); 1596 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->main Frame());
1597 Document* document = frame->frame()->document(); 1597 Document* document = frame->frame()->document();
1598 Element* element = document->getElementById("tap_button"); 1598 Element* element = document->getElementById("tap_button");
1599 1599
1600 ASSERT_NE(nullptr, element); 1600 ASSERT_NE(nullptr, element);
1601 EXPECT_EQ(String("oldValue"), element->innerText()); 1601 EXPECT_EQ(String("oldValue"), element->innerText());
1602 1602
1603 PlatformGestureEvent gestureEvent(PlatformEvent::Type::GestureTap, hitPoint, hitPoint, IntSize(0, 0), 0, PlatformEvent::NoModifiers); 1603 PlatformGestureEvent gestureEvent(PlatformEvent::Type::GestureTap, hitPoint, hitPoint, IntSize(0, 0), 0, PlatformEvent::NoModifiers, PlatformGestureSourceTo uchscreen);
1604 webViewHelper.webViewImpl()->mainFrameImpl()->frame()->eventHandler().handle GestureEvent(gestureEvent); 1604 webViewHelper.webViewImpl()->mainFrameImpl()->frame()->eventHandler().handle GestureEvent(gestureEvent);
1605 // when pressed, the button changes its own text to "updatedValue" 1605 // when pressed, the button changes its own text to "updatedValue"
1606 EXPECT_EQ(String("updatedValue"), element->innerText()); 1606 EXPECT_EQ(String("updatedValue"), element->innerText());
1607 } 1607 }
1608 1608
1609 TEST_P(ParameterizedWebFrameTest, SetForceZeroLayoutHeightWorksAcrossNavigations ) 1609 TEST_P(ParameterizedWebFrameTest, SetForceZeroLayoutHeightWorksAcrossNavigations )
1610 { 1610 {
1611 UseMockScrollbarSettings mockScrollbarSettings; 1611 UseMockScrollbarSettings mockScrollbarSettings;
1612 registerMockedHttpURLLoad("200-by-300.html"); 1612 registerMockedHttpURLLoad("200-by-300.html");
1613 registerMockedHttpURLLoad("large-div.html"); 1613 registerMockedHttpURLLoad("large-div.html");
(...skipping 3137 matching lines...) Expand 10 before | Expand all | Expand 10 after
4751 4751
4752 bool triggered() const { return m_triggered; } 4752 bool triggered() const { return m_triggered; }
4753 void resetTriggered() { m_triggered = false; } 4753 void resetTriggered() { m_triggered = false; }
4754 bool m_triggered; 4754 bool m_triggered;
4755 }; 4755 };
4756 4756
4757 static WebGestureEvent fatTap(int x, int y) 4757 static WebGestureEvent fatTap(int x, int y)
4758 { 4758 {
4759 WebGestureEvent event; 4759 WebGestureEvent event;
4760 event.type = WebInputEvent::GestureTap; 4760 event.type = WebInputEvent::GestureTap;
4761 event.sourceDevice = WebGestureDeviceTouchscreen;
4761 event.x = x; 4762 event.x = x;
4762 event.y = y; 4763 event.y = y;
4763 event.data.tap.width = 50; 4764 event.data.tap.width = 50;
4764 event.data.tap.height = 50; 4765 event.data.tap.height = 50;
4765 return event; 4766 return event;
4766 } 4767 }
4767 4768
4768 TEST_P(ParameterizedWebFrameTest, DisambiguationPopup) 4769 TEST_P(ParameterizedWebFrameTest, DisambiguationPopup)
4769 { 4770 {
4770 const std::string htmlFile = "disambiguation_popup.html"; 4771 const std::string htmlFile = "disambiguation_popup.html";
(...skipping 3213 matching lines...) Expand 10 before | Expand all | Expand 10 after
7984 public: 7985 public:
7985 MOCK_METHOD4(didOverscroll, void(const WebFloatSize&, const WebFloatSize&, c onst WebFloatPoint&, const WebFloatSize&)); 7986 MOCK_METHOD4(didOverscroll, void(const WebFloatSize&, const WebFloatSize&, c onst WebFloatPoint&, const WebFloatSize&));
7986 }; 7987 };
7987 7988
7988 class WebFrameOverscrollTest : public WebFrameTest { 7989 class WebFrameOverscrollTest : public WebFrameTest {
7989 protected: 7990 protected:
7990 WebGestureEvent generateEvent(WebInputEvent::Type type, float deltaX = 0.0, float deltaY = 0.0) 7991 WebGestureEvent generateEvent(WebInputEvent::Type type, float deltaX = 0.0, float deltaY = 0.0)
7991 { 7992 {
7992 WebGestureEvent event; 7993 WebGestureEvent event;
7993 event.type = type; 7994 event.type = type;
7995 // TODO(wjmaclean): Make sure that touchpad device is only ever used for
7996 // gesture scrolling event types.
7997 event.sourceDevice = WebGestureDeviceTouchpad;
7994 event.x = 100; 7998 event.x = 100;
7995 event.y = 100; 7999 event.y = 100;
7996 if (type == WebInputEvent::GestureScrollUpdate) { 8000 if (type == WebInputEvent::GestureScrollUpdate) {
7997 event.data.scrollUpdate.deltaX = deltaX; 8001 event.data.scrollUpdate.deltaX = deltaX;
7998 event.data.scrollUpdate.deltaY = deltaY; 8002 event.data.scrollUpdate.deltaY = deltaY;
7999 } 8003 }
8000 return event; 8004 return event;
8001 } 8005 }
8002 8006
8003 void ScrollByWheel(FrameTestHelpers::WebViewHelper* webViewHelper, int windo wX, int windowY, float deltaX, float deltaY) 8007 void ScrollByWheel(FrameTestHelpers::WebViewHelper* webViewHelper, int windo wX, int windowY, float deltaX, float deltaY)
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
8285 EXPECT_TRUE(resource); 8289 EXPECT_TRUE(resource);
8286 EXPECT_NE(0, resource->loadFinishTime()); 8290 EXPECT_NE(0, resource->loadFinishTime());
8287 8291
8288 DocumentLoader* loader = document->loader(); 8292 DocumentLoader* loader = document->loader();
8289 8293
8290 EXPECT_TRUE(loader); 8294 EXPECT_TRUE(loader);
8291 EXPECT_EQ(loader->timing().responseEnd(), resource->loadFinishTime()); 8295 EXPECT_EQ(loader->timing().responseEnd(), resource->loadFinishTime());
8292 } 8296 }
8293 8297
8294 } // namespace blink 8298 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698