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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2911253003: [Reland] Allow storing multiple replacements on SpellCheckResult (Closed)
Patch Set: Rebase Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 6587 matching lines...) Expand 10 before | Expand all | Expand 10 after
6598 class TextCheckClient : public WebTextCheckClient { 6598 class TextCheckClient : public WebTextCheckClient {
6599 public: 6599 public:
6600 TextCheckClient() : number_of_times_checked_(0) {} 6600 TextCheckClient() : number_of_times_checked_(0) {}
6601 virtual ~TextCheckClient() {} 6601 virtual ~TextCheckClient() {}
6602 void RequestCheckingOfText(const WebString&, 6602 void RequestCheckingOfText(const WebString&,
6603 WebTextCheckingCompletion* completion) override { 6603 WebTextCheckingCompletion* completion) override {
6604 ++number_of_times_checked_; 6604 ++number_of_times_checked_;
6605 Vector<WebTextCheckingResult> results; 6605 Vector<WebTextCheckingResult> results;
6606 const int kMisspellingStartOffset = 1; 6606 const int kMisspellingStartOffset = 1;
6607 const int kMisspellingLength = 8; 6607 const int kMisspellingLength = 8;
6608 results.push_back(WebTextCheckingResult(kWebTextDecorationTypeSpelling, 6608 results.push_back(WebTextCheckingResult(
6609 kMisspellingStartOffset, 6609 kWebTextDecorationTypeSpelling, kMisspellingStartOffset,
6610 kMisspellingLength, WebString())); 6610 kMisspellingLength, WebVector<WebString>()));
6611 completion->DidFinishCheckingText(results); 6611 completion->DidFinishCheckingText(results);
6612 } 6612 }
6613 int NumberOfTimesChecked() const { return number_of_times_checked_; } 6613 int NumberOfTimesChecked() const { return number_of_times_checked_; }
6614 6614
6615 private: 6615 private:
6616 int number_of_times_checked_; 6616 int number_of_times_checked_;
6617 }; 6617 };
6618 6618
6619 TEST_P(ParameterizedWebFrameTest, ReplaceMisspelledRange) { 6619 TEST_P(ParameterizedWebFrameTest, ReplaceMisspelledRange) {
6620 RegisterMockedHttpURLLoad("spell.html"); 6620 RegisterMockedHttpURLLoad("spell.html");
(...skipping 5564 matching lines...) Expand 10 before | Expand all | Expand 10 after
12185 if (obj->IsText()) { 12185 if (obj->IsText()) {
12186 LayoutText* layout_text = ToLayoutText(obj); 12186 LayoutText* layout_text = ToLayoutText(obj);
12187 text = layout_text->GetText(); 12187 text = layout_text->GetText();
12188 break; 12188 break;
12189 } 12189 }
12190 } 12190 }
12191 EXPECT_EQ("foo alt", text.Utf8()); 12191 EXPECT_EQ("foo alt", text.Utf8());
12192 } 12192 }
12193 12193
12194 } // namespace blink 12194 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/text/TextChecking.h ('k') | third_party/WebKit/public/web/WebTextCheckingResult.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698