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 11468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11479 webView->resize(WebSize(500, 300)); | 11479 webView->resize(WebSize(500, 300)); |
11480 webView->updateAllLifecyclePhases(); | 11480 webView->updateAllLifecyclePhases(); |
11481 runPendingTasks(); | 11481 runPendingTasks(); |
11482 webView->setInitialFocus(false); | 11482 webView->setInitialFocus(false); |
11483 runPendingTasks(); | 11483 runPendingTasks(); |
11484 | 11484 |
11485 WebMouseEvent mouseEvent(WebInputEvent::MouseDown, WebInputEvent::NoModifiers, | 11485 WebMouseEvent mouseEvent(WebInputEvent::MouseDown, WebInputEvent::NoModifiers, |
11486 WebInputEvent::TimeStampForTesting); | 11486 WebInputEvent::TimeStampForTesting); |
11487 | 11487 |
11488 mouseEvent.button = WebMouseEvent::Button::Right; | 11488 mouseEvent.button = WebMouseEvent::Button::Right; |
11489 mouseEvent.x = 10; | 11489 mouseEvent.position.x = 10; |
11490 mouseEvent.y = 10; | 11490 mouseEvent.position.y = 10; |
11491 mouseEvent.clickCount = 1; | 11491 mouseEvent.clickCount = 1; |
11492 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); | 11492 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); |
11493 runPendingTasks(); | 11493 runPendingTasks(); |
11494 webViewHelper.reset(); | 11494 webViewHelper.reset(); |
11495 return frame.getMenuData().editFlags & WebContextMenuData::CanSelectAll; | 11495 return frame.getMenuData().editFlags & WebContextMenuData::CanSelectAll; |
11496 } | 11496 } |
11497 | 11497 |
11498 TEST_F(WebFrameTest, ContextMenuData) { | 11498 TEST_F(WebFrameTest, ContextMenuData) { |
11499 EXPECT_FALSE(testSelectAll("<textarea></textarea>")); | 11499 EXPECT_FALSE(testSelectAll("<textarea></textarea>")); |
11500 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>")); | 11500 EXPECT_TRUE(testSelectAll("<textarea>nonempty</textarea>")); |
11501 EXPECT_FALSE(testSelectAll("<input>")); | 11501 EXPECT_FALSE(testSelectAll("<input>")); |
11502 EXPECT_TRUE(testSelectAll("<input value='nonempty'>")); | 11502 EXPECT_TRUE(testSelectAll("<input value='nonempty'>")); |
11503 // TODO(amaralp): Empty contenteditable should not have select all enabled. | 11503 // TODO(amaralp): Empty contenteditable should not have select all enabled. |
11504 EXPECT_TRUE(testSelectAll("<div contenteditable></div>")); | 11504 EXPECT_TRUE(testSelectAll("<div contenteditable></div>")); |
11505 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>")); | 11505 EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>")); |
11506 } | 11506 } |
11507 | 11507 |
11508 } // namespace blink | 11508 } // namespace blink |
OLD | NEW |