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

Side by Side Diff: LayoutTests/fast/js/function-length.html

Issue 296403007: Set correct Function.length on overloaded methods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed nits Created 6 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
« no previous file with comments | « no previous file | LayoutTests/fast/js/function-length-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 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 description("This tests the length property of functions."); 8 description("This tests the length property of functions.");
9 9
10 shouldBe('window.confirm.length', '0'); 10 shouldBe('window.confirm.length', '0');
11 shouldBe('window.open.length', '2'); 11 shouldBe('window.open.length', '2');
12 shouldBe('window.showModalDialog.length', '1'); 12 shouldBe('window.showModalDialog.length', '1');
13 shouldBe('window.setTimeout.length', '1'); 13 shouldBe('window.setTimeout.length', '1');
14 shouldBe('window.clearTimeout.length', '0'); 14 shouldBe('window.clearTimeout.length', '0');
15 // addEventListener.length should be 2, but legacy content calls with 0 or 1 15 // addEventListener.length should be 2, but legacy content calls with 0 or 1
16 // argument. See http://crbug.com/249598 16 // argument. See http://crbug.com/249598
17 shouldBe('window.addEventListener.length', '0'); 17 shouldBe('window.addEventListener.length', '0');
18 shouldBe('window.postMessage.length', '2'); 18 shouldBe('window.postMessage.length', '2');
19 shouldBe('window.dispatchEvent.length', '1'); 19 shouldBe('window.dispatchEvent.length', '1');
20 shouldBe('window.openDatabase.length', '4'); 20 shouldBe('window.openDatabase.length', '4');
21 shouldBe('window.history.pushState.length', '2'); 21 shouldBe('window.history.pushState.length', '2');
22 shouldBe('window.history.length', '1'); 22 shouldBe('window.history.length', '1');
23 shouldBe('window.URL.createObjectURL.length', '1'); 23 shouldBe('window.URL.createObjectURL.length', '1');
24 shouldBe('window.Storage.prototype.key.length', '1'); 24 shouldBe('window.Storage.prototype.key.length', '1');
25 25
26 // One required and one optional argument
27 shouldBe('document.importNode.length', '1');
28 // One variadic argument
29 shouldBe('document.write.length', '0');
30 // Overloaded method with varying number of arguments
31 shouldBe('CanvasRenderingContext2D.prototype.drawImage.length', '3');
32
26 shouldBe('Array.prototype.concat.length', '1'); 33 shouldBe('Array.prototype.concat.length', '1');
27 shouldBe('Array.prototype.join.length', '1'); 34 shouldBe('Array.prototype.join.length', '1');
28 shouldBe('Array.prototype.push.length', '1'); 35 shouldBe('Array.prototype.push.length', '1');
29 shouldBe('Array.prototype.slice.length', '2'); 36 shouldBe('Array.prototype.slice.length', '2');
30 shouldBe('Date.UTC.length', '7'); 37 shouldBe('Date.UTC.length', '7');
31 shouldBe('Date.prototype.setSeconds.length', '2'); 38 shouldBe('Date.prototype.setSeconds.length', '2');
32 shouldBe('Date.prototype.setMinutes.length', '3'); 39 shouldBe('Date.prototype.setMinutes.length', '3');
33 shouldBe('Date.prototype.setHours.length', '4'); 40 shouldBe('Date.prototype.setHours.length', '4');
34 shouldBe('Date.prototype.setMonth.length', '2'); 41 shouldBe('Date.prototype.setMonth.length', '2');
35 shouldBe('Date.prototype.setFullYear.length', '3'); 42 shouldBe('Date.prototype.setFullYear.length', '3');
36 shouldBe('Number.prototype.toExponential.length', '1'); 43 shouldBe('Number.prototype.toExponential.length', '1');
37 shouldBe('Number.prototype.toFixed.length', '1'); 44 shouldBe('Number.prototype.toFixed.length', '1');
38 shouldBe('Number.prototype.toPrecision.length', '1'); 45 shouldBe('Number.prototype.toPrecision.length', '1');
39 shouldBe('Math.max.length', '2'); 46 shouldBe('Math.max.length', '2');
40 shouldBe('Math.min.length', '2'); 47 shouldBe('Math.min.length', '2');
41 shouldBe('Function.prototype.apply.length', '2'); 48 shouldBe('Function.prototype.apply.length', '2');
42 shouldBe('Function.prototype.call.length', '1'); 49 shouldBe('Function.prototype.call.length', '1');
43 shouldBe('String.prototype.split.length', '2'); 50 shouldBe('String.prototype.split.length', '2');
44 shouldBe('String.prototype.substring.length', '2'); 51 shouldBe('String.prototype.substring.length', '2');
45 52
46 53
47 </script> 54 </script>
48 </body> 55 </body>
49 </html> 56 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/js/function-length-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698