Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="heap-snapshot-test.js"></script> | 4 <script src="heap-snapshot-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 WebInspector.inspectorView.showPanel("profiles"); | 9 WebInspector.inspectorView.showPanel("profiles"); |
| 10 | 10 |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 348 function heapSnapshotLoaderTest() | 348 function heapSnapshotLoaderTest() |
| 349 { | 349 { |
| 350 var source = InspectorTest.createHeapSnapshotMockRaw(); | 350 var source = InspectorTest.createHeapSnapshotMockRaw(); |
| 351 var sourceStringified = JSON.stringify(source); | 351 var sourceStringified = JSON.stringify(source); |
| 352 var partSize = sourceStringified.length >> 3; | 352 var partSize = sourceStringified.length >> 3; |
| 353 | 353 |
| 354 var loader = new WebInspector.HeapSnapshotLoader(); | 354 var loader = new WebInspector.HeapSnapshotLoader(); |
| 355 for (var i = 0, l = sourceStringified.length; i < l; i += partSi ze) | 355 for (var i = 0, l = sourceStringified.length; i < l; i += partSi ze) |
| 356 loader.write(sourceStringified.slice(i, i + partSize)); | 356 loader.write(sourceStringified.slice(i, i + partSize)); |
| 357 loader.close(); | 357 loader.close(); |
| 358 var result = loader.buildSnapshot("JSHeapSnapshot"); | 358 var result = loader.buildSnapshot(); |
|
yurys
2014/03/27 07:35:41
buildSnapshot(false)
alph
2014/03/27 09:39:32
Done.
| |
| 359 result._nodes = new Uint32Array(result._nodes); | 359 result._nodes = new Uint32Array(result._nodes); |
| 360 result._containmentEdges = new Uint32Array(result._containmentEd ges); | 360 result._containmentEdges = new Uint32Array(result._containmentEd ges); |
| 361 function assertSnapshotEquals(reference, actual) | 361 function assertSnapshotEquals(reference, actual) |
| 362 { | 362 { |
| 363 InspectorTest.assertEquals(JSON.stringify(reference), JSON.s tringify(actual)); | 363 InspectorTest.assertEquals(JSON.stringify(reference), JSON.s tringify(actual)); |
| 364 } | 364 } |
| 365 assertSnapshotEquals(new WebInspector.JSHeapSnapshot(InspectorTe st.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()), result); | 365 assertSnapshotEquals(new WebInspector.JSHeapSnapshot(InspectorTe st.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()), result); |
| 366 }, | 366 }, |
| 367 ]; | 367 ]; |
| 368 | 368 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 397 </script> | 397 </script> |
| 398 </head> | 398 </head> |
| 399 | 399 |
| 400 <body onload="runTest()"> | 400 <body onload="runTest()"> |
| 401 <p> | 401 <p> |
| 402 This test checks HeapSnapshots module. | 402 This test checks HeapSnapshots module. |
| 403 </p> | 403 </p> |
| 404 | 404 |
| 405 </body> | 405 </body> |
| 406 </html> | 406 </html> |
| OLD | NEW |