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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/addRange-failures.html

Issue 1516553002: Remove deprecation messages for no-ops that are left in the specs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and update tests Created 5 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 | « no previous file | third_party/WebKit/LayoutTests/editing/selection/addRange-failures-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>addRange failures</title> 4 <title>addRange failures</title>
5 <script src="../../resources/js-test.js"></script> 5 <script src="../../resources/js-test.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <script> 8 <script>
9 description('Test error handling of Selection.addRange().'); 9 description('Test error handling of Selection.addRange().');
10 10
11 var selection = window.getSelection(); 11 var selection = window.getSelection();
12 12
13 function testNull() 13 function testNull()
14 { 14 {
15 shouldThrow('selection.addRange(null)'); 15 shouldThrow('selection.addRange(null)');
16 } 16 }
17 17
18 function testDetachedRange() 18 function testEmptyRange()
19 { 19 {
20 var range = new Range(); 20 var range = new Range();
21 range.detach();
22 selection.addRange(range); 21 selection.addRange(range);
23 } 22 }
24 23
25 function testNotInDocumentRange() 24 function testNotInDocumentRange()
26 { 25 {
27 var range = document.createRange(); 26 var range = document.createRange();
28 var notInDocument = document.createTextNode('not in document'); 27 var notInDocument = document.createTextNode('not in document');
29 range.selectNodeContents(notInDocument); 28 range.selectNodeContents(notInDocument);
30 selection.addRange(range); 29 selection.addRange(range);
31 } 30 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 testFunction(selection); 65 testFunction(selection);
67 66
68 // Selection should stay at the same position. 67 // Selection should stay at the same position.
69 shouldEvaluateTo('selection.rangeCount', 1); 68 shouldEvaluateTo('selection.rangeCount', 1);
70 shouldBeTrue('selection.getRangeAt(0).startContainer === document.body'); 69 shouldBeTrue('selection.getRangeAt(0).startContainer === document.body');
71 shouldEvaluateTo('selection.getRangeAt(0).startOffset', 0); 70 shouldEvaluateTo('selection.getRangeAt(0).startOffset', 0);
72 shouldBeTrue('selection.getRangeAt(0).endContainer === document.body'); 71 shouldBeTrue('selection.getRangeAt(0).endContainer === document.body');
73 shouldEvaluateTo('selection.getRangeAt(0).endOffset', 0); 72 shouldEvaluateTo('selection.getRangeAt(0).endOffset', 0);
74 } 73 }
75 74
76 var testFunctions = [testNull, testDetachedRange, testNotInDocumentRange, testOt herDocument, testOtherDocumentFragments]; 75 var testFunctions = [testNull, testEmptyRange, testNotInDocumentRange, testOther Document, testOtherDocumentFragments];
77 testFunctions.forEach(runSingleTest); 76 testFunctions.forEach(runSingleTest);
78 </script> 77 </script>
79 </body> 78 </body>
80 </html> 79 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/selection/addRange-failures-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698