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

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

Issue 181693003: Have Document::markers() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | « Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index bafba998819710449b4b11738406da692a91c990..11ff8e54a8024486b71b12e54cb0d5e676c52f52 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -4098,7 +4098,7 @@ TEST_F(WebFrameTest, ReplaceMisspelledRange)
RefPtr<Range> selectionRange = frame->frame()->selection().toNormalizedRange();
EXPECT_EQ(1, spellcheck.numberOfTimesChecked());
- EXPECT_EQ(1U, document->markers()->markersInRange(selectionRange.get(), DocumentMarker::Spelling).size());
+ EXPECT_EQ(1U, document->markers().markersInRange(selectionRange.get(), DocumentMarker::Spelling).size());
frame->replaceMisspelledRange("welcome");
EXPECT_EQ("_welcome_.", frame->contentAsText(std::numeric_limits<size_t>::max()).utf8());
@@ -4130,7 +4130,7 @@ TEST_F(WebFrameTest, RemoveSpellingMarkers)
frame->selectRange(WebRange::fromDocumentRange(frame, allTextBeginOffset, allTextLength));
RefPtr<Range> selectionRange = frame->frame()->selection().toNormalizedRange();
- EXPECT_EQ(0U, document->markers()->markersInRange(selectionRange.get(), DocumentMarker::Spelling).size());
+ EXPECT_EQ(0U, document->markers().markersInRange(selectionRange.get(), DocumentMarker::Spelling).size());
}
TEST_F(WebFrameTest, MarkerHashIdentifiers) {
@@ -4280,13 +4280,13 @@ TEST_F(WebFrameTest, SpellcheckResultErasesMarkers)
element->focus();
document->execCommand("InsertText", false, "welcome ");
- document->markers()->addMarker(rangeOfContents(element->toNode()).get(), DocumentMarker::Spelling);
- document->markers()->addMarker(rangeOfContents(element->toNode()).get(), DocumentMarker::Grammar);
- document->markers()->addMarker(rangeOfContents(element->toNode()).get(), DocumentMarker::InvisibleSpellcheck);
- EXPECT_EQ(3U, document->markers()->markers().size());
+ document->markers().addMarker(rangeOfContents(element->toNode()).get(), DocumentMarker::Spelling);
+ document->markers().addMarker(rangeOfContents(element->toNode()).get(), DocumentMarker::Grammar);
+ document->markers().addMarker(rangeOfContents(element->toNode()).get(), DocumentMarker::InvisibleSpellcheck);
+ EXPECT_EQ(3U, document->markers().markers().size());
spellcheck.kickNoResults();
- EXPECT_EQ(0U, document->markers()->markers().size());
+ EXPECT_EQ(0U, document->markers().markers().size());
}
TEST_F(WebFrameTest, SpellcheckResultsSavedInDocument)
@@ -4311,23 +4311,23 @@ TEST_F(WebFrameTest, SpellcheckResultsSavedInDocument)
document->execCommand("InsertText", false, "wellcome ");
spellcheck.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());
+ 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());
document->execCommand("InsertText", false, "wellcome ");
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());
+ 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 ");
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());
+ 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 WebFrameClient {
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698