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

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: Make compilers happy. 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 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 1594
1595 IntPoint hitPoint = IntPoint(30, 30); // button size is 100x100 1595 IntPoint hitPoint = IntPoint(30, 30); // button size is 100x100
1596 1596
1597 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->main Frame()); 1597 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->main Frame());
1598 Document* document = frame->frame()->document(); 1598 Document* document = frame->frame()->document();
1599 Element* element = document->getElementById("tap_button"); 1599 Element* element = document->getElementById("tap_button");
1600 1600
1601 ASSERT_NE(nullptr, element); 1601 ASSERT_NE(nullptr, element);
1602 EXPECT_EQ(String("oldValue"), element->innerText()); 1602 EXPECT_EQ(String("oldValue"), element->innerText());
1603 1603
1604 PlatformGestureEvent gestureEvent(PlatformEvent::Type::GestureTap, hitPoint, hitPoint, IntSize(0, 0), 0, PlatformEvent::NoModifiers); 1604 PlatformGestureEvent gestureEvent(PlatformEvent::Type::GestureTap, hitPoint, hitPoint, IntSize(0, 0), 0, PlatformEvent::NoModifiers, PlatformGestureSourceTo uchpad);
1605 webViewHelper.webViewImpl()->mainFrameImpl()->frame()->eventHandler().handle GestureEvent(gestureEvent); 1605 webViewHelper.webViewImpl()->mainFrameImpl()->frame()->eventHandler().handle GestureEvent(gestureEvent);
1606 // when pressed, the button changes its own text to "updatedValue" 1606 // when pressed, the button changes its own text to "updatedValue"
1607 EXPECT_EQ(String("updatedValue"), element->innerText()); 1607 EXPECT_EQ(String("updatedValue"), element->innerText());
1608 } 1608 }
1609 1609
1610 TEST_P(ParameterizedWebFrameTest, SetForceZeroLayoutHeightWorksAcrossNavigations ) 1610 TEST_P(ParameterizedWebFrameTest, SetForceZeroLayoutHeightWorksAcrossNavigations )
1611 { 1611 {
1612 UseMockScrollbarSettings mockScrollbarSettings; 1612 UseMockScrollbarSettings mockScrollbarSettings;
1613 registerMockedHttpURLLoad("200-by-300.html"); 1613 registerMockedHttpURLLoad("200-by-300.html");
1614 registerMockedHttpURLLoad("large-div.html"); 1614 registerMockedHttpURLLoad("large-div.html");
(...skipping 3137 matching lines...) Expand 10 before | Expand all | Expand 10 after
4752 4752
4753 bool triggered() const { return m_triggered; } 4753 bool triggered() const { return m_triggered; }
4754 void resetTriggered() { m_triggered = false; } 4754 void resetTriggered() { m_triggered = false; }
4755 bool m_triggered; 4755 bool m_triggered;
4756 }; 4756 };
4757 4757
4758 static WebGestureEvent fatTap(int x, int y) 4758 static WebGestureEvent fatTap(int x, int y)
4759 { 4759 {
4760 WebGestureEvent event; 4760 WebGestureEvent event;
4761 event.type = WebInputEvent::GestureTap; 4761 event.type = WebInputEvent::GestureTap;
4762 event.sourceDevice = WebGestureDeviceTouchpad;
4762 event.x = x; 4763 event.x = x;
4763 event.y = y; 4764 event.y = y;
4764 event.data.tap.width = 50; 4765 event.data.tap.width = 50;
4765 event.data.tap.height = 50; 4766 event.data.tap.height = 50;
4766 return event; 4767 return event;
4767 } 4768 }
4768 4769
4769 TEST_P(ParameterizedWebFrameTest, DisambiguationPopup) 4770 TEST_P(ParameterizedWebFrameTest, DisambiguationPopup)
4770 { 4771 {
4771 const std::string htmlFile = "disambiguation_popup.html"; 4772 const std::string htmlFile = "disambiguation_popup.html";
(...skipping 3177 matching lines...) Expand 10 before | Expand all | Expand 10 after
7949 public: 7950 public:
7950 MOCK_METHOD4(didOverscroll, void(const WebFloatSize&, const WebFloatSize&, c onst WebFloatPoint&, const WebFloatSize&)); 7951 MOCK_METHOD4(didOverscroll, void(const WebFloatSize&, const WebFloatSize&, c onst WebFloatPoint&, const WebFloatSize&));
7951 }; 7952 };
7952 7953
7953 class WebFrameOverscrollTest : public WebFrameTest { 7954 class WebFrameOverscrollTest : public WebFrameTest {
7954 protected: 7955 protected:
7955 WebGestureEvent generateEvent(WebInputEvent::Type type, float deltaX = 0.0, float deltaY = 0.0) 7956 WebGestureEvent generateEvent(WebInputEvent::Type type, float deltaX = 0.0, float deltaY = 0.0)
7956 { 7957 {
7957 WebGestureEvent event; 7958 WebGestureEvent event;
7958 event.type = type; 7959 event.type = type;
7960 event.sourceDevice = WebGestureDeviceTouchpad;
7959 event.x = 100; 7961 event.x = 100;
7960 event.y = 100; 7962 event.y = 100;
7961 if (type == WebInputEvent::GestureScrollUpdate) { 7963 if (type == WebInputEvent::GestureScrollUpdate) {
7962 event.data.scrollUpdate.deltaX = deltaX; 7964 event.data.scrollUpdate.deltaX = deltaX;
7963 event.data.scrollUpdate.deltaY = deltaY; 7965 event.data.scrollUpdate.deltaY = deltaY;
7964 } 7966 }
7965 return event; 7967 return event;
7966 } 7968 }
7967 7969
7968 void ScrollByWheel(FrameTestHelpers::WebViewHelper* webViewHelper, int windo wX, int windowY, float deltaX, float deltaY) 7970 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
8250 EXPECT_TRUE(resource); 8252 EXPECT_TRUE(resource);
8251 EXPECT_NE(0, resource->loadFinishTime()); 8253 EXPECT_NE(0, resource->loadFinishTime());
8252 8254
8253 DocumentLoader* loader = document->loader(); 8255 DocumentLoader* loader = document->loader();
8254 8256
8255 EXPECT_TRUE(loader); 8257 EXPECT_TRUE(loader);
8256 EXPECT_EQ(loader->timing().responseEnd(), resource->loadFinishTime()); 8258 EXPECT_EQ(loader->timing().responseEnd(), resource->loadFinishTime());
8257 } 8259 }
8258 8260
8259 } // namespace blink 8261 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698