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

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

Issue 119673004: Version 1.1.0-dev.5.2 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 11 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
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_test; 5 library isolate_class_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 CodeATest extends VmServiceRequestHelper { 11 class CodeATest extends VmServiceRequestHelper {
12 CodeATest(port, id, codeId) : 12 CodeATest(port, id, codeId) :
13 super('http://127.0.0.1:$port/isolates/$id/objects/$codeId'); 13 super('http://127.0.0.1:$port/$id/$codeId');
14 14
15 onRequestCompleted(Map reply) { 15 onRequestCompleted(Map reply) {
16 Expect.equals('Code', reply['type']); 16 Expect.equals('Code', reply['type']);
17 Expect.equals('a', reply['function']['name']); 17 Expect.equals('a', reply['function']['name']);
18 Expect.isTrue(reply['disassembly'].length > 0); 18 Expect.isTrue(reply['disassembly'].length > 0);
19 } 19 }
20 } 20 }
21 21
22 class CodeCTest extends VmServiceRequestHelper { 22 class CodeCTest extends VmServiceRequestHelper {
23 CodeCTest(port, id, codeId) : 23 CodeCTest(port, id, codeId) :
24 super('http://127.0.0.1:$port/isolates/$id/objects/$codeId'); 24 super('http://127.0.0.1:$port/$id/$codeId');
25 25
26 onRequestCompleted(Map reply) { 26 onRequestCompleted(Map reply) {
27 Expect.equals('Code', reply['type']); 27 Expect.equals('Code', reply['type']);
28 Expect.equals('C.c', reply['function']['user_name']); 28 Expect.equals('C.c', reply['function']['user_name']);
29 Expect.isTrue(reply['disassembly'].length > 0); 29 Expect.isTrue(reply['disassembly'].length > 0);
30 } 30 }
31 } 31 }
32 32
33 class StackTraceTest extends VmServiceRequestHelper { 33 class StackTraceTest extends VmServiceRequestHelper {
34 StackTraceTest(port, id) : 34 StackTraceTest(port, id) :
35 super('http://127.0.0.1:$port/isolates/$id/stacktrace'); 35 super('http://127.0.0.1:$port/$id/stacktrace');
36 36
37 int _aId; 37 String _aId;
38 int _cId; 38 String _cId;
39 onRequestCompleted(Map reply) { 39 onRequestCompleted(Map reply) {
40 Expect.equals('StackTrace', reply['type']); 40 Expect.equals('StackTrace', reply['type']);
41 List members = reply['members']; 41 List members = reply['members'];
42 Expect.equals('a', members[0]['name']); 42 Expect.equals('a', members[0]['name']);
43 _aId = members[0]['code']['id']; 43 _aId = members[0]['code']['id'];
44 Expect.equals('c', members[2]['name']); 44 Expect.equals('c', members[2]['name']);
45 _cId = members[2]['code']['id']; 45 _cId = members[2]['code']['id'];
46 } 46 }
47 } 47 }
48 48
49 class IsolateListTest extends VmServiceRequestHelper { 49 class IsolateListTest extends VmServiceRequestHelper {
50 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates'); 50 IsolateListTest(port) : super('http://127.0.0.1:$port/isolates');
51 51
52 int _isolateId; 52 String _isolateId;
53 onRequestCompleted(Map reply) { 53 onRequestCompleted(Map reply) {
54 IsolateListTester tester = new IsolateListTester(reply); 54 IsolateListTester tester = new IsolateListTester(reply);
55 tester.checkIsolateCount(2); 55 tester.checkIsolateCount(2);
56 tester.checkIsolateNameContains('isolate_stacktrace_command_script.dart'); 56 tester.checkIsolateNameContains('isolate_stacktrace_command_script.dart');
57 _isolateId = tester.checkIsolateNameContains('myIsolateName'); 57 _isolateId = tester.checkIsolateNameContains('myIsolateName');
58 } 58 }
59 } 59 }
60 60
61 main() { 61 main() {
62 var process = new TestLauncher('isolate_stacktrace_command_script.dart'); 62 var process = new TestLauncher('isolate_stacktrace_command_script.dart');
63 process.launch().then((port) { 63 process.launch().then((port) {
64 var test = new IsolateListTest(port); 64 var test = new IsolateListTest(port);
65 test.makeRequest().then((_) { 65 test.makeRequest().then((_) {
66 var stackTraceTest = 66 var stackTraceTest =
67 new StackTraceTest(port, test._isolateId); 67 new StackTraceTest(port, test._isolateId);
68 stackTraceTest.makeRequest().then((_) { 68 stackTraceTest.makeRequest().then((_) {
69 var codeATest = new CodeATest(port, test._isolateId, 69 var codeATest = new CodeATest(port, test._isolateId,
70 stackTraceTest._aId); 70 stackTraceTest._aId);
71 var codeCTest = new CodeCTest(port, test._isolateId, 71 var codeCTest = new CodeCTest(port, test._isolateId,
72 stackTraceTest._cId); 72 stackTraceTest._cId);
73 var requests = Future.wait([codeATest.makeRequest(), 73 var requests = Future.wait([codeATest.makeRequest(),
74 codeCTest.makeRequest()]); 74 codeCTest.makeRequest()]);
75 requests.then((_) { 75 requests.then((_) {
76 process.requestExit(); 76 process.requestExit();
77 }); 77 });
78 }); 78 });
79 }); 79 });
80 }); 80 });
81 } 81 }
OLDNEW
« no previous file with comments | « dart/tests/standalone/vmservice/isolate_class_test.dart ('k') | dart/tests/standalone/vmservice/isolate_echo_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698