| 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_debugger_api.h" | 7 #include "include/dart_debugger_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" |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 service_msg = Eval(lib, "[0, port, '0', 'alpha', [], []]"); | 499 service_msg = Eval(lib, "[0, port, '0', 'alpha', [], []]"); |
| 500 Service::HandleRootMessage(service_msg); | 500 Service::HandleRootMessage(service_msg); |
| 501 handler.HandleNextMessage(); | 501 handler.HandleNextMessage(); |
| 502 EXPECT_STREQ("{\"result\":alpha, \"id\":\"0\"}", handler.msg()); | 502 EXPECT_STREQ("{\"result\":alpha, \"id\":\"0\"}", handler.msg()); |
| 503 service_msg = Eval(lib, "[0, port, '0', 'beta', [], []]"); | 503 service_msg = Eval(lib, "[0, port, '0', 'beta', [], []]"); |
| 504 Service::HandleRootMessage(service_msg); | 504 Service::HandleRootMessage(service_msg); |
| 505 handler.HandleNextMessage(); | 505 handler.HandleNextMessage(); |
| 506 EXPECT_STREQ("{\"result\":beta, \"id\":\"0\"}", handler.msg()); | 506 EXPECT_STREQ("{\"result\":beta, \"id\":\"0\"}", handler.msg()); |
| 507 } | 507 } |
| 508 | 508 |
| 509 |
| 509 TEST_CASE(Service_EmbedderIsolateHandler) { | 510 TEST_CASE(Service_EmbedderIsolateHandler) { |
| 510 const char* kScript = | 511 const char* kScript = |
| 511 "var port;\n" // Set to our mock port by C++. | 512 "var port;\n" // Set to our mock port by C++. |
| 512 "\n" | 513 "\n" |
| 513 "var x = 7;\n" | 514 "var x = 7;\n" |
| 514 "main() {\n" | 515 "main() {\n" |
| 515 " x = x * x;\n" | 516 " x = x * x;\n" |
| 516 " x = x / 13;\n" | 517 " x = x / 13;\n" |
| 517 "}"; | 518 "}"; |
| 518 | 519 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 536 service_msg = Eval(lib, "[0, port, '0', 'alpha', [], []]"); | 537 service_msg = Eval(lib, "[0, port, '0', 'alpha', [], []]"); |
| 537 Service::HandleIsolateMessage(isolate, service_msg); | 538 Service::HandleIsolateMessage(isolate, service_msg); |
| 538 handler.HandleNextMessage(); | 539 handler.HandleNextMessage(); |
| 539 EXPECT_STREQ("{\"result\":alpha, \"id\":\"0\"}", handler.msg()); | 540 EXPECT_STREQ("{\"result\":alpha, \"id\":\"0\"}", handler.msg()); |
| 540 service_msg = Eval(lib, "[0, port, '0', 'beta', [], []]"); | 541 service_msg = Eval(lib, "[0, port, '0', 'beta', [], []]"); |
| 541 Service::HandleIsolateMessage(isolate, service_msg); | 542 Service::HandleIsolateMessage(isolate, service_msg); |
| 542 handler.HandleNextMessage(); | 543 handler.HandleNextMessage(); |
| 543 EXPECT_STREQ("{\"result\":beta, \"id\":\"0\"}", handler.msg()); | 544 EXPECT_STREQ("{\"result\":beta, \"id\":\"0\"}", handler.msg()); |
| 544 } | 545 } |
| 545 | 546 |
| 546 | |
| 547 // TODO(zra): Remove when tests are ready to enable. | 547 // TODO(zra): Remove when tests are ready to enable. |
| 548 #if !defined(TARGET_ARCH_ARM64) | 548 #if !defined(TARGET_ARCH_ARM64) |
| 549 | 549 |
| 550 TEST_CASE(Service_Profile) { | 550 TEST_CASE(Service_Profile) { |
| 551 const char* kScript = | 551 const char* kScript = |
| 552 "var port;\n" // Set to our mock port by C++. | 552 "var port;\n" // Set to our mock port by C++. |
| 553 "\n" | 553 "\n" |
| 554 "var x = 7;\n" | 554 "var x = 7;\n" |
| 555 "main() {\n" | 555 "main() {\n" |
| 556 " x = x * x;\n" | 556 " x = x * x;\n" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 Eval(lib, "[0, port, '0', 'getCpuProfile', ['tags'], ['Bogus']]"); | 588 Eval(lib, "[0, port, '0', 'getCpuProfile', ['tags'], ['Bogus']]"); |
| 589 Service::HandleIsolateMessage(isolate, service_msg); | 589 Service::HandleIsolateMessage(isolate, service_msg); |
| 590 handler.HandleNextMessage(); | 590 handler.HandleNextMessage(); |
| 591 // Expect error. | 591 // Expect error. |
| 592 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); | 592 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); |
| 593 } | 593 } |
| 594 | 594 |
| 595 #endif // !defined(TARGET_ARCH_ARM64) | 595 #endif // !defined(TARGET_ARCH_ARM64) |
| 596 | 596 |
| 597 } // namespace dart | 597 } // namespace dart |
| OLD | NEW |