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

Side by Side Diff: LayoutTests/editing/spelling/resources/util.js

Issue 19275006: Fix a use-after-free in spellcheck client (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 function log(msg) 1 function log(msg)
2 { 2 {
3 document.getElementById("console").innerHTML += (msg + "\n"); 3 document.getElementById("console").innerHTML += (msg + "\n");
4 } 4 }
5 5
6 function verifySpellTest(nretry) 6 function verifySpellTest(nretry)
7 { 7 {
8 var node = destination; 8 var node = window.destination;
9 if (destination.childNodes.length > 0) 9 if (window.destination.childNodes.length > 0)
10 node = destination.childNodes[0]; 10 node = window.destination.childNodes[0];
11 if (nretry && !internals.markerCountForNode(node, "spelling")) { 11 if (nretry && !internals.markerCountForNode(node, "spelling")) {
12 window.setTimeout(function() { verifySpellTest(nretry - 1); }, 0); 12 window.setTimeout(function() { verifySpellTest(nretry - 1); }, 0);
13 return; 13 return;
14 } 14 }
15 testFunctionCallback(node); 15 testFunctionCallback(node);
16 finishJSTest() 16 finishJSTest()
17 } 17 }
18 18
19 function initSpellTest(testElementId, testText, testFunction) 19 function initSpellTest(testElementId, testText, testFunction)
20 { 20 {
21 if (!window.internals || !window.testRunner) { 21 if (!window.internals || !window.testRunner) {
22 log("FAIL Incomplete test environment"); 22 log("FAIL Incomplete test environment");
23 return; 23 return;
24 } 24 }
25 testFunctionCallback = testFunction; 25 testFunctionCallback = testFunction;
26 jsTestIsAsync = true; 26 jsTestIsAsync = true;
27 internals.settings.setAsynchronousSpellCheckingEnabled(true); 27 internals.settings.setAsynchronousSpellCheckingEnabled(true);
28 internals.settings.setSmartInsertDeleteEnabled(true); 28 internals.settings.setSmartInsertDeleteEnabled(true);
29 internals.settings.setSelectTrailingWhitespaceEnabled(false); 29 internals.settings.setSelectTrailingWhitespaceEnabled(false);
30 internals.settings.setUnifiedTextCheckerEnabled(true); 30 internals.settings.setUnifiedTextCheckerEnabled(true);
31 internals.settings.setEditingBehavior("win"); 31 internals.settings.setEditingBehavior("win");
32 var destination = document.getElementById(testElementId); 32 window.destination = document.getElementById(testElementId);
33 destination.focus(); 33 window.destination.focus();
34 document.execCommand("InsertText", false, testText); 34 document.execCommand("InsertText", false, testText);
35 window.setTimeout(function() { verifySpellTest(10); }, 0); 35 window.setTimeout(function() { verifySpellTest(10); }, 0);
36 } 36 }
OLDNEW
« no previous file with comments | « LayoutTests/editing/spelling/copy-paste-crash-expected.txt ('k') | Source/WebKit/chromium/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698