| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 <html> | 
|  | 2 <head> | 
|  | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 
|  | 4 <script src="../../http/tests/inspector/console-test.js"></script> | 
|  | 5 <script> | 
|  | 6 | 
|  | 7 function onload() | 
|  | 8 { | 
|  | 9     for (var i = 3; i < 8; ++i) | 
|  | 10         window["temp" + i] = "Reserved"; | 
|  | 11 | 
|  | 12     runTest(); | 
|  | 13 } | 
|  | 14 | 
|  | 15 function test() | 
|  | 16 { | 
|  | 17     WebInspector.inspectorView.showPanel("sources"); | 
|  | 18 | 
|  | 19     var expressions = [ | 
|  | 20         "42", | 
|  | 21         "'foo string'", | 
|  | 22         "NaN", | 
|  | 23         "Infinity", | 
|  | 24         "-Infinity", | 
|  | 25         "-0", | 
|  | 26         "[1, 2, NaN, -0, null, undefined]", | 
|  | 27         "({ foo: 'bar' })", | 
|  | 28         "(function(){ return arguments; })(1,2,3,4)", | 
|  | 29         "(function func() {})", | 
|  | 30         "new Error('errr')" | 
|  | 31     ]; | 
|  | 32 | 
|  | 33     InspectorTest.addResult("Number of expressions: " + expressions.length); | 
|  | 34     InspectorTest.addResult("Names [temp3..temp7] are reserved\n"); | 
|  | 35 | 
|  | 36     function evaluateNext() | 
|  | 37     { | 
|  | 38         var expression = expressions.shift(); | 
|  | 39         if (!expression) { | 
|  | 40             dumpConsoleMessages(); | 
|  | 41             return; | 
|  | 42         } | 
|  | 43 | 
|  | 44         function didEvaluate(result, wasThrown) | 
|  | 45         { | 
|  | 46             InspectorTest.assertTrue(!wasThrown, "FAIL: was thrown. Expression: 
    " + expression); | 
|  | 47             WebInspector.panels.sources._saveToTempVariable(result); | 
|  | 48             InspectorTest.waitUntilNthMessageReceived(2, evaluateNext); | 
|  | 49         } | 
|  | 50 | 
|  | 51         WebInspector.runtimeModel.evaluate(expression, "console", true, undefine
    d, undefined, undefined, didEvaluate); | 
|  | 52     } | 
|  | 53 | 
|  | 54     function dumpConsoleMessages() | 
|  | 55     { | 
|  | 56         InspectorTest.dumpConsoleMessages(); | 
|  | 57         InspectorTest.completeTest(); | 
|  | 58     } | 
|  | 59 | 
|  | 60     evaluateNext(); | 
|  | 61 } | 
|  | 62 | 
|  | 63 </script> | 
|  | 64 </head> | 
|  | 65 | 
|  | 66 <body onload="onload()"> | 
|  | 67 <p> | 
|  | 68 Tests saving objects to temporary variables. | 
|  | 69 </p> | 
|  | 70 | 
|  | 71 </body> | 
|  | 72 </html> | 
| OLD | NEW | 
|---|