OLD | NEW |
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/service.h" | 16 #include "vm/service.h" |
17 #include "vm/unit_test.h" | 17 #include "vm/unit_test.h" |
18 | 18 |
19 namespace dart { | 19 namespace dart { |
20 | 20 |
21 // This flag is used in the Service_Flags test below. | 21 // This flag is used in the Service_Flags test below. |
22 DEFINE_FLAG(bool, service_testing_flag, false, "Comment"); | 22 DEFINE_FLAG(bool, service_testing_flag, false, "Comment"); |
23 | 23 |
| 24 #ifndef PRODUCT |
| 25 |
24 class ServiceTestMessageHandler : public MessageHandler { | 26 class ServiceTestMessageHandler : public MessageHandler { |
25 public: | 27 public: |
26 ServiceTestMessageHandler() : _msg(NULL) {} | 28 ServiceTestMessageHandler() : _msg(NULL) {} |
27 | 29 |
28 ~ServiceTestMessageHandler() { | 30 ~ServiceTestMessageHandler() { |
29 free(_msg); | 31 free(_msg); |
30 } | 32 } |
31 | 33 |
32 MessageStatus HandleMessage(Message* message) { | 34 MessageStatus HandleMessage(Message* message) { |
33 if (_msg != NULL) { | 35 if (_msg != NULL) { |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 service_msg = | 639 service_msg = |
638 Eval(lib, "[0, port, '0', '_getCpuProfile', ['tags'], ['Bogus']]"); | 640 Eval(lib, "[0, port, '0', '_getCpuProfile', ['tags'], ['Bogus']]"); |
639 Service::HandleIsolateMessage(isolate, service_msg); | 641 Service::HandleIsolateMessage(isolate, service_msg); |
640 EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage()); | 642 EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage()); |
641 // Expect error. | 643 // Expect error. |
642 EXPECT_SUBSTRING("\"error\"", handler.msg()); | 644 EXPECT_SUBSTRING("\"error\"", handler.msg()); |
643 } | 645 } |
644 | 646 |
645 #endif // !defined(TARGET_ARCH_ARM64) | 647 #endif // !defined(TARGET_ARCH_ARM64) |
646 | 648 |
| 649 #endif // !PRODUCT |
| 650 |
647 } // namespace dart | 651 } // namespace dart |
OLD | NEW |