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 6575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6586 class TextCheckClient : public WebTextCheckClient { | 6586 class TextCheckClient : public WebTextCheckClient { |
6587 public: | 6587 public: |
6588 TextCheckClient() : number_of_times_checked_(0) {} | 6588 TextCheckClient() : number_of_times_checked_(0) {} |
6589 virtual ~TextCheckClient() {} | 6589 virtual ~TextCheckClient() {} |
6590 void RequestCheckingOfText(const WebString&, | 6590 void RequestCheckingOfText(const WebString&, |
6591 WebTextCheckingCompletion* completion) override { | 6591 WebTextCheckingCompletion* completion) override { |
6592 ++number_of_times_checked_; | 6592 ++number_of_times_checked_; |
6593 Vector<WebTextCheckingResult> results; | 6593 Vector<WebTextCheckingResult> results; |
6594 const int kMisspellingStartOffset = 1; | 6594 const int kMisspellingStartOffset = 1; |
6595 const int kMisspellingLength = 8; | 6595 const int kMisspellingLength = 8; |
6596 results.push_back(WebTextCheckingResult(kWebTextDecorationTypeSpelling, | 6596 results.push_back(WebTextCheckingResult( |
6597 kMisspellingStartOffset, | 6597 kWebTextDecorationTypeSpelling, kMisspellingStartOffset, |
6598 kMisspellingLength, WebString())); | 6598 kMisspellingLength, WebVector<WebString>())); |
6599 completion->DidFinishCheckingText(results); | 6599 completion->DidFinishCheckingText(results); |
6600 } | 6600 } |
6601 int NumberOfTimesChecked() const { return number_of_times_checked_; } | 6601 int NumberOfTimesChecked() const { return number_of_times_checked_; } |
6602 | 6602 |
6603 private: | 6603 private: |
6604 int number_of_times_checked_; | 6604 int number_of_times_checked_; |
6605 }; | 6605 }; |
6606 | 6606 |
6607 TEST_P(ParameterizedWebFrameTest, ReplaceMisspelledRange) { | 6607 TEST_P(ParameterizedWebFrameTest, ReplaceMisspelledRange) { |
6608 RegisterMockedHttpURLLoad("spell.html"); | 6608 RegisterMockedHttpURLLoad("spell.html"); |
(...skipping 5568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12177 if (obj->IsText()) { | 12177 if (obj->IsText()) { |
12178 LayoutText* layout_text = ToLayoutText(obj); | 12178 LayoutText* layout_text = ToLayoutText(obj); |
12179 text = layout_text->GetText(); | 12179 text = layout_text->GetText(); |
12180 break; | 12180 break; |
12181 } | 12181 } |
12182 } | 12182 } |
12183 EXPECT_EQ("foo alt", text.Utf8()); | 12183 EXPECT_EQ("foo alt", text.Utf8()); |
12184 } | 12184 } |
12185 | 12185 |
12186 } // namespace blink | 12186 } // namespace blink |
OLD | NEW |