OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="../../http/tests/inspector/console-test.js"></script> | 4 <script src="../../http/tests/inspector/console-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 function logToConsole() | 7 function logToConsole() |
8 { | 8 { |
9 var formElement = document.getElementById("f"); | 9 var formElement = document.getElementById("f"); |
10 var selectElement = document.getElementById("sel"); | 10 var selectElement = document.getElementById("sel"); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // Arguments | 46 // Arguments |
47 function generateArguments(foo, bar) | 47 function generateArguments(foo, bar) |
48 { | 48 { |
49 return arguments; | 49 return arguments; |
50 } | 50 } |
51 console.log(generateArguments(1, "2")); | 51 console.log(generateArguments(1, "2")); |
52 | 52 |
53 // DOMTokenList | 53 // DOMTokenList |
54 var div = document.getElementsByTagName("div")[0]; | 54 var div = document.getElementsByTagName("div")[0]; |
55 console.log(div.classList); | 55 console.log(div.classList); |
| 56 |
| 57 // Array-like's. |
| 58 console.log(new ArrayLike(5)); |
| 59 console.log(new ArrayLike(0xFFFFFFFF)); |
| 60 // Array-like's with wrong length. |
| 61 console.log(new ArrayLike(-5)); |
| 62 console.log(new ArrayLike(5.6)); |
| 63 console.log(new ArrayLike(NaN)); |
| 64 console.log(new ArrayLike(Infinity)); |
| 65 console.log(new ArrayLike(-0)); |
| 66 console.log(new ArrayLike(0xFFFFFFFF + 1)); |
56 } | 67 } |
57 | 68 |
58 function onload() | 69 function onload() |
59 { | 70 { |
60 logToConsole(); | 71 logToConsole(); |
61 runTest(); | 72 runTest(); |
62 } | 73 } |
63 | 74 |
64 function NonArrayWithLength() | 75 function NonArrayWithLength() |
65 { | 76 { |
66 this.keys = []; | 77 this.keys = []; |
67 } | 78 } |
68 | 79 |
69 NonArrayWithLength.prototype.__defineGetter__("length", function() | 80 NonArrayWithLength.prototype.__defineGetter__("length", function() |
70 { | 81 { |
71 console.log("FAIL: 'length' should not be called"); | 82 console.log("FAIL: 'length' should not be called"); |
72 return this.keys.length; | 83 return this.keys.length; |
73 }); | 84 }); |
74 | 85 |
| 86 function ArrayLike(length) |
| 87 { |
| 88 this.length = length; |
| 89 } |
| 90 ArrayLike.prototype.splice = function() {}; |
| 91 |
75 function test() | 92 function test() |
76 { | 93 { |
77 InspectorTest.evaluateInPage("logToConsole()", callback); | 94 InspectorTest.evaluateInPage("logToConsole()", callback); |
78 | 95 |
79 function callback() | 96 function callback() |
80 { | 97 { |
81 InspectorTest.dumpConsoleMessages(); | 98 InspectorTest.dumpConsoleMessages(); |
82 InspectorTest.completeTest(); | 99 InspectorTest.completeTest(); |
83 } | 100 } |
84 } | 101 } |
(...skipping 10 matching lines...) Expand all Loading... |
95 <option value="1">one</option> | 112 <option value="1">one</option> |
96 <option value="2">two</option> | 113 <option value="2">two</option> |
97 </select> | 114 </select> |
98 <input type="radio" name="x" value="x1" /> x1 | 115 <input type="radio" name="x" value="x1" /> x1 |
99 <input type="radio" name="x" value="x2" /> x2 | 116 <input type="radio" name="x" value="x2" /> x2 |
100 </form> | 117 </form> |
101 </div> | 118 </div> |
102 | 119 |
103 </body> | 120 </body> |
104 </html> | 121 </html> |
OLD | NEW |