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

Side by Side 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, 4 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
« runtime/vm/program_visitor.cc ('K') | « runtime/vm/service.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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 6
7 #include "include/dart_tools_api.h" 7 #include "include/dart_tools_api.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/debugger.h" 10 #include "vm/debugger.h"
11 #include "vm/globals.h" 11 #include "vm/globals.h"
12 #include "vm/message_handler.h" 12 #include "vm/message_handler.h"
13 #include "vm/object_id_ring.h" 13 #include "vm/object_id_ring.h"
14 #include "vm/os.h" 14 #include "vm/os.h"
15 #include "vm/port.h" 15 #include "vm/port.h"
16 #include "vm/profiler.h"
16 #include "vm/safepoint.h" 17 #include "vm/safepoint.h"
17 #include "vm/service.h" 18 #include "vm/service.h"
18 #include "vm/unit_test.h" 19 #include "vm/unit_test.h"
19 20
20 namespace dart { 21 namespace dart {
21 22
22 // This flag is used in the Service_Flags test below. 23 // This flag is used in the Service_Flags test below.
23 DEFINE_FLAG(bool, service_testing_flag, false, "Comment"); 24 DEFINE_FLAG(bool, service_testing_flag, false, "Comment");
24 25
25 #ifndef PRODUCT 26 #ifndef PRODUCT
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 HandleIsolateMessage(isolate, service_msg); 720 HandleIsolateMessage(isolate, service_msg);
720 EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage()); 721 EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
721 EXPECT_STREQ("{\"jsonrpc\":\"2.0\", \"error\":beta,\"id\":\"0\"}", 722 EXPECT_STREQ("{\"jsonrpc\":\"2.0\", \"error\":beta,\"id\":\"0\"}",
722 handler.msg()); 723 handler.msg());
723 } 724 }
724 725
725 // TODO(zra): Remove when tests are ready to enable. 726 // TODO(zra): Remove when tests are ready to enable.
726 #if !defined(TARGET_ARCH_ARM64) 727 #if !defined(TARGET_ARCH_ARM64)
727 728
728 TEST_CASE(Service_Profile) { 729 TEST_CASE(Service_Profile) {
730 Profiler::EnsureEnabled();
729 const char* kScript = 731 const char* kScript =
730 "var port;\n" // Set to our mock port by C++. 732 "var port;\n" // Set to our mock port by C++.
731 "\n" 733 "\n"
732 "var x = 7;\n" 734 "var x = 7;\n"
733 "main() {\n" 735 "main() {\n"
734 " x = x * x;\n" 736 " x = x * x;\n"
735 " x = x / 13;\n" 737 " x = x / 13;\n"
736 "}"; 738 "}";
737 739
738 Isolate* isolate = thread->isolate(); 740 Isolate* isolate = thread->isolate();
(...skipping 30 matching lines...) Expand all
769 EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage()); 771 EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
770 // Expect error. 772 // Expect error.
771 EXPECT_SUBSTRING("\"error\"", handler.msg()); 773 EXPECT_SUBSTRING("\"error\"", handler.msg());
772 } 774 }
773 775
774 #endif // !defined(TARGET_ARCH_ARM64) 776 #endif // !defined(TARGET_ARCH_ARM64)
775 777
776 #endif // !PRODUCT 778 #endif // !PRODUCT
777 779
778 } // namespace dart 780 } // namespace dart
OLDNEW
« runtime/vm/program_visitor.cc ('K') | « runtime/vm/service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698