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

Side by Side Diff: tests/standalone/vmservice/isolate_class_field_test.dart

Issue 487023003: vmservice protocol cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js Created 6 years, 3 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_test.cc ('k') | tests/standalone/vmservice/isolate_code_test.dart » ('j') | 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 library isolate_class_list_test; 5 library isolate_class_list_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'test_helper.dart'; 8 import 'test_helper.dart';
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 10
11 class BananaClassTest { 11 class BananaClassTest {
12 int port; 12 int port;
13 String isolate_id; 13 String isolate_id;
14 String class_id; 14 String class_id;
15 BananaClassTest(this.port, this.isolate_id, this.class_id); 15 BananaClassTest(this.port, this.isolate_id, this.class_id);
16 16
17 _testFieldA(Map field) { 17 _testFieldA(Map field) {
18 Expect.equals('Field', field['type']); 18 Expect.equals('Field', field['type']);
19 Expect.equals('a', field['user_name']);
20 Expect.equals('a', field['name']); 19 Expect.equals('a', field['name']);
21 Expect.equals(false, field['final']); 20 Expect.equals(false, field['final']);
22 Expect.equals(false, field['static']); 21 Expect.equals(false, field['static']);
23 Expect.equals(false, field['const']); 22 Expect.equals(false, field['const']);
24 Expect.equals('dynamic', field['guard_class']); 23 Expect.equals('dynamic', field['guard_class']);
25 Expect.equals(true, field['guard_nullable']); 24 Expect.equals(true, field['guard_nullable']);
26 Expect.equals('variable', field['guard_length']); 25 Expect.equals('variable', field['guard_length']);
27 } 26 }
28 27
29 _testFieldFinalFixedLengthList(Map field) { 28 _testFieldFinalFixedLengthList(Map field) {
30 Expect.equals('Field', field['type']); 29 Expect.equals('Field', field['type']);
31 Expect.equals('final_fixed_length_list', field['user_name']);
32 Expect.equals('final_fixed_length_list', field['name']); 30 Expect.equals('final_fixed_length_list', field['name']);
33 Expect.equals('_Float32Array', field['guard_class']['user_name']); 31 Expect.equals('_Float32Array', field['guard_class']['name']);
34 Expect.equals(true, field['final']); 32 Expect.equals(true, field['final']);
35 Expect.equals(false, field['static']); 33 Expect.equals(false, field['static']);
36 Expect.equals(false, field['const']); 34 Expect.equals(false, field['const']);
37 Expect.equals(4, field['guard_length']); 35 Expect.equals(4, field['guard_length']);
38 } 36 }
39 37
40 _testFieldFixedLengthList(Map field) { 38 _testFieldFixedLengthList(Map field) {
41 Expect.equals('Field', field['type']); 39 Expect.equals('Field', field['type']);
42 Expect.equals('fixed_length_list', field['user_name']);
43 Expect.equals('fixed_length_list', field['name']); 40 Expect.equals('fixed_length_list', field['name']);
44 Expect.equals(false, field['final']); 41 Expect.equals(false, field['final']);
45 Expect.equals(false, field['static']); 42 Expect.equals(false, field['static']);
46 Expect.equals(false, field['const']); 43 Expect.equals(false, field['const']);
47 Expect.equals('_Float32Array', field['guard_class']['user_name']); 44 Expect.equals('_Float32Array', field['guard_class']['name']);
48 Expect.equals('variable', field['guard_length']); 45 Expect.equals('variable', field['guard_length']);
49 } 46 }
50 47
51 _testFieldName(Map field) { 48 _testFieldName(Map field) {
52 Expect.equals('Field', field['type']); 49 Expect.equals('Field', field['type']);
53 Expect.equals('name', field['user_name']);
54 Expect.equals('name', field['name']); 50 Expect.equals('name', field['name']);
55 Expect.equals(false, field['final']); 51 Expect.equals(false, field['final']);
56 Expect.equals(false, field['static']); 52 Expect.equals(false, field['static']);
57 Expect.equals(false, field['const']); 53 Expect.equals(false, field['const']);
58 Expect.equals('_OneByteString', field['guard_class']['user_name']); 54 Expect.equals('_OneByteString', field['guard_class']['name']);
59 Expect.equals(false, field['guard_nullable']); 55 Expect.equals(false, field['guard_nullable']);
60 Expect.equals('variable', field['guard_length']); 56 Expect.equals('variable', field['guard_length']);
61 } 57 }
62 58
63 Future makeRequest() { 59 Future makeRequest() {
64 var fields = ['final_fixed_length_list', 'fixed_length_list', 'name', 'a']; 60 var fields = ['final_fixed_length_list', 'fixed_length_list', 'name', 'a'];
65 var helper = 61 var helper =
66 new ClassFieldRequestHelper(port, isolate_id, class_id, fields); 62 new ClassFieldRequestHelper(port, isolate_id, class_id, fields);
67 return helper.makeRequest().then((_) { 63 return helper.makeRequest().then((_) {
68 _testFieldA(helper.fields['a']); 64 _testFieldA(helper.fields['a']);
69 _testFieldFinalFixedLengthList(helper.fields['final_fixed_length_list']); 65 _testFieldFinalFixedLengthList(helper.fields['final_fixed_length_list']);
70 _testFieldFixedLengthList(helper.fields['fixed_length_list']); 66 _testFieldFixedLengthList(helper.fields['fixed_length_list']);
71 _testFieldName(helper.fields['name']); 67 _testFieldName(helper.fields['name']);
72 }); 68 });
73 } 69 }
74 } 70 }
75 71
76 class BadBananaClassTest { 72 class BadBananaClassTest {
77 int port; 73 int port;
78 String isolate_id; 74 String isolate_id;
79 String class_id; 75 String class_id;
80 BadBananaClassTest(this.port, this.isolate_id, this.class_id); 76 BadBananaClassTest(this.port, this.isolate_id, this.class_id);
81 77
82 _testFieldV(Map field) { 78 _testFieldV(Map field) {
83 Expect.equals('Field', field['type']); 79 Expect.equals('Field', field['type']);
84 Expect.equals('v', field['user_name']);
85 Expect.equals('v', field['name']); 80 Expect.equals('v', field['name']);
86 Expect.equals(false, field['final']); 81 Expect.equals(false, field['final']);
87 Expect.equals(false, field['static']); 82 Expect.equals(false, field['static']);
88 Expect.equals(false, field['const']); 83 Expect.equals(false, field['const']);
89 Expect.equals('_Double', field['guard_class']['user_name']); 84 Expect.equals('_Double', field['guard_class']['name']);
90 Expect.equals(true, field['guard_nullable']); 85 Expect.equals(true, field['guard_nullable']);
91 Expect.equals('variable', field['guard_length']); 86 Expect.equals('variable', field['guard_length']);
92 } 87 }
93 88
94 _testFieldC(Map field) { 89 _testFieldC(Map field) {
95 Expect.equals('Field', field['type']); 90 Expect.equals('Field', field['type']);
96 Expect.equals('c', field['user_name']);
97 Expect.equals('c', field['name']); 91 Expect.equals('c', field['name']);
98 Expect.equals(true, field['final']); 92 Expect.equals(true, field['final']);
99 Expect.equals(false, field['static']); 93 Expect.equals(false, field['static']);
100 Expect.equals(true, field['final']); 94 Expect.equals(true, field['final']);
101 Expect.equals('_Smi', field['guard_class']['user_name']); 95 Expect.equals('_Smi', field['guard_class']['name']);
102 Expect.equals(false, field['guard_nullable']); 96 Expect.equals(false, field['guard_nullable']);
103 Expect.equals('variable', field['guard_length']); 97 Expect.equals('variable', field['guard_length']);
104 } 98 }
105 99
106 _testFieldFinalFixedLengthList(Map field) { 100 _testFieldFinalFixedLengthList(Map field) {
107 Expect.equals('Field', field['type']); 101 Expect.equals('Field', field['type']);
108 Expect.equals('final_fixed_length_list', field['user_name']);
109 Expect.equals('final_fixed_length_list', field['name']); 102 Expect.equals('final_fixed_length_list', field['name']);
110 Expect.equals('_Float32Array', field['guard_class']['user_name']); 103 Expect.equals('_Float32Array', field['guard_class']['name']);
111 Expect.equals(true, field['final']); 104 Expect.equals(true, field['final']);
112 Expect.equals(false, field['static']); 105 Expect.equals(false, field['static']);
113 Expect.equals(false, field['const']); 106 Expect.equals(false, field['const']);
114 Expect.equals('variable', field['guard_length']); 107 Expect.equals('variable', field['guard_length']);
115 } 108 }
116 109
117 _testFieldFixedLengthArray(Map field) { 110 _testFieldFixedLengthArray(Map field) {
118 Expect.equals('Field', field['type']); 111 Expect.equals('Field', field['type']);
119 Expect.equals('fixed_length_array', field['user_name']);
120 Expect.equals('fixed_length_array', field['name']); 112 Expect.equals('fixed_length_array', field['name']);
121 Expect.equals('_List', field['guard_class']['user_name']); 113 Expect.equals('_List', field['guard_class']['name']);
122 Expect.equals(true, field['final']); 114 Expect.equals(true, field['final']);
123 Expect.equals(false, field['static']); 115 Expect.equals(false, field['static']);
124 Expect.equals(false, field['const']); 116 Expect.equals(false, field['const']);
125 Expect.equals(3, field['guard_length']); 117 Expect.equals(3, field['guard_length']);
126 } 118 }
127 119
128 Future makeRequest() { 120 Future makeRequest() {
129 var fields = ['final_fixed_length_list', 'fixed_length_array', 'v', 'c']; 121 var fields = ['final_fixed_length_list', 'fixed_length_array', 'v', 'c'];
130 var helper = 122 var helper =
131 new ClassFieldRequestHelper(port, isolate_id, class_id, fields); 123 new ClassFieldRequestHelper(port, isolate_id, class_id, fields);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 new BadBananaClassTest(port, test._isolateId, 171 new BadBananaClassTest(port, test._isolateId,
180 classTableTest.bad_banana_class_id); 172 classTableTest.bad_banana_class_id);
181 Future.wait([bananaClassTest.makeRequest(), 173 Future.wait([bananaClassTest.makeRequest(),
182 badBananaClassTest.makeRequest()]).then((_) { 174 badBananaClassTest.makeRequest()]).then((_) {
183 process.requestExit(); 175 process.requestExit();
184 }); 176 });
185 }); 177 });
186 }); 178 });
187 }); 179 });
188 } 180 }
OLDNEW
« no previous file with comments | « runtime/vm/service_test.cc ('k') | tests/standalone/vmservice/isolate_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698