Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Side by Side Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2782893002: WebMouseEvent coordinates are now fractional & private (Closed)
Patch Set: Truncated to int on input, git cl format Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698