OLD | NEW |
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 Loading... |
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 })(); | |
OLD | NEW |