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

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

Issue 2457523003: Support 'insertReplacementText' for spellcheck (Closed)
Patch Set: yosin@ comment#57 #58 addressed Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6400 matching lines...) Expand 10 before | Expand all | Expand 10 after
6411 webViewHelper.webView()->setSpellCheckClient(0); 6411 webViewHelper.webView()->setSpellCheckClient(0);
6412 6412
6413 WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl(); 6413 WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
6414 Document* document = frame->frame()->document(); 6414 Document* document = frame->frame()->document();
6415 Element* element = document->getElementById("data"); 6415 Element* element = document->getElementById("data");
6416 6416
6417 webViewHelper.webView()->settings()->setEditingBehavior( 6417 webViewHelper.webView()->settings()->setEditingBehavior(
6418 WebSettings::EditingBehaviorWin); 6418 WebSettings::EditingBehaviorWin);
6419 6419
6420 element->focus(); 6420 element->focus();
6421 frame->frame()->editor().replaceSelectionWithText("A", false, false); 6421 frame->frame()->editor().replaceSelectionWithText(
6422 "A", false, false, InputEvent::InputType::InsertReplacementText);
6422 frame->frame()->spellChecker().cancelCheck(); 6423 frame->frame()->spellChecker().cancelCheck();
6423 } 6424 }
6424 6425
6425 TEST_P(ParameterizedWebFrameTest, SpellcheckResultErasesMarkers) { 6426 TEST_P(ParameterizedWebFrameTest, SpellcheckResultErasesMarkers) {
6426 registerMockedHttpURLLoad("spell.html"); 6427 registerMockedHttpURLLoad("spell.html");
6427 FrameTestHelpers::WebViewHelper webViewHelper; 6428 FrameTestHelpers::WebViewHelper webViewHelper;
6428 webViewHelper.initializeAndLoad(m_baseURL + "spell.html"); 6429 webViewHelper.initializeAndLoad(m_baseURL + "spell.html");
6429 6430
6430 StubbornSpellCheckClient spellcheck; 6431 StubbornSpellCheckClient spellcheck;
6431 webViewHelper.webView()->setSpellCheckClient(&spellcheck); 6432 webViewHelper.webView()->setSpellCheckClient(&spellcheck);
(...skipping 4217 matching lines...) Expand 10 before | Expand all | Expand 10 after
10649 Frame* mainFrame = webViewHelper.webView()->mainFrameImpl()->frame(); 10650 Frame* mainFrame = webViewHelper.webView()->mainFrameImpl()->frame();
10650 HashSet<AtomicString> names; 10651 HashSet<AtomicString> names;
10651 for (Frame* frame = mainFrame->tree().firstChild(); frame; 10652 for (Frame* frame = mainFrame->tree().firstChild(); frame;
10652 frame = frame->tree().traverseNext()) { 10653 frame = frame->tree().traverseNext()) {
10653 EXPECT_TRUE(names.add(frame->tree().uniqueName()).isNewEntry); 10654 EXPECT_TRUE(names.add(frame->tree().uniqueName()).isNewEntry);
10654 } 10655 }
10655 EXPECT_EQ(10u, names.size()); 10656 EXPECT_EQ(10u, names.size());
10656 } 10657 }
10657 10658
10658 } // namespace blink 10659 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698