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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/text/selection-exceptions.html

Issue 2707233002: Range and Selection: Do not accept offsets larger than 2^31-1. (Closed)
Patch Set: . Created 3 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/text/selection-exceptions-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 </head> 4 </head>
5 <body> 5 <body>
6 <script src="../../resources/js-test.js"></script> 6 <script src="../../resources/js-test.js"></script>
7 <script> 7 <script>
8 description("This tests that 'Selection' methods throw exceptions with r easonable messages."); 8 description("This tests that 'Selection' methods throw exceptions with r easonable messages.");
9 9
10 shouldThrow('getSelection().collapse(document.documentElement, -1)', '"I ndexSizeError: Failed to execute \'collapse\' on \'Selection\': There is no chil d at offset 4294967295."'); 10 shouldThrow('getSelection().collapse(document.documentElement, -1)', '"I ndexSizeError: Failed to execute \'collapse\' on \'Selection\': The offset 42949 67295 is invalid."');
11 11
12 getSelection().empty(); 12 getSelection().empty();
13 shouldThrow('getSelection().collapseToStart()', '"InvalidStateError: Fai led to execute \'collapseToStart\' on \'Selection\': there is no selection."'); 13 shouldThrow('getSelection().collapseToStart()', '"InvalidStateError: Fai led to execute \'collapseToStart\' on \'Selection\': there is no selection."');
14 shouldThrow('getSelection().collapseToEnd()', '"InvalidStateError: Faile d to execute \'collapseToEnd\' on \'Selection\': there is no selection."'); 14 shouldThrow('getSelection().collapseToEnd()', '"InvalidStateError: Faile d to execute \'collapseToEnd\' on \'Selection\': there is no selection."');
15 15
16 shouldThrow('getSelection().setBaseAndExtent(document.documentElement, - 1, document.documentElement, 0)', '"IndexSizeError: Failed to execute \'setBaseA ndExtent\' on \'Selection\': There is no child at offset 4294967295."'); 16 shouldThrow('getSelection().setBaseAndExtent(document.documentElement, - 1, document.documentElement, 0)', '"IndexSizeError: Failed to execute \'setBaseA ndExtent\' on \'Selection\': The offset 4294967295 is invalid."');
17 shouldThrow('getSelection().setBaseAndExtent(document.documentElement, 0 , document.documentElement, -1)', '"IndexSizeError: Failed to execute \'setBaseA ndExtent\' on \'Selection\': There is no child at offset 4294967295."'); 17 shouldThrow('getSelection().setBaseAndExtent(document.documentElement, 0 , document.documentElement, -1)', '"IndexSizeError: Failed to execute \'setBaseA ndExtent\' on \'Selection\': The offset 4294967295 is invalid."');
18 18
19 shouldThrow('getSelection().collapse(document.documentElement, -1)', '"I ndexSizeError: Failed to execute \'collapse\' on \'Selection\': There is no chil d at offset 4294967295."'); 19 shouldThrow('getSelection().collapse(document.documentElement, -1)', '"I ndexSizeError: Failed to execute \'collapse\' on \'Selection\': The offset 42949 67295 is invalid."');
20 20
21 shouldThrow('getSelection().getRangeAt(-1)', '"IndexSizeError: Failed to execute \'getRangeAt\' on \'Selection\': 4294967295 is not a valid index."'); 21 shouldThrow('getSelection().getRangeAt(-1)', '"IndexSizeError: Failed to execute \'getRangeAt\' on \'Selection\': 4294967295 is not a valid index."');
22 22
23 shouldThrow('getSelection().extend(0, -1)', '"TypeError: Failed to execu te \'extend\' on \'Selection\': parameter 1 is not of type \'Node\'."'); 23 shouldThrow('getSelection().extend(0, -1)', '"TypeError: Failed to execu te \'extend\' on \'Selection\': parameter 1 is not of type \'Node\'."');
24 getSelection().addRange(document.createRange()); 24 getSelection().addRange(document.createRange());
25 shouldThrow('getSelection().extend(document.documentElement, -1)', '"Ind exSizeError: Failed to execute \'extend\' on \'Selection\': There is no child at offset 4294967295."'); 25 shouldThrow('getSelection().extend(document.documentElement, -1)', '"Ind exSizeError: Failed to execute \'extend\' on \'Selection\': The offset 429496729 5 is invalid."');
26 shouldThrow('getSelection().extend(document.documentElement, 1000)', '"I ndexSizeError: Failed to execute \'extend\' on \'Selection\': There is no child at offset 1000."'); 26 shouldThrow('getSelection().extend(document.documentElement, 1000)', '"I ndexSizeError: Failed to execute \'extend\' on \'Selection\': There is no child at offset 1000."');
27 </script> 27 </script>
28 </body> 28 </body>
29 </html> 29 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/text/selection-exceptions-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698