| OLD | NEW |
| 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 6582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6593 class TextCheckClient : public WebTextCheckClient { | 6593 class TextCheckClient : public WebTextCheckClient { |
| 6594 public: | 6594 public: |
| 6595 TextCheckClient() : number_of_times_checked_(0) {} | 6595 TextCheckClient() : number_of_times_checked_(0) {} |
| 6596 virtual ~TextCheckClient() {} | 6596 virtual ~TextCheckClient() {} |
| 6597 void RequestCheckingOfText(const WebString&, | 6597 void RequestCheckingOfText(const WebString&, |
| 6598 WebTextCheckingCompletion* completion) override { | 6598 WebTextCheckingCompletion* completion) override { |
| 6599 ++number_of_times_checked_; | 6599 ++number_of_times_checked_; |
| 6600 Vector<WebTextCheckingResult> results; | 6600 Vector<WebTextCheckingResult> results; |
| 6601 const int kMisspellingStartOffset = 1; | 6601 const int kMisspellingStartOffset = 1; |
| 6602 const int kMisspellingLength = 8; | 6602 const int kMisspellingLength = 8; |
| 6603 results.push_back(WebTextCheckingResult( | 6603 results.push_back(WebTextCheckingResult(kWebTextDecorationTypeSpelling, |
| 6604 kWebTextDecorationTypeSpelling, kMisspellingStartOffset, | 6604 kMisspellingStartOffset, |
| 6605 kMisspellingLength, WebVector<WebString>())); | 6605 kMisspellingLength, WebString())); |
| 6606 completion->DidFinishCheckingText(results); | 6606 completion->DidFinishCheckingText(results); |
| 6607 } | 6607 } |
| 6608 int NumberOfTimesChecked() const { return number_of_times_checked_; } | 6608 int NumberOfTimesChecked() const { return number_of_times_checked_; } |
| 6609 | 6609 |
| 6610 private: | 6610 private: |
| 6611 int number_of_times_checked_; | 6611 int number_of_times_checked_; |
| 6612 }; | 6612 }; |
| 6613 | 6613 |
| 6614 TEST_P(ParameterizedWebFrameTest, ReplaceMisspelledRange) { | 6614 TEST_P(ParameterizedWebFrameTest, ReplaceMisspelledRange) { |
| 6615 RegisterMockedHttpURLLoad("spell.html"); | 6615 RegisterMockedHttpURLLoad("spell.html"); |
| (...skipping 5569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |