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

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

Issue 2891763003: [WIP, DONOTCOMMIT] Test case for multi-result spellcheck (Closed)
Patch Set: Proposed fix Created 3 years, 7 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 6575 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 5538 matching lines...) Expand 10 before | Expand all | Expand 10 after
12147 12147
12148 // Failing the original child frame navigation and trying to render fallback 12148 // Failing the original child frame navigation and trying to render fallback
12149 // content shouldn't crash. It should return NoLoadInProgress. This is so the 12149 // content shouldn't crash. It should return NoLoadInProgress. This is so the
12150 // caller won't attempt to replace the correctly empty frame with an error 12150 // caller won't attempt to replace the correctly empty frame with an error
12151 // page. 12151 // page.
12152 EXPECT_EQ(WebLocalFrame::NoLoadInProgress, 12152 EXPECT_EQ(WebLocalFrame::NoLoadInProgress,
12153 child->MaybeRenderFallbackContent(WebURLError())); 12153 child->MaybeRenderFallbackContent(WebURLError()));
12154 } 12154 }
12155 12155
12156 } // namespace blink 12156 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebTextCheckingResult.cpp ('k') | third_party/WebKit/public/web/WebTextCheckingResult.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698