Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / console / console-save-to-temp-var.html
blob9cef1600fe500b4e266cf32f125f5de76f1762ec
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 src="../../http/tests/inspector/sources-test.js"></script>
6 <script>
8 function onload()
10 for (var i = 3; i < 8; ++i)
11 window["temp" + i] = "Reserved";
13 runTest();
16 function test()
18 var expressions = [
19 "42",
20 "'foo string'",
21 "NaN",
22 "Infinity",
23 "-Infinity",
24 "-0",
25 "[1, 2, NaN, -0, null, undefined]",
26 "({ foo: 'bar' })",
27 "(function(){ return arguments; })(1,2,3,4)",
28 "(function func() {})",
29 "new Error('errr')"
32 InspectorTest.addResult("Number of expressions: " + expressions.length);
33 InspectorTest.addResult("Names [temp3..temp7] are reserved\n");
35 function evaluateNext()
37 var expression = expressions.shift();
38 if (!expression) {
39 InspectorTest.waitForRemoteObjectsConsoleMessages(dumpConsoleMessages);
40 return;
43 function didEvaluate(result, wasThrown)
45 InspectorTest.assertTrue(!wasThrown, "FAIL: was thrown. Expression: " + expression);
46 WebInspector.panels.sources._saveToTempVariable(result);
47 InspectorTest.waitUntilNthMessageReceived(2, evaluateNext);
50 WebInspector.context.flavor(WebInspector.ExecutionContext).evaluate(expression, "console", true, undefined, undefined, undefined, didEvaluate);
53 function dumpConsoleMessages()
55 InspectorTest.dumpConsoleMessagesIgnoreErrorStackFrames();
56 InspectorTest.completeTest();
59 evaluateNext();
62 </script>
63 </head>
65 <body onload="onload()">
66 <p>
67 Tests saving objects to temporary variables.
68 </p>
70 </body>
71 </html>