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

Side by Side Diff: pkg/analyzer_plugin/test/src/channel/isolate_channel_test.dart

Issue 2676633003: Add server-side communications channel (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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:isolate'; 6 import 'dart:isolate';
7 7
8 import 'package:analyzer_plugin/protocol/generated_protocol.dart'; 8 import 'package:analyzer_plugin/protocol/generated_protocol.dart';
9 import 'package:analyzer_plugin/protocol/protocol.dart'; 9 import 'package:analyzer_plugin/protocol/protocol.dart';
10 import 'package:analyzer_plugin/src/channel/isolate_channel.dart'; 10 import 'package:analyzer_plugin/src/channel/isolate_channel.dart';
11 import 'package:test/test.dart'; 11 import 'package:test/test.dart';
12 import 'package:test_reflective_loader/test_reflective_loader.dart'; 12 import 'package:test_reflective_loader/test_reflective_loader.dart';
13 13
14 void main() { 14 void main() {
15 defineReflectiveTests(IsolateChannelTest); 15 defineReflectiveTests(PluginIsolateChannelTest);
16 } 16 }
17 17
18 @reflectiveTest 18 @reflectiveTest
19 class IsolateChannelTest { 19 class PluginIsolateChannelTest {
20 TestSendPort sendPort; 20 TestSendPort sendPort;
21 IsolateChannel channel; 21 PluginIsolateChannel channel;
22 22
23 void setUp() { 23 void setUp() {
24 sendPort = new TestSendPort(); 24 sendPort = new TestSendPort();
25 channel = new IsolateChannel(sendPort); 25 channel = new PluginIsolateChannel(sendPort);
26 } 26 }
27 27
28 void tearDown() { 28 void tearDown() {
29 // If the test doesn't listen to the channel, then close will not cancel the 29 // If the test doesn't listen to the channel, then close will not cancel the
30 // subscription and the process will not terminate. 30 // subscription and the process will not terminate.
31 try { 31 try {
32 channel.listen((request) {}); 32 channel.listen((request) {});
33 } catch (exception) { 33 } catch (exception) {
34 // Ignore the exception if the test has already registered a listener. 34 // Ignore the exception if the test has already registered a listener.
35 } 35 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 if (message is SendPort) { 110 if (message is SendPort) {
111 receivePort = message; 111 receivePort = message;
112 } else { 112 } else {
113 fail('Did not receive a receive port as the first communication.'); 113 fail('Did not receive a receive port as the first communication.');
114 } 114 }
115 } else { 115 } else {
116 sentMessages.add(message); 116 sentMessages.add(message);
117 } 117 }
118 } 118 }
119 } 119 }
OLDNEW
« pkg/analyzer_plugin/lib/channel/channel.dart ('K') | « pkg/analyzer_plugin/lib/src/driver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698