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

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

Issue 2762583003: Revert "Run dartfmt on all files under runtime." (Closed)
Patch Set: 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) 2016, the Dart project authors. Please see the AUTHORS file 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 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:developer'; 6 import 'dart:developer';
7 import 'package:observatory/service_io.dart'; 7 import 'package:observatory/service_io.dart';
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 import 'service_test_common.dart'; 9 import 'service_test_common.dart';
10 import 'test_helper.dart'; 10 import 'test_helper.dart';
(...skipping 14 matching lines...) Expand all
25 try { 25 try {
26 for (int i = 0; i < x; i++) { 26 for (int i = 0; i < x; i++) {
27 sum += x; 27 sum += x;
28 } 28 }
29 } catch (e) { 29 } catch (e) {
30 print("caught $e"); 30 print("caught $e");
31 } 31 }
32 if (global >= 100) { 32 if (global >= 100) {
33 debugger(); 33 debugger();
34 } 34 }
35 global = global + 1; // Line A 35 global = global + 1; // Line A
36 return sum; 36 return sum;
37 } 37 }
38 38
39 @alwaysInline 39 @alwaysInline
40 b2(x) => b3(x); // Line B 40 b2(x) => b3(x); // Line B
41 41
42 @alwaysInline 42 @alwaysInline
43 b1(x) => b2(x); // Line C 43 b1(x) => b2(x); // Line C
44 44
45 test() { 45 test() {
46 while (true) { 46 while (true) {
47 b1(10000); // Line D 47 b1(10000); // Line D
48 } 48 }
49 } 49 }
50 50
51 var tests = [ 51 var tests = [
52 hasStoppedAtBreakpoint, 52 hasStoppedAtBreakpoint,
53 stoppedAtLine(LINE_A), 53 stoppedAtLine(LINE_A),
54
54 (Isolate isolate) async { 55 (Isolate isolate) async {
55 // We are at our breakpoint with global=100. 56 // We are at our breakpoint with global=100.
56 var result = await isolate.rootLibrary.evaluate('global'); 57 var result = await isolate.rootLibrary.evaluate('global');
57 print('global is $result'); 58 print('global is $result');
58 expect(result.type, equals('Instance')); 59 expect(result.type, equals('Instance'));
59 expect(result.valueAsString, equals('100')); 60 expect(result.valueAsString, equals('100'));
60 61
61 // Rewind the top stack frame. 62 // Rewind the top stack frame.
62 bool caughtException; 63 bool caughtException;
63 try { 64 try {
64 result = await isolate.rewind(1); 65 result = await isolate.rewind(1);
65 expect(false, isTrue, reason: 'Unreachable'); 66 expect(false, isTrue, reason:'Unreachable');
66 } on ServerRpcException catch (e) { 67 } on ServerRpcException catch(e) {
67 caughtException = true; 68 caughtException = true;
68 expect(e.code, equals(ServerRpcException.kCannotResume)); 69 expect(e.code, equals(ServerRpcException.kCannotResume));
69 expect( 70 expect(e.message,
70 e.message, 71 startsWith('Cannot rewind to frame 1 due to conflicting compiler '
71 startsWith('Cannot rewind to frame 1 due to conflicting compiler ' 72 'optimizations. Run the vm with --no-prune-dead-locals '
72 'optimizations. Run the vm with --no-prune-dead-locals ' 73 'to disallow these optimizations. Next valid rewind '
73 'to disallow these optimizations. Next valid rewind ' 74 'frame is '));
74 'frame is '));
75 } 75 }
76 expect(caughtException, isTrue); 76 expect(caughtException, isTrue);
77 }, 77 },
78 ]; 78 ];
79 79
80 main(args) => runIsolateTests(args, tests, testeeConcurrent: test, extraArgs: [ 80
81 '--trace-rewind', 81 main(args) => runIsolateTests(args, tests, testeeConcurrent: test,
82 '--prune-dead-locals', 82 extraArgs:
83 '--enable-inlining-annotations', 83 ['--trace-rewind',
84 '--no-background-compilation', 84 '--prune-dead-locals',
85 '--optimization-counter-threshold=10' 85 '--enable-inlining-annotations',
86 ]); 86 '--no-background-compilation',
87 '--optimization-counter-threshold=10']);
OLDNEW
« no previous file with comments | « runtime/observatory/tests/service/reload_sources_test.dart ('k') | runtime/observatory/tests/service/rewind_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698