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

Unified Diff: test/inspector/runtime/coverage.js

Issue 2715833003: [inspector] move coverage related methods to profiler (Closed)
Patch Set: rebased Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/inspector/cpu-profiler/coverage-expected.txt ('k') | test/inspector/runtime/coverage-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/runtime/coverage.js
diff --git a/test/inspector/runtime/coverage.js b/test/inspector/runtime/coverage.js
deleted file mode 100644
index 0aa5da7318fa8168e72fd5dd4ca65ab3e1f73b35..0000000000000000000000000000000000000000
--- a/test/inspector/runtime/coverage.js
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright 2017 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var source =
-`
-function fib(x) {
- if (x < 2) return 1;
- return fib(x-1) + fib(x-2);
-}
-(function iife() {
- return 1;
-})();
-fib(5);
-`;
-
-print("Test collecting code coverage data with Runtime.collectCoverage.");
-
-function ClearAndGC() {
- return Protocol.Runtime.evaluate({ expression: "fib = null;" })
- .then(() => Protocol.HeapProfiler.enable())
- .then(() => Protocol.HeapProfiler.collectGarbage())
- .then(() => Protocol.HeapProfiler.disable());
-}
-
-function LogSorted(message) {
- message.result.result.sort((a, b) => parseInt(a.scriptId) - parseInt(b.scriptId));
- return InspectorTest.logMessage(message);
-}
-
-InspectorTest.runTestSuite([
- function testPreciseCoverage(next)
- {
- Protocol.Runtime.enable()
- .then(Protocol.Runtime.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(LogSorted)
- .then(Protocol.Runtime.takePreciseCoverage)
- .then(LogSorted)
- .then(ClearAndGC)
- .then(Protocol.Runtime.stopPreciseCoverage)
- .then(Protocol.Runtime.disable)
- .then(next);
- },
- function testPreciseCoverageFail(next)
- {
- Protocol.Runtime.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(InspectorTest.logMessage)
- .then(ClearAndGC)
- .then(Protocol.Runtime.disable)
- .then(next);
- },
- function testBestEffortCoverage(next)
- {
- Protocol.Runtime.enable()
- .then(() => Protocol.Runtime.compileScript({ expression: source, sourceURL: "3", persistScript: true }))
- .then((result) => Protocol.Runtime.runScript({ scriptId: result.result.scriptId }))
- .then(InspectorTest.logMessage)
- .then(ClearAndGC)
- .then(Protocol.Runtime.getBestEffortCoverage)
- .then(LogSorted)
- .then(Protocol.Runtime.getBestEffortCoverage)
- .then(LogSorted)
- .then(ClearAndGC)
- .then(Protocol.Runtime.disable)
- .then(next);
- },
- function testBestEffortCoveragePrecise(next)
- {
- Protocol.Runtime.enable()
- .then(Protocol.Runtime.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(LogSorted)
- .then(Protocol.Runtime.getBestEffortCoverage)
- .then(LogSorted)
- .then(ClearAndGC)
- .then(Protocol.Runtime.stopPreciseCoverage)
- .then(Protocol.Runtime.disable)
- .then(next);
- },
-]);
« no previous file with comments | « test/inspector/cpu-profiler/coverage-expected.txt ('k') | test/inspector/runtime/coverage-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698