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

Side by Side Diff: LayoutTests/editing/spelling/spellcheck-paste-continuous-disabled.html

Issue 906193003: shouldBecomeEqual() behaves as shouldBe() if the testing expression returns the expected value Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add regression test Created 5 years, 10 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 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <div> 7 <div>
8 <div id="src" contenteditable="true" spellcheck="true"></div> 8 <div id="src" contenteditable="true" spellcheck="true"></div>
9 </div> 9 </div>
10 <script language="javascript"> 10 <script language="javascript">
11 description('Test if WebKit does not spellcheck text when pasting text and conti nuous spellcheck is turned off. ' + 11 description('Test if WebKit does not spellcheck text when pasting text and conti nuous spellcheck is turned off. ' +
12 'To test manually, disable continuous spellcheck, copy the text "zz apple" and paste it to the textarea. ' + 12 'To test manually, disable continuous spellcheck, copy the text "zz apple" and paste it to the textarea. ' +
13 'When "zz" is not marked as misspelled, this test succeeds.'); 13 'When "zz" is not marked as misspelled, this test succeeds.');
14 14
15 jsTestIsAsync = true; 15 jsTestIsAsync = true;
16 16
17 internals.settings.setAsynchronousSpellCheckingEnabled(true); 17 internals.settings.setAsynchronousSpellCheckingEnabled(true);
18 18
19 // Insert a misspelled word to initialize a spellchecker. 19 // Insert a misspelled word to initialize a spellchecker.
20 var srcNode = document.getElementById('src'); 20 var srcNode = document.getElementById('src');
21 srcNode.focus(); 21 srcNode.focus();
22 document.execCommand("InsertText", false, 'z'); 22 document.execCommand("InsertText", false, 'z');
23 document.execCommand("InsertText", false, 'z'); 23 document.execCommand("InsertText", false, 'z');
24 document.execCommand("InsertText", false, ' '); 24 document.execCommand("InsertText", false, ' ');
25 document.execCommand("InsertText", false, 'a'); 25 document.execCommand("InsertText", false, 'a');
26 document.execCommand("InsertText", false, 'p'); 26 document.execCommand("InsertText", false, 'p');
27 document.execCommand("InsertText", false, 'p'); 27 document.execCommand("InsertText", false, 'p');
28 document.execCommand("InsertText", false, 'l'); 28 document.execCommand("InsertText", false, 'l');
29 document.execCommand("InsertText", false, 'e'); 29 document.execCommand("InsertText", false, 'e');
30 shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 2)', 'true', functio n() {}); 30 shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 2)', 'true', functio n() {
31 window.getSelection().selectAllChildren(srcNode); 31 window.getSelection().selectAllChildren(srcNode);
32 document.execCommand('Copy'); 32 document.execCommand('Copy');
33 33
34 internals.setContinuousSpellCheckingEnabled(false); 34 internals.setContinuousSpellCheckingEnabled(false);
35 35
36 document.execCommand('Paste'); 36 document.execCommand('Paste');
37 shouldBecomeDifferent('internals.hasSpellingMarker(document, 0, 2)', 'true', fin ishJSTest); 37 shouldBecomeDifferent('internals.hasSpellingMarker(document, 0, 2)', 'true', finishJSTest);
38 });
38 39
39 </script> 40 </script>
40 </body> 41 </body>
41 </html> 42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698