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

Side by Side Diff: LayoutTests/editing/selection/selection-invalid-offset.html

Issue 1195833002: Selection attributes changes from long to unsigned long (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixes offset error message Created 5 years, 6 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 <body> 1 <body>
2 You should see 7 OKs below (and not hang): <br> 2 You should see 9 OKs below (and not hang): <br>
3 <script> 3 <script>
4 if (window.testRunner) 4 if (window.testRunner)
5 testRunner.dumpAsText(); 5 testRunner.dumpAsText();
6 var body = document.body; 6 var body = document.body;
7 var selection = window.getSelection(); 7 var selection = window.getSelection();
8 8
9 function shouldThrowIndexSizeErrorException(script) 9 function shouldThrowIndexSizeErrorException(script)
10 { 10 {
11 try { 11 try {
12 eval(script); 12 eval(script);
13 } catch (e) { 13 } catch (e) {
14 document.write(((e.code == DOMException.INDEX_SIZE_ERR) ? "OK" : "FAIL") + "<br>"); 14 document.write(((e.code == DOMException.INDEX_SIZE_ERR) ? "OK" : "FAIL") + "<br>");
15 } 15 }
16 } 16 }
17 17
18 shouldThrowIndexSizeErrorException("selection.collapse(body, -1);"); 18 shouldThrowIndexSizeErrorException("selection.collapse(body, -1);");
19 shouldThrowIndexSizeErrorException("selection.setBaseAndExtent(body, -1, body, 0 );"); 19 shouldThrowIndexSizeErrorException("selection.setBaseAndExtent(body, -1, body, 0 );");
20 shouldThrowIndexSizeErrorException("selection.setBaseAndExtent(body, 0, body, -1 );"); 20 shouldThrowIndexSizeErrorException("selection.setBaseAndExtent(body, 0, body, -1 );");
21 shouldThrowIndexSizeErrorException("selection.collapse(body, -1);"); 21 shouldThrowIndexSizeErrorException("selection.collapse(body, -1);");
22 shouldThrowIndexSizeErrorException("selection.getRangeAt(-1);"); 22 shouldThrowIndexSizeErrorException("selection.getRangeAt(-1);");
23 shouldThrowIndexSizeErrorException("selection.getRangeAt(10000);"); 23 shouldThrowIndexSizeErrorException("selection.getRangeAt(10000);");
24 shouldThrowIndexSizeErrorException("selection.collapse(body, 10000);"); 24 shouldThrowIndexSizeErrorException("selection.collapse(body, 10000);");
25 25 shouldThrowIndexSizeErrorException("selection.setBaseAndExtent(body, 1000, body, 0)");
26 // these should throw as well but don't at the moment. Just checking they don't crash. 26 shouldThrowIndexSizeErrorException("selection.setBaseAndExtent(body, 0, body, 10 000)");
27 selection.setBaseAndExtent(body, 1000, body, 0);
28 selection.setBaseAndExtent(body, 0, body, 10000);
29 </script> 27 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698