| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 assertEquals(0x200, reader.prevAddresses_.test); | 60 assertEquals(0x200, reader.prevAddresses_.test); |
| 61 assertEquals(0x100, parser('-100')); | 61 assertEquals(0x100, parser('-100')); |
| 62 assertEquals(0x100, reader.prevAddresses_.test); | 62 assertEquals(0x100, reader.prevAddresses_.test); |
| 63 })(); | 63 })(); |
| 64 | 64 |
| 65 | 65 |
| 66 (function testAddressParser() { | 66 (function testAddressParser() { |
| 67 var reader = new devtools.profiler.LogReader({}); | 67 var reader = new devtools.profiler.LogReader({}); |
| 68 | 68 |
| 69 assertEquals([0x10000000, 0x10001000, 0xffff000, 0x10000000], | 69 assertEquals([0x10000000, 0x10001000, 0xffff000, 0x10000000], |
| 70 reader.processStack(0x10000000, ['overflow', | 70 reader.processStack(0x10000000, 0, ['overflow', |
| 71 '+1000', '-2000', '+1000'])); | 71 '+1000', '-2000', '+1000'])); |
| 72 })(); | 72 })(); |
| 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 | 83 |
| 84 | 84 |
| 85 // See http://code.google.com/p/v8/issues/detail?id=420 | 85 // See http://code.google.com/p/v8/issues/detail?id=420 |
| 86 (function testReadingTruncatedLog() { | 86 (function testReadingTruncatedLog() { |
| 87 // Having an incorrect event in the middle of a log should throw an exception. | 87 // Having an incorrect event in the middle of a log should throw an exception. |
| 88 var reader1 = new devtools.profiler.LogReader({}); | 88 var reader1 = new devtools.profiler.LogReader({}); |
| 89 assertThrows(function() { | 89 assertThrows(function() { |
| 90 reader1.processLogChunk('alias,a,b\nxxxx\nalias,c,d\n'); | 90 reader1.processLogChunk('alias,a,b\nxxxx\nalias,c,d\n'); |
| 91 }); | 91 }); |
| 92 | 92 |
| 93 // But having it as the last record should not. | 93 // But having it as the last record should not. |
| 94 var reader2 = new devtools.profiler.LogReader({}); | 94 var reader2 = new devtools.profiler.LogReader({}); |
| 95 assertDoesNotThrow(function() { | 95 assertDoesNotThrow(function() { |
| 96 reader2.processLogChunk('alias,a,b\nalias,c,d\nxxxx'); | 96 reader2.processLogChunk('alias,a,b\nalias,c,d\nxxxx'); |
| 97 }); | 97 }); |
| 98 })(); | 98 })(); |
| OLD | NEW |