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 // TODO(zra): Remove when tests are ready to enable. | |
6 #include "platform/globals.h" | 5 #include "platform/globals.h" |
7 #if !defined(TARGET_ARCH_ARM64) | |
8 | 6 |
9 #include "include/dart_debugger_api.h" | 7 #include "include/dart_debugger_api.h" |
10 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
11 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
12 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
13 #include "vm/globals.h" | 11 #include "vm/globals.h" |
14 #include "vm/message_handler.h" | 12 #include "vm/message_handler.h" |
15 #include "vm/object_id_ring.h" | 13 #include "vm/object_id_ring.h" |
16 #include "vm/os.h" | 14 #include "vm/os.h" |
17 #include "vm/port.h" | 15 #include "vm/port.h" |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 EXPECT_STREQ( | 1029 EXPECT_STREQ( |
1032 "{\"type\":\"Script\",\"id\":\"scripts\\/dart%3Atest-lib\"," | 1030 "{\"type\":\"Script\",\"id\":\"scripts\\/dart%3Atest-lib\"," |
1033 "\"name\":\"dart:test-lib\",\"user_name\":\"dart:test-lib\"," | 1031 "\"name\":\"dart:test-lib\",\"user_name\":\"dart:test-lib\"," |
1034 "\"kind\":\"script\"," | 1032 "\"kind\":\"script\"," |
1035 "\"source\":\"var port;\\n\\nmain() {\\n}\"," | 1033 "\"source\":\"var port;\\n\\nmain() {\\n}\"," |
1036 "\"tokenPosTable\":[[1,0,1,1,5,2,9],[3,5,1,6,5,7,6,8,8],[4,10,1]]}", | 1034 "\"tokenPosTable\":[[1,0,1,1,5,2,9],[3,5,1,6,5,7,6,8,8],[4,10,1]]}", |
1037 handler.msg()); | 1035 handler.msg()); |
1038 } | 1036 } |
1039 | 1037 |
1040 | 1038 |
| 1039 // TODO(zra): Remove when tests are ready to enable. |
| 1040 #if !defined(TARGET_ARCH_ARM64) |
| 1041 |
1041 TEST_CASE(Service_Coverage) { | 1042 TEST_CASE(Service_Coverage) { |
1042 const char* kScript = | 1043 const char* kScript = |
1043 "var port;\n" // Set to our mock port by C++. | 1044 "var port;\n" // Set to our mock port by C++. |
1044 "\n" | 1045 "\n" |
1045 "var x = 7;\n" | 1046 "var x = 7;\n" |
1046 "main() {\n" | 1047 "main() {\n" |
1047 " x = x * x;\n" | 1048 " x = x * x;\n" |
1048 " x = x / 13;\n" | 1049 " x = x / 13;\n" |
1049 "}"; | 1050 "}"; |
1050 | 1051 |
(...skipping 18 matching lines...) Expand all Loading... |
1069 Service::HandleIsolateMessage(isolate, service_msg); | 1070 Service::HandleIsolateMessage(isolate, service_msg); |
1070 handler.HandleNextMessage(); | 1071 handler.HandleNextMessage(); |
1071 EXPECT_SUBSTRING( | 1072 EXPECT_SUBSTRING( |
1072 "{\"source\":\"dart:test-lib\",\"script\":{" | 1073 "{\"source\":\"dart:test-lib\",\"script\":{" |
1073 "\"type\":\"@Script\",\"id\":\"scripts\\/dart%3Atest-lib\"," | 1074 "\"type\":\"@Script\",\"id\":\"scripts\\/dart%3Atest-lib\"," |
1074 "\"name\":\"dart:test-lib\",\"user_name\":\"dart:test-lib\"," | 1075 "\"name\":\"dart:test-lib\",\"user_name\":\"dart:test-lib\"," |
1075 "\"kind\":\"script\"},\"hits\":" | 1076 "\"kind\":\"script\"},\"hits\":" |
1076 "[5,1,6,1]}", handler.msg()); | 1077 "[5,1,6,1]}", handler.msg()); |
1077 } | 1078 } |
1078 | 1079 |
| 1080 #endif |
| 1081 |
1079 | 1082 |
1080 TEST_CASE(Service_AllocationProfile) { | 1083 TEST_CASE(Service_AllocationProfile) { |
1081 const char* kScript = | 1084 const char* kScript = |
1082 "var port;\n" // Set to our mock port by C++. | 1085 "var port;\n" // Set to our mock port by C++. |
1083 "\n" | 1086 "\n" |
1084 "var x = 7;\n" | 1087 "var x = 7;\n" |
1085 "main() {\n" | 1088 "main() {\n" |
1086 " x = x * x;\n" | 1089 " x = x * x;\n" |
1087 " x = x / 13;\n" | 1090 " x = x / 13;\n" |
1088 "}"; | 1091 "}"; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 service_msg = Eval(lib, "[port, ['alpha'], [], []]"); | 1317 service_msg = Eval(lib, "[port, ['alpha'], [], []]"); |
1315 Service::HandleIsolateMessage(isolate, service_msg); | 1318 Service::HandleIsolateMessage(isolate, service_msg); |
1316 handler.HandleNextMessage(); | 1319 handler.HandleNextMessage(); |
1317 EXPECT_STREQ("alpha", handler.msg()); | 1320 EXPECT_STREQ("alpha", handler.msg()); |
1318 service_msg = Eval(lib, "[port, ['beta'], [], []]"); | 1321 service_msg = Eval(lib, "[port, ['beta'], [], []]"); |
1319 Service::HandleIsolateMessage(isolate, service_msg); | 1322 Service::HandleIsolateMessage(isolate, service_msg); |
1320 handler.HandleNextMessage(); | 1323 handler.HandleNextMessage(); |
1321 EXPECT_STREQ("beta", handler.msg()); | 1324 EXPECT_STREQ("beta", handler.msg()); |
1322 } | 1325 } |
1323 | 1326 |
| 1327 |
| 1328 // TODO(zra): Remove when tests are ready to enable. |
| 1329 #if !defined(TARGET_ARCH_ARM64) |
| 1330 |
1324 TEST_CASE(Service_Profile) { | 1331 TEST_CASE(Service_Profile) { |
1325 const char* kScript = | 1332 const char* kScript = |
1326 "var port;\n" // Set to our mock port by C++. | 1333 "var port;\n" // Set to our mock port by C++. |
1327 "\n" | 1334 "\n" |
1328 "var x = 7;\n" | 1335 "var x = 7;\n" |
1329 "main() {\n" | 1336 "main() {\n" |
1330 " x = x * x;\n" | 1337 " x = x * x;\n" |
1331 " x = x / 13;\n" | 1338 " x = x / 13;\n" |
1332 "}"; | 1339 "}"; |
1333 | 1340 |
(...skipping 26 matching lines...) Expand all Loading... |
1360 // Expect profile | 1367 // Expect profile |
1361 EXPECT_SUBSTRING("\"type\":\"Profile\"", handler.msg()); | 1368 EXPECT_SUBSTRING("\"type\":\"Profile\"", handler.msg()); |
1362 | 1369 |
1363 service_msg = Eval(h_lib, "[port, ['profile'], ['tags'], ['hidden']]"); | 1370 service_msg = Eval(h_lib, "[port, ['profile'], ['tags'], ['hidden']]"); |
1364 Service::HandleIsolateMessage(isolate, service_msg); | 1371 Service::HandleIsolateMessage(isolate, service_msg); |
1365 handler.HandleNextMessage(); | 1372 handler.HandleNextMessage(); |
1366 // Expect error. | 1373 // Expect error. |
1367 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); | 1374 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); |
1368 } | 1375 } |
1369 | 1376 |
| 1377 #endif // !defined(TARGET_ARCH_ARM64) |
| 1378 |
1370 } // namespace dart | 1379 } // namespace dart |
1371 | |
1372 #endif // !defined(TARGET_ARCH_ARM64) | |
OLD | NEW |