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

Unified Diff: runtime/vm/service_test.cc

Issue 2989093002: [vm] Don't enable the profiler by default. Enable the profiler at startup with --observe, or later … (Closed)
Patch Set: . Created 3 years, 5 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 | « runtime/vm/service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service_test.cc
diff --git a/runtime/vm/service_test.cc b/runtime/vm/service_test.cc
index 7cef50b1726abbffe333a0568bb30cddbf5cc606..d98b4cc079075958330656772de9c3ae3b050302 100644
--- a/runtime/vm/service_test.cc
+++ b/runtime/vm/service_test.cc
@@ -13,6 +13,7 @@
#include "vm/object_id_ring.h"
#include "vm/os.h"
#include "vm/port.h"
+#include "vm/profiler.h"
#include "vm/safepoint.h"
#include "vm/service.h"
#include "vm/unit_test.h"
@@ -725,7 +726,15 @@ TEST_CASE(Service_EmbedderIsolateHandler) {
// TODO(zra): Remove when tests are ready to enable.
#if !defined(TARGET_ARCH_ARM64)
+static void EnableProfiler() {
+ if (!FLAG_profiler) {
+ FLAG_profiler = true;
+ Profiler::InitOnce();
+ }
+}
+
TEST_CASE(Service_Profile) {
+ EnableProfiler();
const char* kScript =
"var port;\n" // Set to our mock port by C++.
"\n"
« no previous file with comments | « runtime/vm/service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698