| 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 doit() | 7 function doit() |
| 8 { | 8 { |
| 9 console.dir(window); | 9 console.dir(window); |
| 10 runTest(); | 10 runTest(); |
| 11 } | 11 } |
| 12 | 12 |
| 13 function test() | 13 function test() |
| 14 { | 14 { |
| 15 InspectorTest.RuntimeAgent.evaluate("window", "console", false, evalCallback
); | 15 InspectorTest.RuntimeAgent.evaluate("window", "console", false, evalCallback
); |
| 16 | 16 |
| 17 function evalCallback(error, result) | 17 function evalCallback(error, result) |
| 18 { | 18 { |
| 19 if (error) { | 19 if (error) { |
| 20 testController.notifyDone("Exception:" + error); | 20 testController.notifyDone("Exception:" + error); |
| 21 return; | 21 return; |
| 22 } | 22 } |
| 23 if (result.type === "error") | 23 if (result.type === "error") |
| 24 testController.notifyDone("Exception:" + result); | 24 testController.notifyDone("Exception:" + result); |
| 25 var objectProxy = WebInspector.runtimeModel.createRemoteObject(result); | 25 var objectProxy = InspectorTest.runtimeModel.createRemoteObject(result); |
| 26 objectProxy.getOwnProperties(getPropertiesCallback); | 26 objectProxy.getOwnProperties(getPropertiesCallback); |
| 27 } | 27 } |
| 28 | 28 |
| 29 function getPropertiesCallback(properties) | 29 function getPropertiesCallback(properties) |
| 30 { | 30 { |
| 31 properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties); | 31 properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties); |
| 32 var golden = { "window": 1, "document": 1, "eval": 1, "console": 1, "fra
mes": 1, "Array": 1, "doit": 1 }; | 32 var golden = { "window": 1, "document": 1, "eval": 1, "console": 1, "fra
mes": 1, "Array": 1, "doit": 1 }; |
| 33 var result = {}; | 33 var result = {}; |
| 34 for (var i = 0; i < properties.length; ++i) { | 34 for (var i = 0; i < properties.length; ++i) { |
| 35 var name = properties[i].name; | 35 var name = properties[i].name; |
| 36 if (golden[name]) | 36 if (golden[name]) |
| 37 result[name] = 1; | 37 result[name] = 1; |
| 38 } | 38 } |
| 39 InspectorTest.addObject(result); | 39 InspectorTest.addObject(result); |
| 40 InspectorTest.completeTest(); | 40 InspectorTest.completeTest(); |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 44 </script> | 44 </script> |
| 45 </head> | 45 </head> |
| 46 | 46 |
| 47 <body onload="doit()"> | 47 <body onload="doit()"> |
| 48 <p> | 48 <p> |
| 49 Tests that console dumps global object with properties. | 49 Tests that console dumps global object with properties. |
| 50 </p> | 50 </p> |
| 51 | 51 |
| 52 </body> | 52 </body> |
| 53 </html> | 53 </html> |
| OLD | NEW |