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 10481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10492 EXPECT_TRUE(hitTestResult.innerElement()); | 10492 EXPECT_TRUE(hitTestResult.innerElement()); |
10493 EXPECT_TRUE(hitTestResult.scrollbar()); | 10493 EXPECT_TRUE(hitTestResult.scrollbar()); |
10494 | 10494 |
10495 // Mouse over link. Mouse cursor should be hand. | 10495 // Mouse over link. Mouse cursor should be hand. |
10496 PlatformMouseEvent mouseMoveOverLinkEvent( | 10496 PlatformMouseEvent mouseMoveOverLinkEvent( |
10497 IntPoint(aTag->offsetLeft(), aTag->offsetTop()), | 10497 IntPoint(aTag->offsetLeft(), aTag->offsetTop()), |
10498 IntPoint(aTag->offsetLeft(), aTag->offsetTop()), | 10498 IntPoint(aTag->offsetLeft(), aTag->offsetTop()), |
10499 WebPointerProperties::Button::NoButton, PlatformEvent::MouseMoved, 0, | 10499 WebPointerProperties::Button::NoButton, PlatformEvent::MouseMoved, 0, |
10500 PlatformEvent::NoModifiers, WTF::monotonicallyIncreasingTime()); | 10500 PlatformEvent::NoModifiers, WTF::monotonicallyIncreasingTime()); |
10501 document->frame()->eventHandler().handleMouseMoveEvent( | 10501 document->frame()->eventHandler().handleMouseMoveEvent( |
10502 mouseMoveOverLinkEvent); | 10502 mouseMoveOverLinkEvent, Vector<PlatformMouseEvent>()); |
10503 | 10503 |
10504 EXPECT_EQ( | 10504 EXPECT_EQ( |
10505 Cursor::Type::Hand, | 10505 Cursor::Type::Hand, |
10506 document->frame()->chromeClient().lastSetCursorForTesting().getType()); | 10506 document->frame()->chromeClient().lastSetCursorForTesting().getType()); |
10507 | 10507 |
10508 // Mouse over enabled overlay scrollbar. Mouse cursor should be pointer and no | 10508 // Mouse over enabled overlay scrollbar. Mouse cursor should be pointer and no |
10509 // active hover element. | 10509 // active hover element. |
10510 PlatformMouseEvent mouseMoveEvent( | 10510 PlatformMouseEvent mouseMoveEvent( |
10511 IntPoint(18, aTag->offsetTop()), IntPoint(18, aTag->offsetTop()), | 10511 IntPoint(18, aTag->offsetTop()), IntPoint(18, aTag->offsetTop()), |
10512 WebPointerProperties::Button::NoButton, PlatformEvent::MouseMoved, 0, | 10512 WebPointerProperties::Button::NoButton, PlatformEvent::MouseMoved, 0, |
10513 PlatformEvent::NoModifiers, WTF::monotonicallyIncreasingTime()); | 10513 PlatformEvent::NoModifiers, WTF::monotonicallyIncreasingTime()); |
10514 document->frame()->eventHandler().handleMouseMoveEvent(mouseMoveEvent); | 10514 document->frame()->eventHandler().handleMouseMoveEvent( |
| 10515 mouseMoveEvent, Vector<PlatformMouseEvent>()); |
10515 | 10516 |
10516 EXPECT_EQ( | 10517 EXPECT_EQ( |
10517 Cursor::Type::Pointer, | 10518 Cursor::Type::Pointer, |
10518 document->frame()->chromeClient().lastSetCursorForTesting().getType()); | 10519 document->frame()->chromeClient().lastSetCursorForTesting().getType()); |
10519 | 10520 |
10520 PlatformMouseEvent mousePressEvent( | 10521 PlatformMouseEvent mousePressEvent( |
10521 IntPoint(18, aTag->offsetTop()), IntPoint(18, aTag->offsetTop()), | 10522 IntPoint(18, aTag->offsetTop()), IntPoint(18, aTag->offsetTop()), |
10522 WebPointerProperties::Button::Left, PlatformEvent::MousePressed, 0, | 10523 WebPointerProperties::Button::Left, PlatformEvent::MousePressed, 0, |
10523 PlatformEvent::Modifiers::LeftButtonDown, | 10524 PlatformEvent::Modifiers::LeftButtonDown, |
10524 WTF::monotonicallyIncreasingTime()); | 10525 WTF::monotonicallyIncreasingTime()); |
(...skipping 13 matching lines...) Expand all Loading... |
10538 // active hover element. | 10539 // active hover element. |
10539 webView->mainFrameImpl()->frameView()->setScrollbarsHidden(true); | 10540 webView->mainFrameImpl()->frameView()->setScrollbarsHidden(true); |
10540 | 10541 |
10541 // Ensure hittest only has link | 10542 // Ensure hittest only has link |
10542 hitTestResult = webView->coreHitTestResultAt(WebPoint(18, aTag->offsetTop())); | 10543 hitTestResult = webView->coreHitTestResultAt(WebPoint(18, aTag->offsetTop())); |
10543 | 10544 |
10544 EXPECT_TRUE(hitTestResult.URLElement()); | 10545 EXPECT_TRUE(hitTestResult.URLElement()); |
10545 EXPECT_TRUE(hitTestResult.innerElement()); | 10546 EXPECT_TRUE(hitTestResult.innerElement()); |
10546 EXPECT_FALSE(hitTestResult.scrollbar()); | 10547 EXPECT_FALSE(hitTestResult.scrollbar()); |
10547 | 10548 |
10548 document->frame()->eventHandler().handleMouseMoveEvent(mouseMoveEvent); | 10549 document->frame()->eventHandler().handleMouseMoveEvent( |
| 10550 mouseMoveEvent, Vector<PlatformMouseEvent>()); |
10549 | 10551 |
10550 EXPECT_EQ( | 10552 EXPECT_EQ( |
10551 Cursor::Type::Hand, | 10553 Cursor::Type::Hand, |
10552 document->frame()->chromeClient().lastSetCursorForTesting().getType()); | 10554 document->frame()->chromeClient().lastSetCursorForTesting().getType()); |
10553 | 10555 |
10554 document->frame()->eventHandler().handleMousePressEvent(mousePressEvent); | 10556 document->frame()->eventHandler().handleMousePressEvent(mousePressEvent); |
10555 | 10557 |
10556 EXPECT_TRUE(document->activeHoverElement()); | 10558 EXPECT_TRUE(document->activeHoverElement()); |
10557 EXPECT_TRUE(document->hoverNode()); | 10559 EXPECT_TRUE(document->hoverNode()); |
10558 | 10560 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10649 Frame* mainFrame = webViewHelper.webView()->mainFrameImpl()->frame(); | 10651 Frame* mainFrame = webViewHelper.webView()->mainFrameImpl()->frame(); |
10650 HashSet<AtomicString> names; | 10652 HashSet<AtomicString> names; |
10651 for (Frame* frame = mainFrame->tree().firstChild(); frame; | 10653 for (Frame* frame = mainFrame->tree().firstChild(); frame; |
10652 frame = frame->tree().traverseNext()) { | 10654 frame = frame->tree().traverseNext()) { |
10653 EXPECT_TRUE(names.add(frame->tree().uniqueName()).isNewEntry); | 10655 EXPECT_TRUE(names.add(frame->tree().uniqueName()).isNewEntry); |
10654 } | 10656 } |
10655 EXPECT_EQ(10u, names.size()); | 10657 EXPECT_EQ(10u, names.size()); |
10656 } | 10658 } |
10657 | 10659 |
10658 } // namespace blink | 10660 } // namespace blink |
OLD | NEW |