Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: LayoutTests/inspector/console/console-save-to-temp-var.html

Issue 201613004: DevTools: Add context menu option for objects to save to temp variable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 "-Infinity",
23 "[1, 2, NaN, -0, null, undefined]",
24 "({ foo: 'bar' })",
25 "(function(){ return arguments; })(1,2,3,4)",
26 "(function func() {})",
27 "new Error('errr')"
28 ];
29
30 InspectorTest.addResult("Number of expressions: " + expressions.length);
31 InspectorTest.addResult("Names [temp3..temp7] are reserved\n");
32
33 function evaluateNext()
34 {
35 var expression = expressions.shift();
36 if (!expression) {
37 dumpConsoleMessages();
38 return;
39 }
40
41 function didEvaluate(result, wasThrown)
42 {
43 InspectorTest.assertTrue(!wasThrown, "FAIL: was thrown. Expression: " + expression);
44 WebInspector.panels.sources._saveToTempVariable(result);
45 InspectorTest.waitUntilNthMessageReceived(2, evaluateNext);
46 }
47
48 WebInspector.runtimeModel.evaluate(expression, "console", true, undefine d, undefined, undefined, didEvaluate);
49 }
50
51 function dumpConsoleMessages()
52 {
53 InspectorTest.dumpConsoleMessages();
54 InspectorTest.completeTest();
55 }
56
57 evaluateNext();
58 }
59
60 </script>
61 </head>
62
63 <body onload="onload()">
64 <p>
65 Tests saving objects to temporary variables.
66 </p>
67
68 </body>
69 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698