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

Side by Side Diff: test/mjsunit/debug-evaluate.js

Issue 6903172: Use JSON.parse instead of eval for the debugger JSON protocol. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 9 years, 7 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
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/mjsunit/debug-scripts-request.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 testRequest(dcp, '{"expression":"a","frame":0}', true, 3); 84 testRequest(dcp, '{"expression":"a","frame":0}', true, 3);
85 testRequest(dcp, '{"expression":"a","frame":1}', true, 2); 85 testRequest(dcp, '{"expression":"a","frame":1}', true, 2);
86 testRequest(dcp, '{"expression":"a","frame":2}', true, 1); 86 testRequest(dcp, '{"expression":"a","frame":2}', true, 1);
87 testRequest(dcp, '{"expression":"a","global":true}', true, 1); 87 testRequest(dcp, '{"expression":"a","global":true}', true, 1);
88 testRequest(dcp, '{"expression":"this.a","global":true}', true, 1); 88 testRequest(dcp, '{"expression":"this.a","global":true}', true, 1);
89 89
90 // Test that the whole string text is returned if maxStringLength 90 // Test that the whole string text is returned if maxStringLength
91 // parameter is passed. 91 // parameter is passed.
92 testRequest( 92 testRequest(
93 dcp, 93 dcp,
94 '{"expression":"this.longString","global":true,maxStringLength:-1}', 94 '{"expression":"this.longString","global":true,"maxStringLength":-1}',
95 true, 95 true,
96 longString); 96 longString);
97 testRequest( 97 testRequest(
98 dcp, 98 dcp,
99 '{"expression":"this.longString","global":true,maxStringLength:' + 99 '{"expression":"this.longString","global":true,"maxStringLength":' +
100 longString.length + '}', 100 longString.length + '}',
101 true, 101 true,
102 longString); 102 longString);
103 var truncatedStringSuffix = '... (length: ' + longString.length + ')'; 103 var truncatedStringSuffix = '... (length: ' + longString.length + ')';
104 testRequest( 104 testRequest(
105 dcp, 105 dcp,
106 '{"expression":"this.longString","global":true,maxStringLength:0}', 106 '{"expression":"this.longString","global":true,"maxStringLength":0}',
107 true, 107 true,
108 truncatedStringSuffix); 108 truncatedStringSuffix);
109 testRequest( 109 testRequest(
110 dcp, 110 dcp,
111 '{"expression":"this.longString","global":true,maxStringLength:1}', 111 '{"expression":"this.longString","global":true,"maxStringLength":1}',
112 true, 112 true,
113 longString.charAt(0) + truncatedStringSuffix); 113 longString.charAt(0) + truncatedStringSuffix);
114 // Test that by default string is truncated to first 80 chars. 114 // Test that by default string is truncated to first 80 chars.
115 testRequest( 115 testRequest(
116 dcp, 116 dcp,
117 '{"expression":"this.longString","global":true}', 117 '{"expression":"this.longString","global":true}',
118 true, 118 true,
119 longString.substring(0, 80) + truncatedStringSuffix); 119 longString.substring(0, 80) + truncatedStringSuffix);
120 120
121 // Indicate that all was processed. 121 // Indicate that all was processed.
(...skipping 24 matching lines...) Expand all
146 longString += longString; 146 longString += longString;
147 } 147 }
148 148
149 // Set a break point at return in f and invoke g to hit the breakpoint. 149 // Set a break point at return in f and invoke g to hit the breakpoint.
150 Debug.setBreakPoint(f, 2, 0); 150 Debug.setBreakPoint(f, 2, 0);
151 g(); 151 g();
152 152
153 assertFalse(exception, "exception in listener") 153 assertFalse(exception, "exception in listener")
154 // Make sure that the debug event listener vas invoked. 154 // Make sure that the debug event listener vas invoked.
155 assertTrue(listenerComplete, "listener did not run to completion"); 155 assertTrue(listenerComplete, "listener did not run to completion");
OLDNEW
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/mjsunit/debug-scripts-request.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698