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

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

Issue 2211813002: Revert removal of grammar checking and marking code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor fix Created 4 years, 4 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/SpellCheckerClientImpl.cpp ('k') | no next file » | 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 cd14d6e4365deb08fdaa264cfed39157016bd808..2b9c3e87a72dae0d9d53d3d2b0ea1754801dfb72 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -5289,6 +5289,11 @@ public:
kick(1, 8, WebTextDecorationTypeSpelling);
}
+ void kickGrammar()
+ {
+ kick(1, 8, WebTextDecorationTypeGrammar);
+ }
+
void kickInvisibleSpellcheck()
{
kick(1, 8, WebTextDecorationTypeInvisibleSpellcheck);
@@ -5385,8 +5390,9 @@ 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::Grammar);
document->markers().addMarker(range.startPosition(), range.endPosition(), DocumentMarker::InvisibleSpellcheck);
- EXPECT_EQ(2U, document->markers().markers().size());
+ EXPECT_EQ(3U, document->markers().markers().size());
spellcheck.kickNoResults();
EXPECT_EQ(0U, document->markers().markers().size());
@@ -5421,6 +5427,14 @@ TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument)
document->execCommand("InsertText", false, "wellcome ", exceptionState);
EXPECT_FALSE(exceptionState.hadException());
+ spellcheck.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());
+
+ 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]);
« no previous file with comments | « third_party/WebKit/Source/web/SpellCheckerClientImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698