OLD | NEW |
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/spellcheck/SpellCheckRequester.h" | 10 #include "core/editing/spellcheck/SpellCheckRequester.h" |
10 #include "core/editing/spellcheck/SpellCheckTestBase.h" | 11 #include "core/editing/spellcheck/SpellCheckTestBase.h" |
11 #include "core/frame/LocalFrame.h" | 12 #include "core/frame/LocalFrame.h" |
12 #include "core/frame/LocalFrameView.h" | 13 #include "core/frame/LocalFrameView.h" |
13 #include "core/frame/Settings.h" | 14 #include "core/frame/Settings.h" |
14 #include "core/html/HTMLInputElement.h" | 15 #include "core/html/HTMLInputElement.h" |
15 | 16 |
16 namespace blink { | 17 namespace blink { |
17 | 18 |
18 class SpellCheckerTest : public SpellCheckTestBase { | 19 class SpellCheckerTest : public SpellCheckTestBase { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 result.length = 8; | 103 result.length = 8; |
103 result.replacements = Vector<String>({"spellcheck", "spillchuck"}); | 104 result.replacements = Vector<String>({"spellcheck", "spillchuck"}); |
104 | 105 |
105 GetDocument().GetFrame()->GetSpellChecker().MarkAndReplaceFor( | 106 GetDocument().GetFrame()->GetSpellChecker().MarkAndReplaceFor( |
106 request, Vector<TextCheckingResult>({result})); | 107 request, Vector<TextCheckingResult>({result})); |
107 | 108 |
108 ASSERT_EQ(1u, GetDocument().Markers().Markers().size()); | 109 ASSERT_EQ(1u, GetDocument().Markers().Markers().size()); |
109 | 110 |
110 // The Spelling marker's description should be a newline-separated list of the | 111 // The Spelling marker's description should be a newline-separated list of the |
111 // suggested replacements | 112 // suggested replacements |
112 EXPECT_EQ("spellcheck\nspillchuck", | 113 EXPECT_EQ( |
113 GetDocument().Markers().Markers()[0]->Description()); | 114 "spellcheck\nspillchuck", |
| 115 ToSpellCheckMarker(GetDocument().Markers().Markers()[0])->Description()); |
114 } | 116 } |
115 | 117 |
116 } // namespace blink | 118 } // namespace blink |
OLD | NEW |