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

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

Issue 2816263003: Move spelling marker related functions from WebView to WebLocalFrame (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 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 6566 matching lines...) Expand 10 before | Expand all | Expand 10 after
6577 NonThrowableExceptionState exception_state; 6577 NonThrowableExceptionState exception_state;
6578 document->execCommand("InsertText", false, " wellcome ", exception_state); 6578 document->execCommand("InsertText", false, " wellcome ", exception_state);
6579 EXPECT_FALSE(exception_state.HadException()); 6579 EXPECT_FALSE(exception_state.HadException());
6580 6580
6581 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) 6581 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
6582 frame->GetSpellChecker() 6582 frame->GetSpellChecker()
6583 .GetIdleSpellCheckCallback() 6583 .GetIdleSpellCheckCallback()
6584 .ForceInvocationForTesting(); 6584 .ForceInvocationForTesting();
6585 6585
6586 WebVector<unsigned> offsets1; 6586 WebVector<unsigned> offsets1;
6587 web_view_helper.WebView()->SpellingMarkerOffsetsForTest(&offsets1); 6587 web_frame->SpellingMarkerOffsetsForTest(&offsets1);
6588 EXPECT_EQ(1U, offsets1.size()); 6588 EXPECT_EQ(1U, offsets1.size());
6589 6589
6590 Vector<String> words; 6590 Vector<String> words;
6591 words.push_back("wellcome"); 6591 words.push_back("wellcome");
6592 frame->RemoveSpellingMarkersUnderWords(words); 6592 frame->RemoveSpellingMarkersUnderWords(words);
6593 6593
6594 WebVector<unsigned> offsets2; 6594 WebVector<unsigned> offsets2;
6595 web_view_helper.WebView()->SpellingMarkerOffsetsForTest(&offsets2); 6595 web_frame->SpellingMarkerOffsetsForTest(&offsets2);
6596 EXPECT_EQ(0U, offsets2.size()); 6596 EXPECT_EQ(0U, offsets2.size());
6597 } 6597 }
6598 6598
6599 class StubbornTextCheckClient : public WebTextCheckClient { 6599 class StubbornTextCheckClient : public WebTextCheckClient {
6600 public: 6600 public:
6601 StubbornTextCheckClient() : completion_(0) {} 6601 StubbornTextCheckClient() : completion_(0) {}
6602 virtual ~StubbornTextCheckClient() {} 6602 virtual ~StubbornTextCheckClient() {}
6603 6603
6604 virtual void RequestCheckingOfText( 6604 virtual void RequestCheckingOfText(
6605 const WebString&, 6605 const WebString&,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
6662 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) { 6662 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) {
6663 document->GetFrame() 6663 document->GetFrame()
6664 ->GetSpellChecker() 6664 ->GetSpellChecker()
6665 .GetIdleSpellCheckCallback() 6665 .GetIdleSpellCheckCallback()
6666 .ForceInvocationForTesting(); 6666 .ForceInvocationForTesting();
6667 } 6667 }
6668 6668
6669 textcheck.Kick(); 6669 textcheck.Kick();
6670 6670
6671 WebVector<unsigned> offsets; 6671 WebVector<unsigned> offsets;
6672 web_view_helper.WebView()->SpellingMarkerOffsetsForTest(&offsets); 6672 frame->SpellingMarkerOffsetsForTest(&offsets);
6673 EXPECT_EQ(0U, offsets.size()); 6673 EXPECT_EQ(0U, offsets.size());
6674 } 6674 }
6675 6675
6676 // This test verifies that cancelling spelling request does not cause a 6676 // This test verifies that cancelling spelling request does not cause a
6677 // write-after-free when there's no spellcheck client set. 6677 // write-after-free when there's no spellcheck client set.
6678 TEST_P(ParameterizedWebFrameTest, CancelSpellingRequestCrash) { 6678 TEST_P(ParameterizedWebFrameTest, CancelSpellingRequestCrash) {
6679 // The relevant code paths are obsolete with idle time spell checker. 6679 // The relevant code paths are obsolete with idle time spell checker.
6680 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) 6680 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
6681 return; 6681 return;
6682 6682
(...skipping 5316 matching lines...) Expand 10 before | Expand all | Expand 10 after
11999 11999
12000 // Failing the original child frame navigation and trying to render fallback 12000 // Failing the original child frame navigation and trying to render fallback
12001 // content shouldn't crash. It should return NoLoadInProgress. This is so the 12001 // content shouldn't crash. It should return NoLoadInProgress. This is so the
12002 // caller won't attempt to replace the correctly empty frame with an error 12002 // caller won't attempt to replace the correctly empty frame with an error
12003 // page. 12003 // page.
12004 EXPECT_EQ(WebLocalFrame::NoLoadInProgress, 12004 EXPECT_EQ(WebLocalFrame::NoLoadInProgress,
12005 child->MaybeRenderFallbackContent(WebURLError())); 12005 child->MaybeRenderFallbackContent(WebURLError()));
12006 } 12006 }
12007 12007
12008 } // namespace blink 12008 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/public/web/WebLocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698