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

Side by Side Diff: third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp

Issue 1647833002: Fix an assertion failure in FrameSelection::selectAll(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/editing/FrameSelection.h" 5 #include "core/editing/FrameSelection.h"
6 6
7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/Element.h" 9 #include "core/dom/Element.h"
10 #include "core/dom/Text.h" 10 #include "core/dom/Text.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 EXPECT_EQ(Position::beforeNode(bottom->parentNode()), visibleSelectionInDOMT ree().extent()); 207 EXPECT_EQ(Position::beforeNode(bottom->parentNode()), visibleSelectionInDOMT ree().extent());
208 EXPECT_EQ(Position(bottom, 0), visibleSelectionInDOMTree().start()); 208 EXPECT_EQ(Position(bottom, 0), visibleSelectionInDOMTree().start());
209 EXPECT_EQ(Position(bottom, 3), visibleSelectionInDOMTree().end()); 209 EXPECT_EQ(Position(bottom, 3), visibleSelectionInDOMTree().end());
210 210
211 EXPECT_EQ(PositionInComposedTree(bottom, 3), visibleSelectionInComposedTree( ).base()); 211 EXPECT_EQ(PositionInComposedTree(bottom, 3), visibleSelectionInComposedTree( ).base());
212 EXPECT_EQ(PositionInComposedTree(top, 1), visibleSelectionInComposedTree().e xtent()); 212 EXPECT_EQ(PositionInComposedTree(top, 1), visibleSelectionInComposedTree().e xtent());
213 EXPECT_EQ(PositionInComposedTree(top, 1), visibleSelectionInComposedTree().s tart()); 213 EXPECT_EQ(PositionInComposedTree(top, 1), visibleSelectionInComposedTree().s tart());
214 EXPECT_EQ(PositionInComposedTree(bottom, 3), visibleSelectionInComposedTree( ).end()); 214 EXPECT_EQ(PositionInComposedTree(bottom, 3), visibleSelectionInComposedTree( ).end());
215 } 215 }
216 216
217 TEST_F(FrameSelectionTest, SelectAllWithUnselectableRoot)
218 {
219 RefPtrWillBeRawPtr<Element> select = document().createElement("select", ASSE RT_NO_EXCEPTION);
220 document().replaceChild(select.get(), document().documentElement());
221 selection().selectAll();
222 EXPECT_TRUE(selection().isNone()) << "Nothing should be selected if the cont ent of the documentElement is not selctable.";
223 }
224
217 } // namespace blink 225 } // namespace blink
OLDNEW
« 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