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

Unified Diff: test/cctest/test-debug.cc

Issue 2700743002: [inspector] extend protocol for code coverage. (Closed)
Patch Set: fix 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 | « src/runtime/runtime-debug.cc ('k') | test/inspector/runtime/coverage.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-debug.cc
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
index b30c6d923a0fab7774f36f1fed1b07174eee22e8..79a18a0d87723fa8daa870c57f3c722cca708be9 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -6637,27 +6637,28 @@ TEST(DebugCoverage) {
"f();\n"
"f();");
CompileRun(source);
- v8::debug::Coverage coverage = v8::debug::Coverage::Collect(isolate);
+ v8::debug::Coverage coverage = v8::debug::Coverage::Collect(isolate, false);
CHECK_EQ(1u, coverage.ScriptCount());
- v8::Local<v8::debug::Script> script = coverage.GetScript(0);
+ v8::debug::Coverage::ScriptData script_data = coverage.GetScriptData(0);
+ v8::Local<v8::debug::Script> script = script_data.GetScript();
CHECK(script->Source()
.ToLocalChecked()
->Equals(env.local(), source)
.FromMaybe(false));
- v8::debug::Coverage::Range range = coverage.GetRange(0);
- CHECK_EQ(0, range.Start().GetLineNumber());
- CHECK_EQ(0, range.Start().GetColumnNumber());
- CHECK_EQ(3, range.End().GetLineNumber());
- CHECK_EQ(4, range.End().GetColumnNumber());
- CHECK_EQ(1, range.Count());
- CHECK_EQ(1u, range.NestedCount());
-
- range = range.GetNested(0);
- CHECK_EQ(0, range.Start().GetLineNumber());
- CHECK_EQ(0, range.Start().GetColumnNumber());
- CHECK_EQ(1, range.End().GetLineNumber());
- CHECK_EQ(1, range.End().GetColumnNumber());
- CHECK_EQ(2, range.Count());
- CHECK_EQ(0, range.NestedCount());
+ CHECK_EQ(2u, script_data.FunctionCount());
+ v8::debug::Coverage::FunctionData function_data =
+ script_data.GetFunctionData(0);
+ CHECK_EQ(0, function_data.Start().GetLineNumber());
+ CHECK_EQ(0, function_data.Start().GetColumnNumber());
+ CHECK_EQ(3, function_data.End().GetLineNumber());
+ CHECK_EQ(4, function_data.End().GetColumnNumber());
+ CHECK_EQ(1, function_data.Count());
+
+ function_data = script_data.GetFunctionData(1);
+ CHECK_EQ(0, function_data.Start().GetLineNumber());
+ CHECK_EQ(0, function_data.Start().GetColumnNumber());
+ CHECK_EQ(1, function_data.End().GetLineNumber());
+ CHECK_EQ(1, function_data.End().GetColumnNumber());
+ CHECK_EQ(2, function_data.Count());
}
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | test/inspector/runtime/coverage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698