OLD | NEW |
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 | 4 |
5 library service_test_common; | 5 library service_test_common; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io' show Platform; | 8 import 'dart:io' show Platform; |
9 import 'package:observatory/models.dart' as M; | 9 import 'package:observatory/models.dart' as M; |
10 import 'package:observatory/service_common.dart'; | 10 import 'package:observatory/service_common.dart'; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 Breakpoint syntheticBreakpoint; | 97 Breakpoint syntheticBreakpoint; |
98 | 98 |
99 subscription = stream.listen((ServiceEvent event) async { | 99 subscription = stream.listen((ServiceEvent event) async { |
100 // Synthetic breakpoint add event. This is the first event we will | 100 // Synthetic breakpoint add event. This is the first event we will |
101 // receive. | 101 // receive. |
102 bool isAdd = (event.kind == ServiceEvent.kBreakpointAdded) && | 102 bool isAdd = (event.kind == ServiceEvent.kBreakpointAdded) && |
103 (event.breakpoint.isSyntheticAsyncContinuation) && | 103 (event.breakpoint.isSyntheticAsyncContinuation) && |
104 (event.owner == isolate); | 104 (event.owner == isolate); |
105 // Resume after synthetic breakpoint added. This is the second event | 105 // Resume after synthetic breakpoint added. This is the second event |
106 // we will recieve. | 106 // we will receive. |
107 bool isResume = (event.kind == ServiceEvent.kResume) && | 107 bool isResume = (event.kind == ServiceEvent.kResume) && |
108 (syntheticBreakpoint != null) && | 108 (syntheticBreakpoint != null) && |
109 (event.owner == isolate); | 109 (event.owner == isolate); |
110 // Paused at synthetic breakpoint. This is the third event we will | 110 // Paused at synthetic breakpoint. This is the third event we will |
111 // receive. | 111 // receive. |
112 bool isPaused = (event.kind == ServiceEvent.kPauseBreakpoint) && | 112 bool isPaused = (event.kind == ServiceEvent.kPauseBreakpoint) && |
113 (syntheticBreakpoint != null) && | 113 (syntheticBreakpoint != null) && |
114 (event.breakpoint == syntheticBreakpoint); | 114 (event.breakpoint == syntheticBreakpoint); |
115 if (isAdd) { | 115 if (isAdd) { |
116 syntheticBreakpoint = event.breakpoint; | 116 syntheticBreakpoint = event.breakpoint; |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 if (!isKernel()) { | 525 if (!isKernel()) { |
526 nonKernelFunction(); | 526 nonKernelFunction(); |
527 } | 527 } |
528 } | 528 } |
529 | 529 |
530 void kernelExecute(Function kernelFunction) { | 530 void kernelExecute(Function kernelFunction) { |
531 if (isKernel()) { | 531 if (isKernel()) { |
532 kernelFunction(); | 532 kernelFunction(); |
533 } | 533 } |
534 } | 534 } |
OLD | NEW |