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

Side by Side Diff: runtime/vm/service_test.cc

Issue 887413003: Port type arguments to new RPC protocol (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/service/service.idl ('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_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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 service_msg = EvalF(lib, "[0, port, ['classes', '%" Pd "', 'types', '42']," 933 service_msg = EvalF(lib, "[0, port, ['classes', '%" Pd "', 'types', '42'],"
934 "[], []]", cid); 934 "[], []]", cid);
935 Service::HandleIsolateMessage(isolate, service_msg); 935 Service::HandleIsolateMessage(isolate, service_msg);
936 handler.HandleNextMessage(); 936 handler.HandleNextMessage();
937 ExpectSubstringF(handler.msg(), 937 ExpectSubstringF(handler.msg(),
938 "{\"type\":\"Error\"," 938 "{\"type\":\"Error\","
939 "\"message\":\"Canonical type 42 not found\"" 939 "\"message\":\"Canonical type 42 not found\""
940 ",\"request\":" 940 ",\"request\":"
941 "{\"arguments\":[\"classes\",\"%" Pd "\",\"types\",\"42\"]," 941 "{\"arguments\":[\"classes\",\"%" Pd "\",\"types\",\"42\"],"
942 "\"option_keys\":[],\"option_values\":[]}}", cid); 942 "\"option_keys\":[],\"option_values\":[]}}", cid);
943
944 // Request canonical type arguments. Expect <A<bool>> to be listed.
945 service_msg = EvalF(lib, "[0, port, ['typearguments'],"
946 "[], []]");
947 Service::HandleIsolateMessage(isolate, service_msg);
948 handler.HandleNextMessage();
949 EXPECT_SUBSTRING("\"type\":\"TypeArgumentsList\"", handler.msg());
950 ExpectSubstringF(handler.msg(), "\"name\":\"<A<bool>>\",");
951
952 // Request canonical type arguments with instantiations.
953 service_msg = EvalF(lib,
954 "[0, port, ['typearguments', 'withinstantiations'],"
955 "[], []]");
956 Service::HandleIsolateMessage(isolate, service_msg);
957 handler.HandleNextMessage();
958 EXPECT_SUBSTRING("\"type\":\"TypeArgumentsList\"", handler.msg());
959 } 943 }
960 944
961 945
962 TEST_CASE(Service_Code) { 946 TEST_CASE(Service_Code) {
963 const char* kScript = 947 const char* kScript =
964 "var port;\n" // Set to our mock port by C++. 948 "var port;\n" // Set to our mock port by C++.
965 "\n" 949 "\n"
966 "class A {\n" 950 "class A {\n"
967 " var a;\n" 951 " var a;\n"
968 " dynamic b() {}\n" 952 " dynamic b() {}\n"
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 Eval(lib, "[0, port, 'getCpuProfile', ['tags'], ['Bogus']]"); 1656 Eval(lib, "[0, port, 'getCpuProfile', ['tags'], ['Bogus']]");
1673 Service::HandleIsolateMessage(isolate, service_msg); 1657 Service::HandleIsolateMessage(isolate, service_msg);
1674 handler.HandleNextMessage(); 1658 handler.HandleNextMessage();
1675 // Expect error. 1659 // Expect error.
1676 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); 1660 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
1677 } 1661 }
1678 1662
1679 #endif // !defined(TARGET_ARCH_ARM64) 1663 #endif // !defined(TARGET_ARCH_ARM64)
1680 1664
1681 } // namespace dart 1665 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/service/service.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698