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

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

Issue 2237953002: Fail gracefully when attempting to evaluate against a VM internal class such a Field. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 years, 4 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 | runtime/vm/object.cc » ('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) 2016, 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
5 import 'dart:async';
6 import 'dart:developer';
7 import 'package:observatory/service_io.dart';
8 import 'package:unittest/unittest.dart';
9 import 'service_test_common.dart';
10 import 'test_helper.dart';
11
12 var tests = [
13
14 (Isolate isolate) async {
15 Library root = await isolate.rootLibrary.load();
16
17 Class classLibrary = await root.clazz.load();
18 print(classLibrary);
19 var result = await classLibrary.evaluate('3 + 4');
20 print(result);
21 expect(result is DartError, isTrue);
22 expect(result.message, contains('Cannot evaluate'));
23
24 Class classClass = await classLibrary.clazz.load();
25 print(classClass);
26 result = await classClass.evaluate('3 + 4');
27 print(result);
28 expect(result is DartError, isTrue);
29 expect(result.message, contains('Cannot evaluate'));
30
31 var someArray = await root.evaluate("new List(2)");
32 print(someArray);
33 expect(someArray is Instance, isTrue);
34 Class classArray = await someArray.clazz.load();
35 print(classArray);
36 result = await classArray.evaluate('3 + 4');
37 print(result);
38 expect(result is Instance, isTrue);
39 expect(result.valueAsString, equals('7'));
40 },
41
42 ];
43
44 main(args) => runIsolateTests(args, tests);
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698