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

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

Issue 2827913002: Change WebLocalFrame::SpellingMarkerOffsetsForTest to a local function in WebFrameTest (Closed)
Patch Set: 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/WebLocalFrameImpl.cpp ('k') | third_party/WebKit/public/web/WebLocalFrame.h » ('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 797c2df4566c9e04c070ab2bbf65565fa23b8de8..c92648f61e24d1369a7509d4ff6ab54b8b6848b8 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -6558,6 +6558,15 @@ TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkers) {
.size());
}
+static void GetSpellingMarkerOffsets(WebVector<unsigned>* offsets,
+ const Document& document) {
+ Vector<unsigned> result;
+ const DocumentMarkerVector& document_markers = document.Markers().Markers();
+ for (size_t i = 0; i < document_markers.size(); ++i)
+ result.push_back(document_markers[i]->StartOffset());
+ offsets->Assign(result);
+}
+
TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkersUnderWords) {
RegisterMockedHttpURLLoad("spell.html");
FrameTestHelpers::WebViewHelper web_view_helper;
@@ -6585,7 +6594,7 @@ TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkersUnderWords) {
.ForceInvocationForTesting();
WebVector<unsigned> offsets1;
- web_frame->SpellingMarkerOffsetsForTest(&offsets1);
+ GetSpellingMarkerOffsets(&offsets1, *frame->GetDocument());
EXPECT_EQ(1U, offsets1.size());
Vector<String> words;
@@ -6593,7 +6602,7 @@ TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkersUnderWords) {
frame->RemoveSpellingMarkersUnderWords(words);
WebVector<unsigned> offsets2;
- web_frame->SpellingMarkerOffsetsForTest(&offsets2);
+ GetSpellingMarkerOffsets(&offsets2, *frame->GetDocument());
EXPECT_EQ(0U, offsets2.size());
}
@@ -6670,7 +6679,7 @@ TEST_P(ParameterizedWebFrameTest, SlowSpellcheckMarkerPosition) {
textcheck.Kick();
WebVector<unsigned> offsets;
- frame->SpellingMarkerOffsetsForTest(&offsets);
+ GetSpellingMarkerOffsets(&offsets, *frame->GetFrame()->GetDocument());
EXPECT_EQ(0U, offsets.size());
}
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | third_party/WebKit/public/web/WebLocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698