3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/console-test.js"></script>
5 <script src="../../../http/tests/inspector/debugger-test.js"></script>
10 function testFunction()
17 thisObj = { foo: 42, __proto__: null };
18 for (var i = 1; i < 6; ++i)
19 thisObj["temp" + i] = "FAIL";
24 function checkThisObject()
26 for (var key in thisObj) {
28 console.assert(thisObj[key] === 42);
29 else if (key.substr(0, 4) === "temp")
30 console.assert(thisObj[key] === "FAIL");
32 console.error("FAIL: Unexpected property " + key);
38 for (var i = 3; i < 8; ++i)
39 window["temp" + i] = "Reserved";
53 "[1, 2, NaN, -0, null, undefined]",
55 "(function(){ return arguments; })(1,2,3,4)",
56 "(function func() {})",
60 InspectorTest.setQuiet(true);
61 InspectorTest.startDebuggerTest(step1);
63 InspectorTest.addResult("Number of expressions: " + expressions.length);
64 InspectorTest.addResult("Names [temp3..temp7] are reserved\n");
68 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
76 function evaluateNext()
78 var expression = expressions.shift();
80 InspectorTest.waitForRemoteObjectsConsoleMessages(tearDown);
84 function didEvaluate(result, wasThrown)
86 InspectorTest.assertTrue(!wasThrown, "FAIL: was thrown. Expression: " + expression);
87 WebInspector.panels.sources._saveToTempVariable(result);
88 InspectorTest.waitUntilNthMessageReceived(2, evaluateNext);
91 WebInspector.context.flavor(WebInspector.ExecutionContext).evaluate(expression, "console", true, undefined, undefined, undefined, didEvaluate);
96 InspectorTest.evaluateInPage("checkThisObject()", dumpConsoleMessages);
99 function dumpConsoleMessages()
101 InspectorTest.dumpConsoleMessages();
102 InspectorTest.completeDebuggerTest();
109 <body onload="onload()">
111 Tests saving objects to temporary variables while paused.