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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « test/mjsunit/mjsunit.js ('k') | tools/logreader.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 74
75 (function testExpandBackRef() { 75 (function testExpandBackRef() {
76 var reader = new devtools.profiler.LogReader({}); 76 var reader = new devtools.profiler.LogReader({});
77 77
78 assertEquals('aaaaaaaa', reader.expandBackRef_('aaaaaaaa')); 78 assertEquals('aaaaaaaa', reader.expandBackRef_('aaaaaaaa'));
79 assertEquals('aaaaaaaa', reader.expandBackRef_('#1')); 79 assertEquals('aaaaaaaa', reader.expandBackRef_('#1'));
80 assertEquals('bbbbaaaa', reader.expandBackRef_('bbbb#2:4')); 80 assertEquals('bbbbaaaa', reader.expandBackRef_('bbbb#2:4'));
81 assertEquals('"#1:1"', reader.expandBackRef_('"#1:1"')); 81 assertEquals('"#1:1"', reader.expandBackRef_('"#1:1"'));
82 })(); 82 })();
83
84
85 // See http://code.google.com/p/v8/issues/detail?id=420
86 (function testReadingTruncatedLog() {
87 // Having an incorrect event in the middle of a log should throw an exception.
88 var reader1 = new devtools.profiler.LogReader({});
89 assertThrows(function() {
90 reader1.processLogChunk('alias,a,b\nxxxx\nalias,c,d\n');
91 });
92
93 // But having it as the last record should not.
94 var reader2 = new devtools.profiler.LogReader({});
95 assertDoesNotThrow(function() {
96 reader2.processLogChunk('alias,a,b\nalias,c,d\nxxxx');
97 });
98 })();
OLDNEW
« 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