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

Side by Side Diff: test/inspector/cpu-profiler/coverage.js

Issue 2891213002: [inspector] Refactor protocol-test.js (Closed)
Patch Set: comments addressed Created 3 years, 7 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
OLDNEW
1 // Copyright 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --allow-natives-syntax --no-always-opt --opt 5 // Flags: --allow-natives-syntax --no-always-opt --opt
6 6
7 var source = 7 var source =
8 ` 8 `
9 function fib(x) { 9 function fib(x) {
10 if (x < 2) return 1; 10 if (x < 2) return 1;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 return function nested_3() {} 43 return function nested_3() {}
44 } 44 }
45 } 45 }
46 } 46 }
47 function nested_4() {} 47 function nested_4() {}
48 return nested_0(); 48 return nested_0();
49 })(); 49 })();
50 f()()(); 50 f()()();
51 `; 51 `;
52 52
53 InspectorTest.log("Test collecting code coverage data with Profiler.collectCover age."); 53 let {session, contextGroup, Protocol} = InspectorTest.start("Test collecting cod e coverage data with Profiler.collectCoverage.");
54 54
55 function ClearAndGC() { 55 function ClearAndGC() {
56 return Protocol.Runtime.evaluate({ expression: "fib = g = f = h = is_optimized = null;" }) 56 return Protocol.Runtime.evaluate({ expression: "fib = g = f = h = is_optimized = null;" })
57 .then(GC); 57 .then(GC);
58 } 58 }
59 59
60 function GC() { 60 function GC() {
61 return Protocol.HeapProfiler.enable() 61 return Protocol.HeapProfiler.enable()
62 .then(() => Protocol.HeapProfiler.collectGarbage()) 62 .then(() => Protocol.HeapProfiler.collectGarbage())
63 .then(() => Protocol.HeapProfiler.disable()); 63 .then(() => Protocol.HeapProfiler.disable());
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 .then(() => Protocol.Runtime.evaluate({ expression: "f()" })) 258 .then(() => Protocol.Runtime.evaluate({ expression: "f()" }))
259 .then(Protocol.Profiler.takePreciseCoverage) 259 .then(Protocol.Profiler.takePreciseCoverage)
260 .then(LogSorted) 260 .then(LogSorted)
261 .then(Protocol.Profiler.stopPreciseCoverage) 261 .then(Protocol.Profiler.stopPreciseCoverage)
262 .then(Protocol.Profiler.disable) 262 .then(Protocol.Profiler.disable)
263 .then(Protocol.Runtime.disable) 263 .then(Protocol.Runtime.disable)
264 .then(ClearAndGC) 264 .then(ClearAndGC)
265 .then(next); 265 .then(next);
266 }, 266 },
267 ]); 267 ]);
OLDNEW
« no previous file with comments | « test/inspector/cpu-profiler/console-profile-expected.txt ('k') | test/inspector/cpu-profiler/enable-disable.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698