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

Side by Side Diff: test/cctest/test-debug.cc

Issue 2765813002: [debug] refactor code coverage to use enum for mode. (Closed)
Patch Set: fix d8 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
« no previous file with comments | « src/runtime/runtime-debug.cc ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 6595 matching lines...) Expand 10 before | Expand all | Expand 10 after
6606 CHECK(out_of_memory_callback_called); 6606 CHECK(out_of_memory_callback_called);
6607 } 6607 }
6608 isolate->Dispose(); 6608 isolate->Dispose();
6609 } 6609 }
6610 6610
6611 TEST(DebugCoverage) { 6611 TEST(DebugCoverage) {
6612 i::FLAG_always_opt = false; 6612 i::FLAG_always_opt = false;
6613 LocalContext env; 6613 LocalContext env;
6614 v8::Isolate* isolate = env->GetIsolate(); 6614 v8::Isolate* isolate = env->GetIsolate();
6615 v8::HandleScope scope(isolate); 6615 v8::HandleScope scope(isolate);
6616 v8::debug::Coverage::TogglePrecise(isolate, true); 6616 v8::debug::Coverage::SelectMode(isolate, v8::debug::Coverage::kPreciseCount);
6617 v8::Local<v8::String> source = v8_str( 6617 v8::Local<v8::String> source = v8_str(
6618 "function f() {\n" 6618 "function f() {\n"
6619 "}\n" 6619 "}\n"
6620 "f();\n" 6620 "f();\n"
6621 "f();"); 6621 "f();");
6622 CompileRun(source); 6622 CompileRun(source);
6623 v8::debug::Coverage coverage = v8::debug::Coverage::Collect(isolate, false); 6623 v8::debug::Coverage coverage = v8::debug::Coverage::Collect(isolate, false);
6624 CHECK_EQ(1u, coverage.ScriptCount()); 6624 CHECK_EQ(1u, coverage.ScriptCount());
6625 v8::debug::Coverage::ScriptData script_data = coverage.GetScriptData(0); 6625 v8::debug::Coverage::ScriptData script_data = coverage.GetScriptData(0);
6626 v8::Local<v8::debug::Script> script = script_data.GetScript(); 6626 v8::Local<v8::debug::Script> script = script_data.GetScript();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
6672 if (builtin->is_promise_rejection() || builtin->is_exception_caught()) 6672 if (builtin->is_promise_rejection() || builtin->is_exception_caught())
6673 continue; 6673 continue;
6674 6674
6675 if (whitelist.find(i) != whitelist.end()) continue; 6675 if (whitelist.find(i) != whitelist.end()) continue;
6676 6676
6677 fail = true; 6677 fail = true;
6678 i::PrintF("%s is missing exception predictions.\n", builtins->name(i)); 6678 i::PrintF("%s is missing exception predictions.\n", builtins->name(i));
6679 } 6679 }
6680 CHECK(!fail); 6680 CHECK(!fail);
6681 } 6681 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698