| 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/EditingTestBase.h" | 7 #include "core/editing/EditingTestBase.h" |
| 8 #include "core/editing/Editor.h" | 8 #include "core/editing/Editor.h" |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class SpellCheckerTest : public EditingTestBase { | 13 class SpellCheckerTest : public EditingTestBase { |
| 14 }; | 14 }; |
| 15 | 15 |
| 16 TEST_F(SpellCheckerTest, AdvanceToNextMisspellingWithEmptyInputNoCrash) | 16 TEST_F(SpellCheckerTest, AdvanceToNextMisspellingWithEmptyInputNoCrash) |
| 17 { | 17 { |
| 18 setBodyContent("<input placeholder='placeholder'>abc"); | 18 setBodyContent("<input placeholder='placeholder'>abc"); |
| 19 updateLayoutAndStyleForPainting(); | 19 updateLayoutAndStyleForPainting(); |
| 20 RefPtrWillBeRawPtr<Element> input = document().querySelector("input", ASSERT
_NO_EXCEPTION); | 20 RawPtr<Element> input = document().querySelector("input", ASSERT_NO_EXCEPTIO
N); |
| 21 input->focus(); | 21 input->focus(); |
| 22 document().settings()->setUnifiedTextCheckerEnabled(true); | 22 document().settings()->setUnifiedTextCheckerEnabled(true); |
| 23 // Do not crash in AdvanceToNextMisspelling command. | 23 // Do not crash in AdvanceToNextMisspelling command. |
| 24 EXPECT_TRUE(document().frame()->editor().executeCommand("AdvanceToNextMisspe
lling")); | 24 EXPECT_TRUE(document().frame()->editor().executeCommand("AdvanceToNextMisspe
lling")); |
| 25 document().settings()->setUnifiedTextCheckerEnabled(false); | 25 document().settings()->setUnifiedTextCheckerEnabled(false); |
| 26 } | 26 } |
| 27 | 27 |
| 28 } // namespace blink | 28 } // namespace blink |
| OLD | NEW |