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

Unified Diff: third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp

Issue 2642913003: Select All should show handles if they were already present (Closed)
Patch Set: added tests Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
index 96c14d16f740e3fa91102d8348a283d458a097dd..3cb855e83eb6036d57582fbdebb6bbe24aad80f0 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
@@ -308,6 +308,23 @@ TEST_F(FrameSelectionTest, SelectAllWithUnselectableRoot) {
"selctable.";
}
+TEST_F(FrameSelectionTest, SelectAllKeepsHandle) {
+ setBodyContent("<div id=sample>abc</div>");
+ Element* sample = document().getElementById("sample");
+ const Position endOfText(sample->firstChild(), 3);
+ FrameSelection::SetSelectionOptions options =
+ FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle |
+ FrameSelection::HandleVisible;
+ selection().setSelection(
+ SelectionInDOMTree::Builder().collapse(endOfText).build(), options);
+ EXPECT_TRUE(selection().isHandleVisible());
+ selection().selectAll();
+ EXPECT_TRUE(selection().isHandleVisible())
+ << "If handles were present before"
+ "selectAll. Then they should be present"
+ "after it.";
+}
+
TEST_F(FrameSelectionTest, updateIfNeededAndFrameCaret) {
setBodyContent("<style id=sample></style>");
document().setDesignMode("on");

Powered by Google App Engine
This is Rietveld 408576698