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

Unified Diff: test/mjsunit/debug-evaluate.js

Issue 647022: Add maxStrinLength argument to debugger requests (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 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
« no previous file with comments | « src/mirror-delay.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/debug-evaluate.js
===================================================================
--- test/mjsunit/debug-evaluate.js (revision 3918)
+++ test/mjsunit/debug-evaluate.js (working copy)
@@ -87,6 +87,37 @@
testRequest(dcp, '{"expression":"a","global":true}', true, 1);
testRequest(dcp, '{"expression":"this.a","global":true}', true, 1);
+ // Test that the whole string text is returned if maxStringLength
+ // parameter is passed.
+ testRequest(
+ dcp,
+ '{"expression":"this.longString","global":true,maxStringLength:-1}',
+ true,
+ longString);
+ testRequest(
+ dcp,
+ '{"expression":"this.longString","global":true,maxStringLength:' +
+ longString.length + '}',
+ true,
+ longString);
+ var truncatedStringSuffix = '... (length: ' + longString.length + ')';
+ testRequest(
+ dcp,
+ '{"expression":"this.longString","global":true,maxStringLength:0}',
+ true,
+ truncatedStringSuffix);
+ testRequest(
+ dcp,
+ '{"expression":"this.longString","global":true,maxStringLength:1}',
+ true,
+ longString.charAt(0) + truncatedStringSuffix);
+ // Test that by default string is truncated to first 80 chars.
+ testRequest(
+ dcp,
+ '{"expression":"this.longString","global":true}',
+ true,
+ longString.substring(0, 80) + truncatedStringSuffix);
+
// Indicate that all was processed.
listenerComplete = true;
}
@@ -109,6 +140,12 @@
a = 1;
+// String which is longer than 80 chars.
+var longString = "1234567890_";
+for (var i = 0; i < 4; i++) {
+ longString += longString;
+}
+
// Set a break point at return in f and invoke g to hit the breakpoint.
Debug.setBreakPoint(f, 2, 0);
g();
« no previous file with comments | « src/mirror-delay.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698