| 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 10553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10564 EXPECT_TRUE(hitTestResult.scrollbar()); | 10564 EXPECT_TRUE(hitTestResult.scrollbar()); |
| 10565 EXPECT_FALSE(hitTestResult.scrollbar()->isCustomScrollbar()); | 10565 EXPECT_FALSE(hitTestResult.scrollbar()->isCustomScrollbar()); |
| 10566 | 10566 |
| 10567 // Mouse over link. Mouse cursor should be hand. | 10567 // Mouse over link. Mouse cursor should be hand. |
| 10568 PlatformMouseEvent mouseMoveOverLinkEvent( | 10568 PlatformMouseEvent mouseMoveOverLinkEvent( |
| 10569 IntPoint(aTag->offsetLeft(), aTag->offsetTop()), | 10569 IntPoint(aTag->offsetLeft(), aTag->offsetTop()), |
| 10570 IntPoint(aTag->offsetLeft(), aTag->offsetTop()), | 10570 IntPoint(aTag->offsetLeft(), aTag->offsetTop()), |
| 10571 WebPointerProperties::Button::NoButton, PlatformEvent::MouseMoved, 0, | 10571 WebPointerProperties::Button::NoButton, PlatformEvent::MouseMoved, 0, |
| 10572 PlatformEvent::NoModifiers, WTF::monotonicallyIncreasingTime()); | 10572 PlatformEvent::NoModifiers, WTF::monotonicallyIncreasingTime()); |
| 10573 document->frame()->eventHandler().handleMouseMoveEvent( | 10573 document->frame()->eventHandler().handleMouseMoveEvent( |
| 10574 mouseMoveOverLinkEvent); | 10574 mouseMoveOverLinkEvent, Vector<PlatformMouseEvent>()); |
| 10575 | 10575 |
| 10576 EXPECT_EQ( | 10576 EXPECT_EQ( |
| 10577 Cursor::Type::Hand, | 10577 Cursor::Type::Hand, |
| 10578 document->frame()->chromeClient().lastSetCursorForTesting().getType()); | 10578 document->frame()->chromeClient().lastSetCursorForTesting().getType()); |
| 10579 | 10579 |
| 10580 // Mouse over enabled overlay scrollbar. Mouse cursor should be pointer and no | 10580 // Mouse over enabled overlay scrollbar. Mouse cursor should be pointer and no |
| 10581 // active hover element. | 10581 // active hover element. |
| 10582 PlatformMouseEvent mouseMoveEvent( | 10582 PlatformMouseEvent mouseMoveEvent( |
| 10583 IntPoint(18, aTag->offsetTop()), IntPoint(18, aTag->offsetTop()), | 10583 IntPoint(18, aTag->offsetTop()), IntPoint(18, aTag->offsetTop()), |
| 10584 WebPointerProperties::Button::NoButton, PlatformEvent::MouseMoved, 0, | 10584 WebPointerProperties::Button::NoButton, PlatformEvent::MouseMoved, 0, |
| 10585 PlatformEvent::NoModifiers, WTF::monotonicallyIncreasingTime()); | 10585 PlatformEvent::NoModifiers, WTF::monotonicallyIncreasingTime()); |
| 10586 document->frame()->eventHandler().handleMouseMoveEvent(mouseMoveEvent); | 10586 document->frame()->eventHandler().handleMouseMoveEvent( |
| 10587 mouseMoveEvent, Vector<PlatformMouseEvent>()); |
| 10587 | 10588 |
| 10588 EXPECT_EQ( | 10589 EXPECT_EQ( |
| 10589 Cursor::Type::Pointer, | 10590 Cursor::Type::Pointer, |
| 10590 document->frame()->chromeClient().lastSetCursorForTesting().getType()); | 10591 document->frame()->chromeClient().lastSetCursorForTesting().getType()); |
| 10591 | 10592 |
| 10592 PlatformMouseEvent mousePressEvent( | 10593 PlatformMouseEvent mousePressEvent( |
| 10593 IntPoint(18, aTag->offsetTop()), IntPoint(18, aTag->offsetTop()), | 10594 IntPoint(18, aTag->offsetTop()), IntPoint(18, aTag->offsetTop()), |
| 10594 WebPointerProperties::Button::Left, PlatformEvent::MousePressed, 0, | 10595 WebPointerProperties::Button::Left, PlatformEvent::MousePressed, 0, |
| 10595 PlatformEvent::Modifiers::LeftButtonDown, | 10596 PlatformEvent::Modifiers::LeftButtonDown, |
| 10596 WTF::monotonicallyIncreasingTime()); | 10597 WTF::monotonicallyIncreasingTime()); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 10610 // active hover element. | 10611 // active hover element. |
| 10611 webView->mainFrameImpl()->frameView()->setScrollbarsHidden(true); | 10612 webView->mainFrameImpl()->frameView()->setScrollbarsHidden(true); |
| 10612 | 10613 |
| 10613 // Ensure hittest only has link | 10614 // Ensure hittest only has link |
| 10614 hitTestResult = webView->coreHitTestResultAt(WebPoint(18, aTag->offsetTop())); | 10615 hitTestResult = webView->coreHitTestResultAt(WebPoint(18, aTag->offsetTop())); |
| 10615 | 10616 |
| 10616 EXPECT_TRUE(hitTestResult.URLElement()); | 10617 EXPECT_TRUE(hitTestResult.URLElement()); |
| 10617 EXPECT_TRUE(hitTestResult.innerElement()); | 10618 EXPECT_TRUE(hitTestResult.innerElement()); |
| 10618 EXPECT_FALSE(hitTestResult.scrollbar()); | 10619 EXPECT_FALSE(hitTestResult.scrollbar()); |
| 10619 | 10620 |
| 10620 document->frame()->eventHandler().handleMouseMoveEvent(mouseMoveEvent); | 10621 document->frame()->eventHandler().handleMouseMoveEvent( |
| 10622 mouseMoveEvent, Vector<PlatformMouseEvent>()); |
| 10621 | 10623 |
| 10622 EXPECT_EQ( | 10624 EXPECT_EQ( |
| 10623 Cursor::Type::Hand, | 10625 Cursor::Type::Hand, |
| 10624 document->frame()->chromeClient().lastSetCursorForTesting().getType()); | 10626 document->frame()->chromeClient().lastSetCursorForTesting().getType()); |
| 10625 | 10627 |
| 10626 document->frame()->eventHandler().handleMousePressEvent(mousePressEvent); | 10628 document->frame()->eventHandler().handleMousePressEvent(mousePressEvent); |
| 10627 | 10629 |
| 10628 EXPECT_TRUE(document->activeHoverElement()); | 10630 EXPECT_TRUE(document->activeHoverElement()); |
| 10629 EXPECT_TRUE(document->hoverNode()); | 10631 EXPECT_TRUE(document->hoverNode()); |
| 10630 | 10632 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 10652 HitTestResult hitTestResult = webView->coreHitTestResultAt(WebPoint(1, 1)); | 10654 HitTestResult hitTestResult = webView->coreHitTestResultAt(WebPoint(1, 1)); |
| 10653 | 10655 |
| 10654 EXPECT_TRUE(hitTestResult.innerElement()); | 10656 EXPECT_TRUE(hitTestResult.innerElement()); |
| 10655 EXPECT_FALSE(hitTestResult.scrollbar()); | 10657 EXPECT_FALSE(hitTestResult.scrollbar()); |
| 10656 | 10658 |
| 10657 // Mouse over DIV | 10659 // Mouse over DIV |
| 10658 PlatformMouseEvent mouseMoveOverDiv( | 10660 PlatformMouseEvent mouseMoveOverDiv( |
| 10659 IntPoint(1, 1), IntPoint(1, 1), WebPointerProperties::Button::NoButton, | 10661 IntPoint(1, 1), IntPoint(1, 1), WebPointerProperties::Button::NoButton, |
| 10660 PlatformEvent::MouseMoved, 0, PlatformEvent::NoModifiers, | 10662 PlatformEvent::MouseMoved, 0, PlatformEvent::NoModifiers, |
| 10661 WTF::monotonicallyIncreasingTime()); | 10663 WTF::monotonicallyIncreasingTime()); |
| 10662 document->frame()->eventHandler().handleMouseMoveEvent(mouseMoveOverDiv); | 10664 document->frame()->eventHandler().handleMouseMoveEvent( |
| 10665 mouseMoveOverDiv, Vector<PlatformMouseEvent>()); |
| 10663 | 10666 |
| 10664 // DIV :hover | 10667 // DIV :hover |
| 10665 EXPECT_EQ(document->hoverNode(), scrollbarDiv); | 10668 EXPECT_EQ(document->hoverNode(), scrollbarDiv); |
| 10666 | 10669 |
| 10667 // Ensure hittest has DIV and scrollbar | 10670 // Ensure hittest has DIV and scrollbar |
| 10668 hitTestResult = webView->coreHitTestResultAt(WebPoint(175, 1)); | 10671 hitTestResult = webView->coreHitTestResultAt(WebPoint(175, 1)); |
| 10669 | 10672 |
| 10670 EXPECT_TRUE(hitTestResult.innerElement()); | 10673 EXPECT_TRUE(hitTestResult.innerElement()); |
| 10671 EXPECT_TRUE(hitTestResult.scrollbar()); | 10674 EXPECT_TRUE(hitTestResult.scrollbar()); |
| 10672 EXPECT_TRUE(hitTestResult.scrollbar()->isCustomScrollbar()); | 10675 EXPECT_TRUE(hitTestResult.scrollbar()->isCustomScrollbar()); |
| 10673 | 10676 |
| 10674 // Mouse over scrollbar | 10677 // Mouse over scrollbar |
| 10675 PlatformMouseEvent mouseMoveOverDivAndScrollbar( | 10678 PlatformMouseEvent mouseMoveOverDivAndScrollbar( |
| 10676 IntPoint(175, 1), IntPoint(175, 1), | 10679 IntPoint(175, 1), IntPoint(175, 1), |
| 10677 WebPointerProperties::Button::NoButton, PlatformEvent::MouseMoved, 0, | 10680 WebPointerProperties::Button::NoButton, PlatformEvent::MouseMoved, 0, |
| 10678 PlatformEvent::NoModifiers, WTF::monotonicallyIncreasingTime()); | 10681 PlatformEvent::NoModifiers, WTF::monotonicallyIncreasingTime()); |
| 10679 document->frame()->eventHandler().handleMouseMoveEvent( | 10682 document->frame()->eventHandler().handleMouseMoveEvent( |
| 10680 mouseMoveOverDivAndScrollbar); | 10683 mouseMoveOverDivAndScrollbar, Vector<PlatformMouseEvent>()); |
| 10681 | 10684 |
| 10682 // Custom not change the DIV :hover | 10685 // Custom not change the DIV :hover |
| 10683 EXPECT_EQ(document->hoverNode(), scrollbarDiv); | 10686 EXPECT_EQ(document->hoverNode(), scrollbarDiv); |
| 10684 EXPECT_EQ(hitTestResult.scrollbar()->hoveredPart(), ScrollbarPart::ThumbPart); | 10687 EXPECT_EQ(hitTestResult.scrollbar()->hoveredPart(), ScrollbarPart::ThumbPart); |
| 10685 } | 10688 } |
| 10686 | 10689 |
| 10687 static void disableCompositing(WebSettings* settings) { | 10690 static void disableCompositing(WebSettings* settings) { |
| 10688 settings->setAcceleratedCompositingEnabled(false); | 10691 settings->setAcceleratedCompositingEnabled(false); |
| 10689 settings->setPreferCompositingToLCDTextEnabled(false); | 10692 settings->setPreferCompositingToLCDTextEnabled(false); |
| 10690 } | 10693 } |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10866 | 10869 |
| 10867 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); | 10870 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); |
| 10868 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); | 10871 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); |
| 10869 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); | 10872 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); |
| 10870 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); | 10873 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); |
| 10871 | 10874 |
| 10872 webViewHelper.reset(); | 10875 webViewHelper.reset(); |
| 10873 } | 10876 } |
| 10874 | 10877 |
| 10875 } // namespace blink | 10878 } // namespace blink |
| OLD | NEW |