OLD | NEW |
---|---|
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 Loading... | |
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 uchpad); |
Rick Byers
2015/10/19 18:20:29
Tap should only ever be touchscreen
wjmaclean
2015/10/19 18:58:49
Done.
| |
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 Loading... | |
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 = WebGestureDeviceTouchpad; | |
Rick Byers
2015/10/19 18:20:29
ditto
wjmaclean
2015/10/19 18:58:49
Done.
| |
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 Loading... | |
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 event.sourceDevice = WebGestureDeviceTouchpad; | |
7994 event.x = 100; | 7996 event.x = 100; |
7995 event.y = 100; | 7997 event.y = 100; |
7996 if (type == WebInputEvent::GestureScrollUpdate) { | 7998 if (type == WebInputEvent::GestureScrollUpdate) { |
7997 event.data.scrollUpdate.deltaX = deltaX; | 7999 event.data.scrollUpdate.deltaX = deltaX; |
7998 event.data.scrollUpdate.deltaY = deltaY; | 8000 event.data.scrollUpdate.deltaY = deltaY; |
7999 } | 8001 } |
8000 return event; | 8002 return event; |
8001 } | 8003 } |
8002 | 8004 |
8003 void ScrollByWheel(FrameTestHelpers::WebViewHelper* webViewHelper, int windo wX, int windowY, float deltaX, float deltaY) | 8005 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 Loading... | |
8285 EXPECT_TRUE(resource); | 8287 EXPECT_TRUE(resource); |
8286 EXPECT_NE(0, resource->loadFinishTime()); | 8288 EXPECT_NE(0, resource->loadFinishTime()); |
8287 | 8289 |
8288 DocumentLoader* loader = document->loader(); | 8290 DocumentLoader* loader = document->loader(); |
8289 | 8291 |
8290 EXPECT_TRUE(loader); | 8292 EXPECT_TRUE(loader); |
8291 EXPECT_EQ(loader->timing().responseEnd(), resource->loadFinishTime()); | 8293 EXPECT_EQ(loader->timing().responseEnd(), resource->loadFinishTime()); |
8292 } | 8294 } |
8293 | 8295 |
8294 } // namespace blink | 8296 } // namespace blink |
OLD | NEW |