Index: test/mjsunit/tools/codemap.js |
diff --git a/test/mjsunit/tools/codemap.js b/test/mjsunit/tools/codemap.js |
index fdad8190be0ccdec9be7805a26a78e4556d74942..55b875883592faeb612500a5d609ad8b53bf2c4a 100644 |
--- a/test/mjsunit/tools/codemap.js |
+++ b/test/mjsunit/tools/codemap.js |
@@ -123,4 +123,36 @@ function assertNoEntry(codeMap, addr) { |
codeMap.addCode(0x1700, newCodeEntry(0x100, 'code')); |
assertEntry(codeMap, 'code', 0x1500); |
assertEntry(codeMap, 'code {1}', 0x1700); |
+ // Test name stability. |
+ assertEntry(codeMap, 'code', 0x1500); |
+ assertEntry(codeMap, 'code {1}', 0x1700); |
+})(); |
+ |
+ |
+(function testStaticEntriesExport() { |
+ var codeMap = new devtools.profiler.CodeMap(); |
+ codeMap.addStaticCode(0x1500, newCodeEntry(0x3000, 'lib1')); |
+ codeMap.addStaticCode(0x15500, newCodeEntry(0x5000, 'lib2')); |
+ codeMap.addStaticCode(0x155500, newCodeEntry(0x10000, 'lib3')); |
+ var allStatics = codeMap.getAllStaticEntries(); |
+ allStatics.sort(); |
+ assertEquals(['lib1: 3000', 'lib2: 5000', 'lib3: 10000'], allStatics); |
+})(); |
+ |
+ |
+(function testDynamicEntriesExport() { |
+ var codeMap = new devtools.profiler.CodeMap(); |
+ codeMap.addCode(0x1500, newCodeEntry(0x200, 'code1')); |
+ codeMap.addCode(0x1700, newCodeEntry(0x100, 'code2')); |
+ codeMap.addCode(0x1900, newCodeEntry(0x50, 'code3')); |
+ var allDynamics = codeMap.getAllDynamicEntries(); |
+ allDynamics.sort(); |
+ assertEquals(['code1: 200', 'code2: 100', 'code3: 50'], allDynamics); |
+ codeMap.deleteCode(0x1700); |
+ var allDynamics2 = codeMap.getAllDynamicEntries(); |
+ allDynamics2.sort(); |
+ assertEquals(['code1: 200', 'code3: 50'], allDynamics2); |
+ codeMap.deleteCode(0x1500); |
+ var allDynamics3 = codeMap.getAllDynamicEntries(); |
+ assertEquals(['code3: 50'], allDynamics3); |
})(); |