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

Side by Side Diff: runtime/observatory/tests/service/tcp_socket_service_test.dart

Issue 1565403003: Print the data we get back from the tcp socket meta data service (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:io' as io; 7 import 'dart:io' as io;
8 import 'package:observatory/service_io.dart'; 8 import 'package:observatory/service_io.dart';
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 import 'test_helper.dart'; 10 import 'test_helper.dart';
(...skipping 18 matching lines...) Expand all
29 29
30 var tcpTests = [ 30 var tcpTests = [
31 // Initial. 31 // Initial.
32 (Isolate isolate) async { 32 (Isolate isolate) async {
33 var result = await isolate.invokeRpcNoUpgrade('__getOpenSockets', {}); 33 var result = await isolate.invokeRpcNoUpgrade('__getOpenSockets', {});
34 expect(result['type'], equals('_opensockets')); 34 expect(result['type'], equals('_opensockets'));
35 // We expect 3 sockets to be open (in this order): 35 // We expect 3 sockets to be open (in this order):
36 // The server socket accepting connections, on port X 36 // The server socket accepting connections, on port X
37 // The accepted connection on the client, on port Y 37 // The accepted connection on the client, on port Y
38 // The client connection, on port X 38 // The client connection, on port X
39 if (result['data'].length != 5) {
40 print(result['data']);
41 }
39 expect(result['data'].length, equals(5)); 42 expect(result['data'].length, equals(5));
40 // The first socket will have a name like listening:127.0.0.1:X 43 // The first socket will have a name like listening:127.0.0.1:X
41 // The second will have a name like 127.0.0.1:Y 44 // The second will have a name like 127.0.0.1:Y
42 // The third will have a name like 127.0.0.1:X 45 // The third will have a name like 127.0.0.1:X
43 expect(result['data'][0]['name'].startsWith('listening:127.0.0.1'), isTrue); 46 expect(result['data'][0]['name'].startsWith('listening:127.0.0.1'), isTrue);
44 expect(result['data'][1]['name'].startsWith('127.0.0.1:'), isTrue); 47 expect(result['data'][1]['name'].startsWith('127.0.0.1:'), isTrue);
45 expect(result['data'][2]['name'].startsWith('127.0.0.1:'), isTrue); 48 expect(result['data'][2]['name'].startsWith('127.0.0.1:'), isTrue);
46 49
47 var listening = await isolate.invokeRpcNoUpgrade( 50 var listening = await isolate.invokeRpcNoUpgrade(
48 '__getSocketByID', { 'id' : result['data'][0]['id'] }); 51 '__getSocketByID', { 'id' : result['data'][0]['id'] });
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 // Stopwatch resolution on windows make us sometimes report the same value. 160 // Stopwatch resolution on windows make us sometimes report the same value.
158 if (io.Platform.isWindows) { 161 if (io.Platform.isWindows) {
159 expect(server['lastRead'], greaterThanOrEqualTo(client['lastWrite'])); 162 expect(server['lastRead'], greaterThanOrEqualTo(client['lastWrite']));
160 } else { 163 } else {
161 expect(server['lastRead'], greaterThan(client['lastWrite'])); 164 expect(server['lastRead'], greaterThan(client['lastWrite']));
162 } 165 }
163 }, 166 },
164 ]; 167 ];
165 168
166 main(args) async => runIsolateTests(args, tcpTests, testeeBefore:setupTCP); 169 main(args) async => runIsolateTests(args, tcpTests, testeeBefore:setupTCP);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698