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 11528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11539 webView->resize(WebSize(500, 300)); | 11539 webView->resize(WebSize(500, 300)); |
11540 webView->updateAllLifecyclePhases(); | 11540 webView->updateAllLifecyclePhases(); |
11541 runPendingTasks(); | 11541 runPendingTasks(); |
11542 webView->setInitialFocus(false); | 11542 webView->setInitialFocus(false); |
11543 runPendingTasks(); | 11543 runPendingTasks(); |
11544 | 11544 |
11545 WebMouseEvent mouseEvent(WebInputEvent::MouseDown, WebInputEvent::NoModifiers, | 11545 WebMouseEvent mouseEvent(WebInputEvent::MouseDown, WebInputEvent::NoModifiers, |
11546 WebInputEvent::TimeStampForTesting); | 11546 WebInputEvent::TimeStampForTesting); |
11547 | 11547 |
11548 mouseEvent.button = WebMouseEvent::Button::Right; | 11548 mouseEvent.button = WebMouseEvent::Button::Right; |
11549 mouseEvent.x = 10; | 11549 mouseEvent.setPositionInWidget(10, 10); |
11550 mouseEvent.y = 10; | |
11551 mouseEvent.clickCount = 1; | 11550 mouseEvent.clickCount = 1; |
11552 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); | 11551 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); |
11553 runPendingTasks(); | 11552 runPendingTasks(); |
11554 webViewHelper.reset(); | 11553 webViewHelper.reset(); |
11555 return frame.getMenuData().editFlags & WebContextMenuData::CanSelectAll; | 11554 return frame.getMenuData().editFlags & WebContextMenuData::CanSelectAll; |
11556 } | 11555 } |
11557 | 11556 |
11558 TEST_F(WebFrameTest, ContextMenuData) { | 11557 TEST_F(WebFrameTest, ContextMenuData) { |
11559 EXPECT_FALSE(testSelectAll("<textarea></textarea>")); | 11558 EXPECT_FALSE(testSelectAll("<textarea></textarea>")); |
11560 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>")); | 11559 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>")); |
11561 EXPECT_FALSE(testSelectAll("<input>")); | 11560 EXPECT_FALSE(testSelectAll("<input>")); |
11562 EXPECT_TRUE(testSelectAll("<input value='nonempty'>")); | 11561 EXPECT_TRUE(testSelectAll("<input value='nonempty'>")); |
11563 // TODO(amaralp): Empty contenteditable should not have select all enabled. | 11562 // TODO(amaralp): Empty contenteditable should not have select all enabled. |
11564 EXPECT_TRUE(testSelectAll("<div contenteditable></div>")); | 11563 EXPECT_TRUE(testSelectAll("<div contenteditable></div>")); |
11565 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>")); | 11564 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>")); |
11566 } | 11565 } |
11567 | 11566 |
11568 } // namespace blink | 11567 } // namespace blink |
OLD | NEW |