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

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

Issue 2663593002: Select All should show handles if they were already present (Closed)
Patch Set: Rebased Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2565180040837c82142ce0958a09074488d04fa7 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
@@ -308,6 +308,33 @@ TEST_F(FrameSelectionTest, SelectAllWithUnselectableRoot) {
"selctable.";
}
+TEST_F(FrameSelectionTest, SelectAllPreservesHandle) {
+ setBodyContent("<div id=sample>abc</div>");
+ Element* sample = document().getElementById("sample");
+ const Position endOfText(sample->firstChild(), 3);
+ selection().setSelection(SelectionInDOMTree::Builder()
+ .collapse(endOfText)
+ .setIsHandleVisible(false)
+ .build());
+ EXPECT_FALSE(selection().isHandleVisible());
+ selection().selectAll();
+ EXPECT_FALSE(selection().isHandleVisible())
+ << "If handles weren't present before"
+ "selectAll. Then they shouldn't be present"
+ "after it.";
+
+ selection().setSelection(SelectionInDOMTree::Builder()
+ .collapse(endOfText)
+ .setIsHandleVisible(true)
+ .build());
+ 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");
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698