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

Side by Side Diff: LayoutTests/fast/text/selection-exceptions.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 <!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\': -1 is not a vali d offset."'); 10 shouldThrow('getSelection().collapse(document.documentElement, -1)', '"I ndexSizeError: Failed to execute \'collapse\' on \'Selection\': 4294967295 is la rger than the given node\'s length."');
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\': -1 is not a valid base offset."'); 16 shouldThrow('getSelection().setBaseAndExtent(document.documentElement, - 1, document.documentElement, 0)', '"IndexSizeError: Failed to execute \'setBaseA ndExtent\' on \'Selection\': 4294967295 is larger than the base node\'s length." ');
17 shouldThrow('getSelection().setBaseAndExtent(document.documentElement, 0 , document.documentElement, -1)', '"IndexSizeError: Failed to execute \'setBaseA ndExtent\' on \'Selection\': -1 is not a valid extent offset."'); 17 shouldThrow('getSelection().setBaseAndExtent(document.documentElement, 0 , document.documentElement, -1)', '"IndexSizeError: Failed to execute \'setBaseA ndExtent\' on \'Selection\': 4294967295 is larger than the extent node\'s length ."');
18 18
19 shouldThrow('getSelection().collapse(document.documentElement, -1)', '"I ndexSizeError: Failed to execute \'collapse\' on \'Selection\': -1 is not a vali d offset."'); 19 shouldThrow('getSelection().collapse(document.documentElement, -1)', '"I ndexSizeError: Failed to execute \'collapse\' on \'Selection\': 4294967295 is la rger than the given node\'s length."');
20 20
21 shouldThrow('getSelection().getRangeAt(-1)', '"IndexSizeError: Failed to execute \'getRangeAt\' on \'Selection\': -1 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 shouldThrow('getSelection().extend(document.documentElement, -1)', '"Ind exSizeError: Failed to execute \'extend\' on \'Selection\': -1 is not a valid of fset."'); 24 shouldThrow('getSelection().extend(document.documentElement, -1)', '"Ind exSizeError: Failed to execute \'extend\' on \'Selection\': 4294967295 is larger than the given node\'s length."');
25 shouldThrow('getSelection().extend(document.documentElement, 1000)', '"I ndexSizeError: Failed to execute \'extend\' on \'Selection\': 1000 is larger tha n the given node\'s length."'); 25 shouldThrow('getSelection().extend(document.documentElement, 1000)', '"I ndexSizeError: Failed to execute \'extend\' on \'Selection\': 1000 is larger tha n the given node\'s length."');
26 </script> 26 </script>
27 </body> 27 </body>
28 </html> 28 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698