| OLD | NEW |
| 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/html/HTMLTextFormControlElement.h" | 5 #include "core/html/HTMLTextFormControlElement.h" |
| 6 | 6 |
| 7 #include "core/dom/Text.h" | 7 #include "core/dom/Text.h" |
| 8 #include "core/editing/FrameSelection.h" | 8 #include "core/editing/FrameSelection.h" |
| 9 #include "core/editing/Position.h" | 9 #include "core/editing/Position.h" |
| 10 #include "core/editing/VisibleSelection.h" | 10 #include "core/editing/VisibleSelection.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 SCOPED_TRACE("HTMLTextFormControlElement::startOfSentence"); | 161 SCOPED_TRACE("HTMLTextFormControlElement::startOfSentence"); |
| 162 testFunctionEquivalence(position, HTMLTextFormControlElement::startO
fSentence, startOfSentence); | 162 testFunctionEquivalence(position, HTMLTextFormControlElement::startO
fSentence, startOfSentence); |
| 163 } | 163 } |
| 164 { | 164 { |
| 165 SCOPED_TRACE("HTMLTextFormControlElement::endOfSentence"); | 165 SCOPED_TRACE("HTMLTextFormControlElement::endOfSentence"); |
| 166 testFunctionEquivalence(position, HTMLTextFormControlElement::endOfS
entence, endOfSentence); | 166 testFunctionEquivalence(position, HTMLTextFormControlElement::endOfS
entence, endOfSentence); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 | 170 |
| 171 TEST_F(HTMLTextFormControlElementTest, WordAndSentenceBoundary) | 171 // Flakily failing under MAC ASAN. See https://crbug.com/592880. |
| 172 #if OS(MACOSX) && defined(ADDRESS_SANITIZER) |
| 173 #define MAYBE_WordAndSentenceBoundary DISABLED_WordAndSentenceBoundary |
| 174 #else |
| 175 #define MAYBE_WordAndSentenceBoundary WordAndSentenceBoundary |
| 176 #endif |
| 177 TEST_F(HTMLTextFormControlElementTest, MAYBE_WordAndSentenceBoundary) |
| 172 { | 178 { |
| 173 HTMLElement* innerText = textControl().innerEditorElement(); | 179 HTMLElement* innerText = textControl().innerEditorElement(); |
| 174 { | 180 { |
| 175 SCOPED_TRACE("String is value."); | 181 SCOPED_TRACE("String is value."); |
| 176 innerText->removeChildren(); | 182 innerText->removeChildren(); |
| 177 innerText->setNodeValue("Hel\nlo, text form.\n"); | 183 innerText->setNodeValue("Hel\nlo, text form.\n"); |
| 178 testBoundary(document(), textControl()); | 184 testBoundary(document(), textControl()); |
| 179 } | 185 } |
| 180 { | 186 { |
| 181 SCOPED_TRACE("A Text node and a BR element"); | 187 SCOPED_TRACE("A Text node and a BR element"); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 208 ASSERT_EQ(3, input->selectionStart()); | 214 ASSERT_EQ(3, input->selectionStart()); |
| 209 | 215 |
| 210 OwnPtrWillBePersistent<SpellChecker> spellChecker(SpellChecker::create(page(
).frame())); | 216 OwnPtrWillBePersistent<SpellChecker> spellChecker(SpellChecker::create(page(
).frame())); |
| 211 forceLayoutFlag(); | 217 forceLayoutFlag(); |
| 212 int startCount = layoutCount(); | 218 int startCount = layoutCount(); |
| 213 spellChecker->respondToChangedSelection(oldSelection, FrameSelection::CloseT
yping | FrameSelection::ClearTypingStyle); | 219 spellChecker->respondToChangedSelection(oldSelection, FrameSelection::CloseT
yping | FrameSelection::ClearTypingStyle); |
| 214 EXPECT_EQ(startCount, layoutCount()); | 220 EXPECT_EQ(startCount, layoutCount()); |
| 215 } | 221 } |
| 216 | 222 |
| 217 } // namespace blink | 223 } // namespace blink |
| OLD | NEW |