Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: LayoutTests/inspector/profiler/heap-snapshot-loader.html

Issue 132993009: Use mock temp file in profiler tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comment Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/inspector/inspector-test.js ('k') | LayoutTests/inspector/profiler/heap-snapshot-loader-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698