Index: test/inspector/cpu-profiler/coverage.js |
diff --git a/test/inspector/runtime/coverage.js b/test/inspector/cpu-profiler/coverage.js |
similarity index 75% |
rename from test/inspector/runtime/coverage.js |
rename to test/inspector/cpu-profiler/coverage.js |
index 0aa5da7318fa8168e72fd5dd4ca65ab3e1f73b35..16f679dc5abbe6306bf08c8b71d509ff698c5311 100644 |
--- a/test/inspector/runtime/coverage.js |
+++ b/test/inspector/cpu-profiler/coverage.js |
@@ -14,7 +14,7 @@ function fib(x) { |
fib(5); |
`; |
-print("Test collecting code coverage data with Runtime.collectCoverage."); |
+print("Test collecting code coverage data with Profiler.collectCoverage."); |
function ClearAndGC() { |
return Protocol.Runtime.evaluate({ expression: "fib = null;" }) |
@@ -32,30 +32,34 @@ InspectorTest.runTestSuite([ |
function testPreciseCoverage(next) |
{ |
Protocol.Runtime.enable() |
- .then(Protocol.Runtime.startPreciseCoverage) |
+ .then(Protocol.Profiler.enable) |
+ .then(Protocol.Profiler.startPreciseCoverage) |
.then(() => Protocol.Runtime.compileScript({ expression: source, sourceURL: "1", persistScript: true })) |
.then((result) => Protocol.Runtime.runScript({ scriptId: result.result.scriptId })) |
.then(ClearAndGC) |
.then(InspectorTest.logMessage) |
- .then(Protocol.Runtime.takePreciseCoverage) |
+ .then(Protocol.Profiler.takePreciseCoverage) |
.then(LogSorted) |
- .then(Protocol.Runtime.takePreciseCoverage) |
+ .then(Protocol.Profiler.takePreciseCoverage) |
.then(LogSorted) |
.then(ClearAndGC) |
- .then(Protocol.Runtime.stopPreciseCoverage) |
+ .then(Protocol.Profiler.stopPreciseCoverage) |
+ .then(Protocol.Profiler.disable) |
.then(Protocol.Runtime.disable) |
.then(next); |
}, |
function testPreciseCoverageFail(next) |
{ |
Protocol.Runtime.enable() |
+ .then(Protocol.Profiler.enable) |
.then(() => Protocol.Runtime.compileScript({ expression: source, sourceURL: "2", persistScript: true })) |
.then((result) => Protocol.Runtime.runScript({ scriptId: result.result.scriptId })) |
.then(InspectorTest.logMessage) |
.then(ClearAndGC) |
- .then(Protocol.Runtime.takePreciseCoverage) |
+ .then(Protocol.Profiler.takePreciseCoverage) |
.then(InspectorTest.logMessage) |
.then(ClearAndGC) |
+ .then(Protocol.Profiler.disable) |
.then(Protocol.Runtime.disable) |
.then(next); |
}, |
@@ -66,9 +70,9 @@ InspectorTest.runTestSuite([ |
.then((result) => Protocol.Runtime.runScript({ scriptId: result.result.scriptId })) |
.then(InspectorTest.logMessage) |
.then(ClearAndGC) |
- .then(Protocol.Runtime.getBestEffortCoverage) |
+ .then(Protocol.Profiler.getBestEffortCoverage) |
.then(LogSorted) |
- .then(Protocol.Runtime.getBestEffortCoverage) |
+ .then(Protocol.Profiler.getBestEffortCoverage) |
.then(LogSorted) |
.then(ClearAndGC) |
.then(Protocol.Runtime.disable) |
@@ -77,17 +81,19 @@ InspectorTest.runTestSuite([ |
function testBestEffortCoveragePrecise(next) |
{ |
Protocol.Runtime.enable() |
- .then(Protocol.Runtime.startPreciseCoverage) |
+ .then(Protocol.Profiler.enable) |
+ .then(Protocol.Profiler.startPreciseCoverage) |
.then(() => Protocol.Runtime.compileScript({ expression: source, sourceURL: "4", persistScript: true })) |
.then((result) => Protocol.Runtime.runScript({ scriptId: result.result.scriptId })) |
.then(InspectorTest.logMessage) |
.then(ClearAndGC) |
- .then(Protocol.Runtime.getBestEffortCoverage) |
+ .then(Protocol.Profiler.getBestEffortCoverage) |
.then(LogSorted) |
- .then(Protocol.Runtime.getBestEffortCoverage) |
+ .then(Protocol.Profiler.getBestEffortCoverage) |
.then(LogSorted) |
.then(ClearAndGC) |
- .then(Protocol.Runtime.stopPreciseCoverage) |
+ .then(Protocol.Profiler.stopPreciseCoverage) |
+ .then(Protocol.Profiler.disable) |
.then(Protocol.Runtime.disable) |
.then(next); |
}, |