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 InspectorTest.assertSnapshotEquals = function(reference, actual) | 9 InspectorTest.assertSnapshotEquals = function(reference, actual) |
10 { | 10 { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 uid: 42, | 51 uid: 42, |
52 maxJSObjectId: 6 | 52 maxJSObjectId: 6 |
53 }); | 53 }); |
54 } | 54 } |
55 | 55 |
56 WebInspector.log = function(message) { | 56 WebInspector.log = function(message) { |
57 InspectorTest.addResult("WebInspector.log: " + message); | 57 InspectorTest.addResult("WebInspector.log: " + message); |
58 } | 58 } |
59 | 59 |
60 InspectorTest.runTestSuite([ | 60 InspectorTest.runTestSuite([ |
61 function clearHeapProfilerTempStorage(next) | |
62 { | |
63 function didFail(e) | |
64 { | |
65 InspectorTest.addResult("FAIL: " + e); | |
66 InspectorTest.completeTest(); | |
67 } | |
68 function didGetFS(fs) | |
69 { | |
70 fs.root.getDirectory("heap-profiler", { create: false }, didGetD
ir, next); | |
71 } | |
72 function didGetDir(dir) | |
73 { | |
74 dir.removeRecursively(next, didFail); | |
75 } | |
76 window.webkitRequestFileSystem(window.TEMPORARY, 10, didGetFS, didFa
il); | |
77 }, | |
78 | |
79 function heapSnapshotLoaderTest(next) | 61 function heapSnapshotLoaderTest(next) |
80 { | 62 { |
81 var loader = new WebInspector.HeapSnapshotLoader(); | 63 var loader = new WebInspector.HeapSnapshotLoader(); |
82 for (var i = 0, l = sourceStringified.length; i < l; i += partSize) | 64 for (var i = 0, l = sourceStringified.length; i < l; i += partSize) |
83 loader.write(sourceStringified.slice(i, i + partSize)); | 65 loader.write(sourceStringified.slice(i, i + partSize)); |
84 loader.close(); | 66 loader.close(); |
85 var result = loader.buildSnapshot("JSHeapSnapshot"); | 67 var result = loader.buildSnapshot("JSHeapSnapshot"); |
86 result._nodes = new Uint32Array(result._nodes); | 68 result._nodes = new Uint32Array(result._nodes); |
87 result._containmentEdges = new Uint32Array(result._containmentEdges)
; | 69 result._containmentEdges = new Uint32Array(result._containmentEdges)
; |
88 InspectorTest.assertSnapshotEquals(new WebInspector.JSHeapSnapshot(I
nspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()),
result); | 70 InspectorTest.assertSnapshotEquals(new WebInspector.JSHeapSnapshot(I
nspectorTest.createHeapSnapshotMock(), new WebInspector.HeapSnapshotProgress()),
result); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 </script> | 162 </script> |
181 </head> | 163 </head> |
182 | 164 |
183 <body onload="runTest()"> | 165 <body onload="runTest()"> |
184 <p> | 166 <p> |
185 This test checks HeapSnapshots loader. | 167 This test checks HeapSnapshots loader. |
186 </p> | 168 </p> |
187 | 169 |
188 </body> | 170 </body> |
189 </html> | 171 </html> |
OLD | NEW |