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

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

Issue 2713023004: [inspector] added reconnect method for tests (Closed)
Patch Set: rebased Created 3 years, 9 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 var source = 5 var source =
6 ` 6 `
7 function fib(x) { 7 function fib(x) {
8 if (x < 2) return 1; 8 if (x < 2) return 1;
9 return fib(x-1) + fib(x-2); 9 return fib(x-1) + fib(x-2);
10 } 10 }
11 (function iife() { 11 (function iife() {
12 return 1; 12 return 1;
13 })(); 13 })();
14 fib(5); 14 fib(5);
15 `; 15 `;
16 16
17 print("Test collecting code coverage data with Profiler.collectCoverage."); 17 InspectorTest.log("Test collecting code coverage data with Profiler.collectCover age.");
18 18
19 function ClearAndGC() { 19 function ClearAndGC() {
20 return Protocol.Runtime.evaluate({ expression: "fib = null;" }) 20 return Protocol.Runtime.evaluate({ expression: "fib = null;" })
21 .then(() => Protocol.HeapProfiler.enable()) 21 .then(() => Protocol.HeapProfiler.enable())
22 .then(() => Protocol.HeapProfiler.collectGarbage()) 22 .then(() => Protocol.HeapProfiler.collectGarbage())
23 .then(() => Protocol.HeapProfiler.disable()); 23 .then(() => Protocol.HeapProfiler.disable());
24 } 24 }
25 25
26 function LogSorted(message) { 26 function LogSorted(message) {
27 message.result.result.sort((a, b) => parseInt(a.scriptId) - parseInt(b.scriptI d)); 27 message.result.result.sort((a, b) => parseInt(a.scriptId) - parseInt(b.scriptI d));
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 .then(LogSorted) 91 .then(LogSorted)
92 .then(Protocol.Profiler.getBestEffortCoverage) 92 .then(Protocol.Profiler.getBestEffortCoverage)
93 .then(LogSorted) 93 .then(LogSorted)
94 .then(ClearAndGC) 94 .then(ClearAndGC)
95 .then(Protocol.Profiler.stopPreciseCoverage) 95 .then(Protocol.Profiler.stopPreciseCoverage)
96 .then(Protocol.Profiler.disable) 96 .then(Protocol.Profiler.disable)
97 .then(Protocol.Runtime.disable) 97 .then(Protocol.Runtime.disable)
98 .then(next); 98 .then(next);
99 }, 99 },
100 ]); 100 ]);
OLDNEW
« no previous file with comments | « test/inspector/cpu-profiler/console-profile-end-parameterless-crash.js ('k') | test/inspector/cpu-profiler/enable-disable.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698