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

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

Issue 2962473002: Make Position::LastPositionInNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-26T14:00:00 Created 3 years, 6 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/spellcheck/SpellChecker.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/spellcheck/SpellChecker.h" 5 #include "core/editing/spellcheck/SpellChecker.h"
6 6
7 #include "core/editing/Editor.h" 7 #include "core/editing/Editor.h"
8 #include "core/editing/markers/DocumentMarkerController.h" 8 #include "core/editing/markers/DocumentMarkerController.h"
9 #include "core/editing/markers/SpellCheckMarker.h" 9 #include "core/editing/markers/SpellCheckMarker.h"
10 #include "core/editing/spellcheck/SpellCheckRequester.h" 10 #include "core/editing/spellcheck/SpellCheckRequester.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 GetSpellChecker().AdvanceToNextMisspelling(false); 58 GetSpellChecker().AdvanceToNextMisspelling(false);
59 } 59 }
60 60
61 // Regression test for crbug.com/728801 61 // Regression test for crbug.com/728801
62 TEST_F(SpellCheckerTest, AdvancedToNextMisspellingWrapSearchNoCrash) { 62 TEST_F(SpellCheckerTest, AdvancedToNextMisspellingWrapSearchNoCrash) {
63 SetBodyContent("<div contenteditable> zz zz zz </div>"); 63 SetBodyContent("<div contenteditable> zz zz zz </div>");
64 64
65 Element* div = GetDocument().QuerySelector("div"); 65 Element* div = GetDocument().QuerySelector("div");
66 div->focus(); 66 div->focus();
67 Selection().SetSelection(SelectionInDOMTree::Builder() 67 Selection().SetSelection(SelectionInDOMTree::Builder()
68 .Collapse(Position::LastPositionInNode(div)) 68 .Collapse(Position::LastPositionInNode(*div))
69 .Build()); 69 .Build());
70 UpdateAllLifecyclePhases(); 70 UpdateAllLifecyclePhases();
71 71
72 GetSpellChecker().AdvanceToNextMisspelling(false); 72 GetSpellChecker().AdvanceToNextMisspelling(false);
73 } 73 }
74 74
75 TEST_F(SpellCheckerTest, SpellCheckDoesNotCauseUpdateLayout) { 75 TEST_F(SpellCheckerTest, SpellCheckDoesNotCauseUpdateLayout) {
76 SetBodyContent("<input>"); 76 SetBodyContent("<input>");
77 HTMLInputElement* input = 77 HTMLInputElement* input =
78 toHTMLInputElement(GetDocument().QuerySelector("input")); 78 toHTMLInputElement(GetDocument().QuerySelector("input"));
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 373
374 Optional<std::pair<Node*, SpellCheckMarker*>> result = 374 Optional<std::pair<Node*, SpellCheckMarker*>> result =
375 GetDocument() 375 GetDocument()
376 .GetFrame() 376 .GetFrame()
377 ->GetSpellChecker() 377 ->GetSpellChecker()
378 .GetSpellCheckMarkerTouchingSelection(); 378 .GetSpellCheckMarkerTouchingSelection();
379 EXPECT_FALSE(result); 379 EXPECT_FALSE(result);
380 } 380 }
381 381
382 } // namespace blink 382 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698