| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "include/dart_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_api_message.h" | 10 #include "vm/dart_api_message.h" |
| (...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1461 } | 1461 } |
| 1462 Dart_ExitScope(); | 1462 Dart_ExitScope(); |
| 1463 Dart_ShutdownIsolate(); | 1463 Dart_ShutdownIsolate(); |
| 1464 } | 1464 } |
| 1465 | 1465 |
| 1466 | 1466 |
| 1467 UNIT_TEST_CASE(PostCObject) { | 1467 UNIT_TEST_CASE(PostCObject) { |
| 1468 // Create a native port for posting from C to Dart | 1468 // Create a native port for posting from C to Dart |
| 1469 TestIsolateScope __test_isolate__; | 1469 TestIsolateScope __test_isolate__; |
| 1470 const char* kScriptChars = | 1470 const char* kScriptChars = |
| 1471 "#import('dart:isolate');\n" |
| 1471 "void main() {\n" | 1472 "void main() {\n" |
| 1472 " var messageCount = 0;\n" | 1473 " var messageCount = 0;\n" |
| 1473 " var exception = '';\n" | 1474 " var exception = '';\n" |
| 1474 " var port = new ReceivePort();\n" | 1475 " var port = new ReceivePort();\n" |
| 1475 " port.receive((message, replyTo) {\n" | 1476 " port.receive((message, replyTo) {\n" |
| 1476 " if (messageCount < 7) {\n" | 1477 " if (messageCount < 7) {\n" |
| 1477 " exception += message.toString();\n" | 1478 " exception += message.toString();\n" |
| 1478 " } else {\n" | 1479 " } else {\n" |
| 1479 " exception += message.length;\n" | 1480 " exception += message.length;\n" |
| 1480 " for (int i = 0; i < message.length; i++) {\n" | 1481 " for (int i = 0; i < message.length; i++) {\n" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1558 EXPECT(Dart_ErrorHasException(result)); | 1559 EXPECT(Dart_ErrorHasException(result)); |
| 1559 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", | 1560 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", |
| 1560 Dart_GetError(result)); | 1561 Dart_GetError(result)); |
| 1561 | 1562 |
| 1562 Dart_ExitScope(); | 1563 Dart_ExitScope(); |
| 1563 } | 1564 } |
| 1564 | 1565 |
| 1565 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 1566 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 1566 | 1567 |
| 1567 } // namespace dart | 1568 } // namespace dart |
| OLD | NEW |