OLD | NEW |
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 shouldBe('window.addEventListener.length', '2'); | 15 // addEventListener.length should be 2, but legacy content calls with 0 or 1 |
| 16 // argument. See http://crbug.com/249598 |
| 17 shouldBe('window.addEventListener.length', '0'); |
16 shouldBe('window.postMessage.length', '2'); | 18 shouldBe('window.postMessage.length', '2'); |
17 shouldBe('window.dispatchEvent.length', '1'); | 19 shouldBe('window.dispatchEvent.length', '1'); |
18 shouldBe('window.openDatabase.length', '4'); | 20 shouldBe('window.openDatabase.length', '4'); |
19 shouldBe('window.history.pushState.length', '2'); | 21 shouldBe('window.history.pushState.length', '2'); |
20 shouldBe('window.history.length', '1'); | 22 shouldBe('window.history.length', '1'); |
21 shouldBe('window.URL.createObjectURL.length', '1'); | 23 shouldBe('window.URL.createObjectURL.length', '1'); |
22 shouldBe('window.Storage.prototype.key.length', '1'); | 24 shouldBe('window.Storage.prototype.key.length', '1'); |
23 | 25 |
24 // One required and one optional argument | 26 // One required and one optional argument |
25 shouldBe('document.importNode.length', '1'); | 27 shouldBe('document.importNode.length', '1'); |
(...skipping 19 matching lines...) Expand all Loading... |
45 shouldBe('Math.min.length', '2'); | 47 shouldBe('Math.min.length', '2'); |
46 shouldBe('Function.prototype.apply.length', '2'); | 48 shouldBe('Function.prototype.apply.length', '2'); |
47 shouldBe('Function.prototype.call.length', '1'); | 49 shouldBe('Function.prototype.call.length', '1'); |
48 shouldBe('String.prototype.split.length', '2'); | 50 shouldBe('String.prototype.split.length', '2'); |
49 shouldBe('String.prototype.substring.length', '2'); | 51 shouldBe('String.prototype.substring.length', '2'); |
50 | 52 |
51 | 53 |
52 </script> | 54 </script> |
53 </body> | 55 </body> |
54 </html> | 56 </html> |
OLD | NEW |