| Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| index cd14d6e4365deb08fdaa264cfed39157016bd808..e66f21e1ff1c52e151ee230c1ba35913acd226ac 100644
|
| --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| @@ -5125,21 +5125,20 @@ TEST_P(ParameterizedWebFrameTest, MoveCaretSelectionTowardsWindowPointWithNoSele
|
|
|
| class SpellCheckClient : public WebSpellCheckClient {
|
| public:
|
| - explicit SpellCheckClient(uint32_t hash = 0) : m_numberOfTimesChecked(0), m_hash(hash) { }
|
| + explicit SpellCheckClient() : m_numberOfTimesChecked(0) { }
|
| virtual ~SpellCheckClient() { }
|
| - void requestCheckingOfText(const WebString&, const WebVector<uint32_t>&, const WebVector<unsigned>&, WebTextCheckingCompletion* completion) override
|
| + void requestCheckingOfText(const WebString&, WebTextCheckingCompletion* completion) override
|
| {
|
| ++m_numberOfTimesChecked;
|
| Vector<WebTextCheckingResult> results;
|
| const int misspellingStartOffset = 1;
|
| const int misspellingLength = 8;
|
| - results.append(WebTextCheckingResult(WebTextDecorationTypeSpelling, misspellingStartOffset, misspellingLength, WebString(), m_hash));
|
| + results.append(WebTextCheckingResult(WebTextDecorationTypeSpelling, misspellingStartOffset, misspellingLength, WebString()));
|
| completion->didFinishCheckingText(results);
|
| }
|
| int numberOfTimesChecked() const { return m_numberOfTimesChecked; }
|
| private:
|
| int m_numberOfTimesChecked;
|
| - uint32_t m_hash;
|
| };
|
|
|
| TEST_P(ParameterizedWebFrameTest, ReplaceMisspelledRange)
|
| @@ -5224,45 +5223,13 @@ TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkersUnderWords)
|
| document->execCommand("InsertText", false, " wellcome ", exceptionState);
|
| EXPECT_FALSE(exceptionState.hadException());
|
|
|
| - WebVector<uint32_t> documentMarkers1;
|
| - webViewHelper.webView()->spellingMarkers(&documentMarkers1);
|
| - EXPECT_EQ(1U, documentMarkers1.size());
|
| + ASSERT_EQ(1U, document->markers().markers().size());
|
|
|
| Vector<String> words;
|
| words.append("wellcome");
|
| frame->removeSpellingMarkersUnderWords(words);
|
|
|
| - WebVector<uint32_t> documentMarkers2;
|
| - webViewHelper.webView()->spellingMarkers(&documentMarkers2);
|
| - EXPECT_EQ(0U, documentMarkers2.size());
|
| -}
|
| -
|
| -TEST_P(ParameterizedWebFrameTest, MarkerHashIdentifiers)
|
| -{
|
| - registerMockedHttpURLLoad("spell.html");
|
| - FrameTestHelpers::WebViewHelper webViewHelper(this);
|
| - webViewHelper.initializeAndLoad(m_baseURL + "spell.html");
|
| -
|
| - static const uint32_t kHash = 42;
|
| - SpellCheckClient spellcheck(kHash);
|
| - webViewHelper.webView()->setSpellCheckClient(&spellcheck);
|
| -
|
| - WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
|
| - Document* document = frame->frame()->document();
|
| - Element* element = document->getElementById("data");
|
| -
|
| - webViewHelper.webView()->settings()->setUnifiedTextCheckerEnabled(true);
|
| - webViewHelper.webView()->settings()->setEditingBehavior(WebSettings::EditingBehaviorWin);
|
| -
|
| - element->focus();
|
| - NonThrowableExceptionState exceptionState;
|
| - document->execCommand("InsertText", false, "wellcome.", exceptionState);
|
| - EXPECT_FALSE(exceptionState.hadException());
|
| -
|
| - WebVector<uint32_t> documentMarkers;
|
| - webViewHelper.webView()->spellingMarkers(&documentMarkers);
|
| - EXPECT_EQ(1U, documentMarkers.size());
|
| - EXPECT_EQ(kHash, documentMarkers[0]);
|
| + ASSERT_EQ(0U, document->markers().markers().size());
|
| }
|
|
|
| class StubbornSpellCheckClient : public WebSpellCheckClient {
|
| @@ -5272,8 +5239,6 @@ public:
|
|
|
| virtual void requestCheckingOfText(
|
| const WebString&,
|
| - const WebVector<uint32_t>&,
|
| - const WebVector<unsigned>&,
|
| WebTextCheckingCompletion* completion) override
|
| {
|
| m_completion = completion;
|
| @@ -5289,11 +5254,6 @@ public:
|
| kick(1, 8, WebTextDecorationTypeSpelling);
|
| }
|
|
|
| - void kickInvisibleSpellcheck()
|
| - {
|
| - kick(1, 8, WebTextDecorationTypeInvisibleSpellcheck);
|
| - }
|
| -
|
| private:
|
| void kick(int misspellingStartOffset, int misspellingLength, WebTextDecorationType type)
|
| {
|
| @@ -5334,9 +5294,7 @@ TEST_P(ParameterizedWebFrameTest, SlowSpellcheckMarkerPosition)
|
|
|
| spellcheck.kick();
|
|
|
| - WebVector<uint32_t> documentMarkers;
|
| - webViewHelper.webView()->spellingMarkers(&documentMarkers);
|
| - EXPECT_EQ(0U, documentMarkers.size());
|
| + ASSERT_EQ(0U, document->markers().markers().size());
|
| }
|
|
|
| // This test verifies that cancelling spelling request does not cause a
|
| @@ -5385,8 +5343,7 @@ TEST_P(ParameterizedWebFrameTest, SpellcheckResultErasesMarkers)
|
| EXPECT_FALSE(exceptionState.hadException());
|
| auto range = EphemeralRange::rangeOfContents(*element);
|
| document->markers().addMarker(range.startPosition(), range.endPosition(), DocumentMarker::Spelling);
|
| - document->markers().addMarker(range.startPosition(), range.endPosition(), DocumentMarker::InvisibleSpellcheck);
|
| - EXPECT_EQ(2U, document->markers().markers().size());
|
| + EXPECT_EQ(1U, document->markers().markers().size());
|
|
|
| spellcheck.kickNoResults();
|
| EXPECT_EQ(0U, document->markers().markers().size());
|
| @@ -5420,11 +5377,6 @@ TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument)
|
|
|
| document->execCommand("InsertText", false, "wellcome ", exceptionState);
|
| EXPECT_FALSE(exceptionState.hadException());
|
| -
|
| - spellcheck.kickInvisibleSpellcheck();
|
| - ASSERT_EQ(1U, document->markers().markers().size());
|
| - ASSERT_NE(static_cast<DocumentMarker*>(0), document->markers().markers()[0]);
|
| - EXPECT_EQ(DocumentMarker::InvisibleSpellcheck, document->markers().markers()[0]->type());
|
| }
|
|
|
| class TestAccessInitialDocumentWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
|
|
|