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

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

Issue 2751423005: Run dartfmt on all files under runtime. (Closed)
Patch Set: Run dartfmt on all files under runtime. Created 3 years, 9 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) 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 // VMOptions=--error_on_bad_type --error_on_bad_override 4 // VMOptions=--error_on_bad_type --error_on_bad_override
5 5
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:developer'; 7 import 'dart:developer';
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 'service_test_common.dart'; 10 import 'service_test_common.dart';
(...skipping 12 matching lines...) Expand all
23 void testFunction() { 23 void testFunction() {
24 int i = 0; 24 int i = 0;
25 while (true) { 25 while (true) {
26 if (++i % 100000000 == 0) { 26 if (++i % 100000000 == 0) {
27 MyClass.method(10000); 27 MyClass.method(10000);
28 } 28 }
29 } 29 }
30 } 30 }
31 31
32 var tests = [ 32 var tests = [
33 33 hasStoppedAtBreakpoint,
34 hasStoppedAtBreakpoint,
35 34
36 // Evaluate against library, class, and instance. 35 // Evaluate against library, class, and instance.
37 (Isolate isolate) { 36 (Isolate isolate) {
38 return isolate.getStack().then((ServiceMap stack) { 37 return isolate.getStack().then((ServiceMap stack) {
39 // Make sure we are in the right place. 38 // Make sure we are in the right place.
40 expect(stack.type, equals('Stack')); 39 expect(stack.type, equals('Stack'));
41 expect(stack['frames'].length, greaterThanOrEqualTo(2)); 40 expect(stack['frames'].length, greaterThanOrEqualTo(2));
42 expect(stack['frames'][0].function.name, equals('method')); 41 expect(stack['frames'][0].function.name, equals('method'));
43 expect(stack['frames'][0].function.dartOwner.name, equals('MyClass')); 42 expect(stack['frames'][0].function.dartOwner.name, equals('MyClass'));
44 43
45 var lib = isolate.rootLibrary; 44 var lib = isolate.rootLibrary;
46 var cls = stack['frames'][0].function.dartOwner; 45 var cls = stack['frames'][0].function.dartOwner;
47 var instance = stack['frames'][0].variables[0]['value']; 46 var instance = stack['frames'][0].variables[0]['value'];
48 47
49 List evals = []; 48 List evals = [];
50 evals.add(lib.evaluate('globalVar + 5').then((result) { 49 evals.add(lib.evaluate('globalVar + 5').then((result) {
51 print(result); 50 print(result);
52 expect(result.valueAsString, equals('105')); 51 expect(result.valueAsString, equals('105'));
53 })); 52 }));
54 evals.add(lib.evaluate('globalVar + staticVar + 5').then((result) { 53 evals.add(lib.evaluate('globalVar + staticVar + 5').then((result) {
55 expect(result.type, equals('Error')); 54 expect(result.type, equals('Error'));
56 })); 55 }));
57 evals.add(cls.evaluate('globalVar + staticVar + 5').then((result) { 56 evals.add(cls.evaluate('globalVar + staticVar + 5').then((result) {
58 print(result); 57 print(result);
59 expect(result.valueAsString, equals('1105')); 58 expect(result.valueAsString, equals('1105'));
60 })); 59 }));
61 evals.add(cls.evaluate('this + 5').then((result) { 60 evals.add(cls.evaluate('this + 5').then((result) {
62 expect(result.type, equals('Error')); 61 expect(result.type, equals('Error'));
63 })); 62 }));
64 evals.add(instance.evaluate('this + 5').then((result) { 63 evals.add(instance.evaluate('this + 5').then((result) {
65 print(result); 64 print(result);
66 expect(result.valueAsString, equals('10005')); 65 expect(result.valueAsString, equals('10005'));
67 })); 66 }));
68 evals.add(instance.evaluate('this + frog').then((result) { 67 evals.add(instance.evaluate('this + frog').then((result) {
69 expect(result.type, equals('Error')); 68 expect(result.type, equals('Error'));
70 })); 69 }));
71 return Future.wait(evals); 70 return Future.wait(evals);
72 }); 71 });
73 }, 72 },
74
75 ]; 73 ];
76 74
77 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction); 75 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698