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

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

Issue 2752753002: Additional service tests (Closed)
Patch Set: Formatted some tests 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 library set_library_debuggable_test; 6 library set_library_debuggable_test;
7 7
8 import 'dart:developer'; 8 import 'dart:developer';
9 import 'package:observatory/service_io.dart'; 9 import 'package:observatory/service_io.dart';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 14 matching lines...) Expand all
25 var tests = [ 25 var tests = [
26 hasStoppedAtBreakpoint, 26 hasStoppedAtBreakpoint,
27 markDartColonLibrariesDebuggable, 27 markDartColonLibrariesDebuggable,
28 (Isolate isolate) async { 28 (Isolate isolate) async {
29 await isolate.reload(); 29 await isolate.reload();
30 Library dartCore = isolate.libraries.firstWhere( 30 Library dartCore = isolate.libraries.firstWhere(
31 (Library library) => library.uri == 'dart:core'); 31 (Library library) => library.uri == 'dart:core');
32 await dartCore.reload(); 32 await dartCore.reload();
33 expect(dartCore.debuggable, equals(true)); 33 expect(dartCore.debuggable, equals(true));
34 }, 34 },
35 stoppedInFunction('testMain', contains:true), 35 stoppedInFunction('testMain', contains:true, includeOwner: true),
36 stoppedAtLine(LINE_A), 36 stoppedAtLine(LINE_A),
37 stepInto, 37 stepInto,
38 stoppedInFunction('print'), 38 stoppedInFunction('print'),
39 stepOut, 39 stepOut,
40 stoppedInFunction('testMain', contains:true), 40 stoppedInFunction('testMain', contains:true, includeOwner: true),
41 stoppedAtLine(LINE_B), 41 stoppedAtLine(LINE_B),
42 (Isolate isolate) async { 42 (Isolate isolate) async {
43 // Mark 'dart:core' as not debuggable. 43 // Mark 'dart:core' as not debuggable.
44 await isolate.reload(); 44 await isolate.reload();
45 Library dartCore = isolate.libraries.firstWhere( 45 Library dartCore = isolate.libraries.firstWhere(
46 (Library library) => library.uri == 'dart:core'); 46 (Library library) => library.uri == 'dart:core');
47 await dartCore.load(); 47 await dartCore.load();
48 expect(dartCore.debuggable, equals(true)); 48 expect(dartCore.debuggable, equals(true));
49 var setDebugParams = { 49 var setDebugParams = {
50 'libraryId': dartCore.id, 50 'libraryId': dartCore.id,
51 'isDebuggable': false, 51 'isDebuggable': false,
52 }; 52 };
53 Map<String, dynamic> result = 53 Map<String, dynamic> result =
54 await isolate.invokeRpcNoUpgrade('setLibraryDebuggable', 54 await isolate.invokeRpcNoUpgrade('setLibraryDebuggable',
55 setDebugParams); 55 setDebugParams);
56 expect(result['type'], equals('Success')); 56 expect(result['type'], equals('Success'));
57 await dartCore.reload(); 57 await dartCore.reload();
58 expect(dartCore.debuggable, equals(false)); 58 expect(dartCore.debuggable, equals(false));
59 }, 59 },
60 stoppedInFunction('testMain', contains:true), 60 stoppedInFunction('testMain', contains:true, includeOwner: true),
61 stoppedAtLine(LINE_B), 61 stoppedAtLine(LINE_B),
62 stepInto, 62 stepInto,
63 stoppedInFunction('testMain', contains:true), 63 stoppedInFunction('testMain', contains:true, includeOwner: true),
64 stoppedAtLine(LINE_C), 64 stoppedAtLine(LINE_C),
65 ]; 65 ];
66 66
67 main(args) async => runIsolateTests(args, tests, testeeConcurrent: testMain); 67 main(args) async => runIsolateTests(args, tests, testeeConcurrent: testMain);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698