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

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

Issue 2962593002: Added Editor stream and sendObjectToEditor RPC into Service Protocol (Closed)
Patch Set: Added explanation comment Created 3 years, 5 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 | « runtime/observatory/observatory_sources.gypi ('k') | runtime/vm/service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4 // VMOptions=--error_on_bad_type --error_on_bad_override
5
6 import 'package:observatory/service_io.dart';
7 import 'package:unittest/unittest.dart';
8 import 'dart:async';
9
10 import 'test_helper.dart';
11
12 class _TestClass {
13 _TestClass(this.x, this.y);
14 var x;
15 var y;
16 }
17
18 var myVar;
19
20 eval(Isolate isolate, String expression) async {
21 // Silence analyzer.
22 new _TestClass(null, null);
23 Map params = {
24 'targetId': isolate.rootLibrary.id,
25 'expression': expression,
26 };
27 return await isolate.invokeRpcNoUpgrade('evaluate', params);
28 }
29
30 var tests = [
31 (Isolate isolate) async {
32 var identifier = 'random string';
33 // One instance of _TestClass retained.
34 var evalResult = await eval(isolate, 'myVar = new _TestClass(null, null)');
35 var params = {
36 'editor': identifier,
37 'objectId': evalResult['class']['id'],
38 };
39
40 var done = new Completer();
41 var stream = await isolate.vm.getEventStream('_Editor');
42
43 stream.listen((ServiceEvent e) {
44 expect(e.kind, equals('_EditorObjectSelected'));
45 expect(e.editor, equals(identifier));
46 expect(e.object, isNotNull);
47 expect(e.object.id, equals(evalResult['class']['id']));
48 done.complete();
49 });
50
51 await isolate.invokeRpcNoUpgrade('_sendObjectToEditor', params);
52
53 await done.future;
54 },
55 ];
56
57 main(args) async => runIsolateTests(args, tests);
OLDNEW
« no previous file with comments | « runtime/observatory/observatory_sources.gypi ('k') | runtime/vm/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698