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

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2791753003: Split WebTextCheckClient off WebSpellCheckClient (Closed)
Patch Set: Add TODOs for class renaming Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d936487d2f1f6807e164e89c71e22cc8f3a1ffd8..08ecb98eea0874d1cf52442f89e83c550bc66917 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -136,7 +136,7 @@
#include "public/web/WebSecurityPolicy.h"
#include "public/web/WebSelection.h"
#include "public/web/WebSettings.h"
-#include "public/web/WebSpellCheckClient.h"
+#include "public/web/WebTextCheckClient.h"
#include "public/web/WebTextCheckingCompletion.h"
#include "public/web/WebTextCheckingResult.h"
#include "public/web/WebViewClient.h"
@@ -6264,10 +6264,10 @@ TEST_P(ParameterizedWebFrameTest,
frame->toWebLocalFrame()->moveCaretSelection(WebPoint(0, 0));
}
-class SpellCheckClient : public WebSpellCheckClient {
+class TextCheckClient : public WebTextCheckClient {
public:
- SpellCheckClient() : m_numberOfTimesChecked(0) {}
- virtual ~SpellCheckClient() {}
+ TextCheckClient() : m_numberOfTimesChecked(0) {}
+ virtual ~TextCheckClient() {}
void requestCheckingOfText(const WebString&,
WebTextCheckingCompletion* completion) override {
++m_numberOfTimesChecked;
@@ -6289,8 +6289,8 @@ TEST_P(ParameterizedWebFrameTest, ReplaceMisspelledRange) {
registerMockedHttpURLLoad("spell.html");
FrameTestHelpers::WebViewHelper webViewHelper;
initializeTextSelectionWebView(m_baseURL + "spell.html", &webViewHelper);
- SpellCheckClient spellcheck;
- webViewHelper.webView()->setSpellCheckClient(&spellcheck);
+ TextCheckClient textcheck;
+ webViewHelper.webView()->setTextCheckClient(&textcheck);
WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
Document* document = frame->frame()->document();
@@ -6320,7 +6320,7 @@ TEST_P(ParameterizedWebFrameTest, ReplaceMisspelledRange) {
.computeVisibleSelectionInDOMTreeDeprecated()
.toNormalizedEphemeralRange();
- EXPECT_EQ(1, spellcheck.numberOfTimesChecked());
+ EXPECT_EQ(1, textcheck.numberOfTimesChecked());
EXPECT_EQ(1U, document->markers()
.markersInRange(selectionRange, DocumentMarker::Spelling)
.size());
@@ -6336,8 +6336,8 @@ TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkers) {
registerMockedHttpURLLoad("spell.html");
FrameTestHelpers::WebViewHelper webViewHelper;
initializeTextSelectionWebView(m_baseURL + "spell.html", &webViewHelper);
- SpellCheckClient spellcheck;
- webViewHelper.webView()->setSpellCheckClient(&spellcheck);
+ TextCheckClient textcheck;
+ webViewHelper.webView()->setTextCheckClient(&textcheck);
WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
Document* document = frame->frame()->document();
@@ -6378,8 +6378,8 @@ TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkersUnderWords) {
registerMockedHttpURLLoad("spell.html");
FrameTestHelpers::WebViewHelper webViewHelper;
initializeTextSelectionWebView(m_baseURL + "spell.html", &webViewHelper);
- SpellCheckClient spellcheck;
- webViewHelper.webView()->setSpellCheckClient(&spellcheck);
+ TextCheckClient textcheck;
+ webViewHelper.webView()->setTextCheckClient(&textcheck);
LocalFrame* frame = webViewHelper.webView()->mainFrameImpl()->frame();
Document* document = frame->document();
@@ -6409,10 +6409,10 @@ TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkersUnderWords) {
EXPECT_EQ(0U, offsets2.size());
}
-class StubbornSpellCheckClient : public WebSpellCheckClient {
+class StubbornTextCheckClient : public WebTextCheckClient {
public:
- StubbornSpellCheckClient() : m_completion(0) {}
- virtual ~StubbornSpellCheckClient() {}
+ StubbornTextCheckClient() : m_completion(0) {}
+ virtual ~StubbornTextCheckClient() {}
virtual void requestCheckingOfText(
const WebString&,
@@ -6455,8 +6455,8 @@ TEST_P(ParameterizedWebFrameTest, SlowSpellcheckMarkerPosition) {
FrameTestHelpers::WebViewHelper webViewHelper;
initializeTextSelectionWebView(m_baseURL + "spell.html", &webViewHelper);
- StubbornSpellCheckClient spellcheck;
- webViewHelper.webView()->setSpellCheckClient(&spellcheck);
+ StubbornTextCheckClient textcheck;
+ webViewHelper.webView()->setTextCheckClient(&textcheck);
WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
Document* document = frame->frame()->document();
@@ -6479,7 +6479,7 @@ TEST_P(ParameterizedWebFrameTest, SlowSpellcheckMarkerPosition) {
.forceInvocationForTesting();
}
- spellcheck.kick();
+ textcheck.kick();
WebVector<unsigned> offsets;
webViewHelper.webView()->spellingMarkerOffsetsForTest(&offsets);
@@ -6496,7 +6496,7 @@ TEST_P(ParameterizedWebFrameTest, CancelSpellingRequestCrash) {
registerMockedHttpURLLoad("spell.html");
FrameTestHelpers::WebViewHelper webViewHelper;
webViewHelper.initializeAndLoad(m_baseURL + "spell.html");
- webViewHelper.webView()->setSpellCheckClient(0);
+ webViewHelper.webView()->setTextCheckClient(0);
WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
Document* document = frame->frame()->document();
@@ -6516,8 +6516,8 @@ TEST_P(ParameterizedWebFrameTest, SpellcheckResultErasesMarkers) {
FrameTestHelpers::WebViewHelper webViewHelper;
initializeTextSelectionWebView(m_baseURL + "spell.html", &webViewHelper);
- StubbornSpellCheckClient spellcheck;
- webViewHelper.webView()->setSpellCheckClient(&spellcheck);
+ StubbornTextCheckClient textcheck;
+ webViewHelper.webView()->setTextCheckClient(&textcheck);
WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
Document* document = frame->frame()->document();
@@ -6547,7 +6547,7 @@ TEST_P(ParameterizedWebFrameTest, SpellcheckResultErasesMarkers) {
DocumentMarker::Grammar);
EXPECT_EQ(2U, document->markers().markers().size());
- spellcheck.kickNoResults();
+ textcheck.kickNoResults();
EXPECT_EQ(0U, document->markers().markers().size());
}
@@ -6556,8 +6556,8 @@ TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument) {
FrameTestHelpers::WebViewHelper webViewHelper;
initializeTextSelectionWebView(m_baseURL + "spell.html", &webViewHelper);
- StubbornSpellCheckClient spellcheck;
- webViewHelper.webView()->setSpellCheckClient(&spellcheck);
+ StubbornTextCheckClient textcheck;
+ webViewHelper.webView()->setTextCheckClient(&textcheck);
WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
Document* document = frame->frame()->document();
@@ -6578,7 +6578,7 @@ TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument) {
.forceInvocationForTesting();
}
- spellcheck.kick();
+ textcheck.kick();
ASSERT_EQ(1U, document->markers().markers().size());
ASSERT_NE(static_cast<DocumentMarker*>(0), document->markers().markers()[0]);
EXPECT_EQ(DocumentMarker::Spelling, document->markers().markers()[0]->type());
@@ -6593,7 +6593,7 @@ TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument) {
.forceInvocationForTesting();
}
- spellcheck.kickGrammar();
+ textcheck.kickGrammar();
ASSERT_EQ(1U, document->markers().markers().size());
ASSERT_NE(static_cast<DocumentMarker*>(0), document->markers().markers()[0]);
EXPECT_EQ(DocumentMarker::Grammar, document->markers().markers()[0]->type());
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698