| Index: LayoutTests/inspector/console/console-save-to-temp-var.html | 
| diff --git a/LayoutTests/inspector/console/console-save-to-temp-var.html b/LayoutTests/inspector/console/console-save-to-temp-var.html | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..95f3c597b0c8e9d5c0cd92b63d0508376f27a742 | 
| --- /dev/null | 
| +++ b/LayoutTests/inspector/console/console-save-to-temp-var.html | 
| @@ -0,0 +1,72 @@ | 
| +<html> | 
| +<head> | 
| +<script src="../../http/tests/inspector/inspector-test.js"></script> | 
| +<script src="../../http/tests/inspector/console-test.js"></script> | 
| +<script> | 
| + | 
| +function onload() | 
| +{ | 
| +    for (var i = 3; i < 8; ++i) | 
| +        window["temp" + i] = "Reserved"; | 
| + | 
| +    runTest(); | 
| +} | 
| + | 
| +function test() | 
| +{ | 
| +    WebInspector.inspectorView.showPanel("sources"); | 
| + | 
| +    var expressions = [ | 
| +        "42", | 
| +        "'foo string'", | 
| +        "NaN", | 
| +        "Infinity", | 
| +        "-Infinity", | 
| +        "-0", | 
| +        "[1, 2, NaN, -0, null, undefined]", | 
| +        "({ foo: 'bar' })", | 
| +        "(function(){ return arguments; })(1,2,3,4)", | 
| +        "(function func() {})", | 
| +        "new Error('errr')" | 
| +    ]; | 
| + | 
| +    InspectorTest.addResult("Number of expressions: " + expressions.length); | 
| +    InspectorTest.addResult("Names [temp3..temp7] are reserved\n"); | 
| + | 
| +    function evaluateNext() | 
| +    { | 
| +        var expression = expressions.shift(); | 
| +        if (!expression) { | 
| +            dumpConsoleMessages(); | 
| +            return; | 
| +        } | 
| + | 
| +        function didEvaluate(result, wasThrown) | 
| +        { | 
| +            InspectorTest.assertTrue(!wasThrown, "FAIL: was thrown. Expression: " + expression); | 
| +            WebInspector.panels.sources._saveToTempVariable(result); | 
| +            InspectorTest.waitUntilNthMessageReceived(2, evaluateNext); | 
| +        } | 
| + | 
| +        WebInspector.runtimeModel.evaluate(expression, "console", true, undefined, undefined, undefined, didEvaluate); | 
| +    } | 
| + | 
| +    function dumpConsoleMessages() | 
| +    { | 
| +        InspectorTest.dumpConsoleMessages(); | 
| +        InspectorTest.completeTest(); | 
| +    } | 
| + | 
| +    evaluateNext(); | 
| +} | 
| + | 
| +</script> | 
| +</head> | 
| + | 
| +<body onload="onload()"> | 
| +<p> | 
| +Tests saving objects to temporary variables. | 
| +</p> | 
| + | 
| +</body> | 
| +</html> | 
|  |