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

Side by Side Diff: test/mjsunit/code-coverage-precise.js

Issue 2696163002: [debugger] implement inspector-facing API for code coverage. (Closed)
Patch Set: one more shared export 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 unified diff | Download patch
« no previous file with comments | « test/mjsunit/code-coverage-ad-hoc.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5 // Flags: --allow-natives-syntax --no-always-opt
6 6
7 // Test precise code coverage. 7 // Test precise code coverage.
8 8
9 function GetCoverage(source) { 9 function GetCoverage(source) {
10 for (var script of %DebugCollectCoverage()) { 10 for (var script of %DebugCollectCoverage()) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 // This does not happen with precise coverage enabled. 64 // This does not happen with precise coverage enabled.
65 %DebugTogglePreciseCoverage(true); 65 %DebugTogglePreciseCoverage(true);
66 66
67 TestCoverage( 67 TestCoverage(
68 "call an IIFE", 68 "call an IIFE",
69 ` 69 `
70 (function f() {})(); 70 (function f() {})();
71 `, 71 `,
72 ` 72 `
73 [([function f() {}](f:1))();](anonymous:1) 73 [([function f() {}](f:1))();](:1)
74 ` 74 `
75 ); 75 );
76 76
77 TestCoverage( 77 TestCoverage(
78 "call locally allocated function", 78 "call locally allocated function",
79 ` 79 `
80 for (var i = 0; i < 10; i++) { 80 for (var i = 0; i < 10; i++) {
81 let f = () => 1; 81 let f = () => 1;
82 i += f(); 82 i += f();
83 } 83 }
84 `, 84 `,
85 ` 85 `
86 [for (var i = 0; i < 10; i++) { 86 [for (var i = 0; i < 10; i++) {
87 let f = [() => 1](f:5); 87 let f = [() => 1](f:5);
88 i += f(); 88 i += f();
89 }](anonymous:1) 89 }](:1)
90 ` 90 `
91 ); 91 );
92 92
93 %DebugTogglePreciseCoverage(false); 93 %DebugTogglePreciseCoverage(false);
OLDNEW
« no previous file with comments | « test/mjsunit/code-coverage-ad-hoc.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698