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

Unified Diff: runtime/observatory/tests/service/set_library_debuggable_test.dart

Issue 2361183002: Respect setLibraryDebuggable (Closed)
Patch Set: Respect setLibraryDebuggable Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/observatory/tests/service/set_library_debuggable_rpc_test.dart ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/service/set_library_debuggable_test.dart
diff --git a/runtime/observatory/tests/service/set_library_debuggable_test.dart b/runtime/observatory/tests/service/set_library_debuggable_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..d76569c5d1849d64271a25e672ab40e3af1e9ed1
--- /dev/null
+++ b/runtime/observatory/tests/service/set_library_debuggable_test.dart
@@ -0,0 +1,65 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+library set_library_debuggable_test;
+
+import 'dart:developer';
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'service_test_common.dart';
+import 'test_helper.dart';
+
+const LINE_A = 20;
+const LINE_B = 21;
+const LINE_C = 22;
+
+testMain() async {
+ debugger();
+ print('hi'); // LINE_A.
+ print('yep'); // LINE_B.
+ print('zoo'); // LINE_C.
+}
+
+var tests = [
+ (Isolate isolate) async {
+ await isolate.reload();
+ Library dartCore = isolate.libraries.firstWhere(
+ (Library library) => library.uri == 'dart:core');
+ await dartCore.load();
+ expect(dartCore.debuggable, equals(true));
+ },
+ stoppedInFunction('testMain', contains:true),
+ stoppedAtLine(LINE_A),
+ stepInto,
+ stoppedInFunction('print'),
+ stepOut,
+ stoppedInFunction('testMain', contains:true),
+ stoppedAtLine(LINE_B),
+ (Isolate isolate) async {
+ // Mark 'dart:core' as not debuggable.
+ await isolate.reload();
+ Library dartCore = isolate.libraries.firstWhere(
+ (Library library) => library.uri == 'dart:core');
+ await dartCore.load();
+ expect(dartCore.debuggable, equals(true));
+ var setDebugParams = {
+ 'libraryId': dartCore.id,
+ 'isDebuggable': false,
+ };
+ Map<String, dynamic> result =
+ await isolate.invokeRpcNoUpgrade('setLibraryDebuggable',
+ setDebugParams);
+ expect(result['type'], equals('Success'));
+ await dartCore.reload();
+ expect(dartCore.debuggable, equals(false));
+ },
+ stoppedInFunction('testMain', contains:true),
+ stoppedAtLine(LINE_B),
+ stepInto,
+ stoppedInFunction('testMain', contains:true),
+ stoppedAtLine(LINE_C),
+];
+
+main(args) async => runIsolateTests(args, tests, testeeConcurrent: testMain);
« no previous file with comments | « runtime/observatory/tests/service/set_library_debuggable_rpc_test.dart ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698