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

Unified Diff: test/mjsunit/tools/logreader.js

Issue 171038: Fix issue 420: accept truncated log files. (Closed)
Patch Set: Comment addressed Created 11 years, 4 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 | « test/mjsunit/mjsunit.js ('k') | tools/logreader.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/tools/logreader.js
diff --git a/test/mjsunit/tools/logreader.js b/test/mjsunit/tools/logreader.js
index dfd7f9f54eb003646ea91c182b6cc73efdb80a69..8ed5ffd2670b68e3ec7e320d3f031c906f7c7edd 100644
--- a/test/mjsunit/tools/logreader.js
+++ b/test/mjsunit/tools/logreader.js
@@ -80,3 +80,19 @@
assertEquals('bbbbaaaa', reader.expandBackRef_('bbbb#2:4'));
assertEquals('"#1:1"', reader.expandBackRef_('"#1:1"'));
})();
+
+
+// See http://code.google.com/p/v8/issues/detail?id=420
+(function testReadingTruncatedLog() {
+ // Having an incorrect event in the middle of a log should throw an exception.
+ var reader1 = new devtools.profiler.LogReader({});
+ assertThrows(function() {
+ reader1.processLogChunk('alias,a,b\nxxxx\nalias,c,d\n');
+ });
+
+ // But having it as the last record should not.
+ var reader2 = new devtools.profiler.LogReader({});
+ assertDoesNotThrow(function() {
+ reader2.processLogChunk('alias,a,b\nalias,c,d\nxxxx');
+ });
+})();
« no previous file with comments | « test/mjsunit/mjsunit.js ('k') | tools/logreader.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698