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

Unified 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: addressed 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 side-by-side diff with in-line comments
Download patch
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>
« no previous file with comments | « LayoutTests/http/tests/inspector/console-test.js ('k') | LayoutTests/inspector/console/console-save-to-temp-var-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698