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> | 4 <script> |
5 | 5 |
6 var object1 = { foo: 1 }; | 6 var object1 = { foo: 1 }; |
7 var object2 = { bar: 2 }; | 7 var object2 = { bar: 2 }; |
8 | 8 |
9 function dumpObject(label) | 9 function dumpObject(label) |
10 { | 10 { |
11 console.log("===== " + label + " ====="); | 11 console.log("===== " + label + " ====="); |
12 console.log(JSON.stringify(object1, replacer)); | 12 console.log(JSON.stringify(object1, replacer)); |
13 console.log(""); | 13 console.log(""); |
14 | 14 |
15 function replacer(key, value) | 15 function replacer(key, value) |
16 { | 16 { |
17 if (typeof value === "number" && !isFinite(value)) | 17 if (typeof value === "number" && !isFinite(value)) |
18 return String(value); | 18 return String(value); |
19 return value; | 19 return value; |
20 } | 20 } |
21 } | 21 } |
22 | 22 |
| 23 function checkNegativeZero() |
| 24 { |
| 25 console.log("===== Checking negative zero ====="); |
| 26 console.log("1/-0 = " + (1 / object1.foo)); |
| 27 } |
| 28 |
23 function test() | 29 function test() |
24 { | 30 { |
25 var obj1, obj2; | 31 var obj1, obj2; |
26 | 32 |
27 InspectorTest.runTestSuite([ | 33 InspectorTest.runTestSuite([ |
28 function testSetUp(next) | 34 function testSetUp(next) |
29 { | 35 { |
30 InspectorTest.evaluateInPage("dumpObject('Initial')", step0); | 36 InspectorTest.evaluateInPage("dumpObject('Initial')", step0); |
31 | 37 |
32 function step0() | 38 function step0() |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 { | 137 { |
132 obj1.setPropertyValue("foo2", "-Infinity", step3); | 138 obj1.setPropertyValue("foo2", "-Infinity", step3); |
133 } | 139 } |
134 | 140 |
135 function step3(error) | 141 function step3(error) |
136 { | 142 { |
137 InspectorTest.evaluateInPage("dumpObject('Set non-finite numbers
')", next); | 143 InspectorTest.evaluateInPage("dumpObject('Set non-finite numbers
')", next); |
138 } | 144 } |
139 }, | 145 }, |
140 | 146 |
| 147 function testNegativeZero(next) |
| 148 { |
| 149 obj1.setPropertyValue("foo", "1/-Infinity", step1); |
| 150 |
| 151 function step1(error) |
| 152 { |
| 153 InspectorTest.evaluateInPage("checkNegativeZero()", next); |
| 154 } |
| 155 }, |
| 156 |
141 function testReleaseObjectIsCalled(next) | 157 function testReleaseObjectIsCalled(next) |
142 { | 158 { |
143 // If failed, this test will time out. | 159 // If failed, this test will time out. |
144 InspectorTest.addSniffer(RuntimeAgent, "releaseObject", next); | 160 InspectorTest.addSniffer(RuntimeAgent, "releaseObject", next); |
145 obj1.setPropertyValue("foo", "[1,2,3]", function(){}); | 161 obj1.setPropertyValue("foo", "[1,2,3]", function(){}); |
146 } | 162 } |
147 ]); | 163 ]); |
148 } | 164 } |
149 | 165 |
150 </script> | 166 </script> |
151 </head> | 167 </head> |
152 | 168 |
153 <body onload="runTest()"> | 169 <body onload="runTest()"> |
154 <p> | 170 <p> |
155 Tests WebInspector.RemoveObject.setPropertyValue implementation. | 171 Tests WebInspector.RemoveObject.setPropertyValue implementation. |
156 </p> | 172 </p> |
157 | 173 |
158 </body> | 174 </body> |
159 </html> | 175 </html> |
OLD | NEW |