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

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

Issue 2759973004: Fix observatory tests broken by running dartfmt. Temporarily reverted formatting for evaluate_activ… (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 side-by-side diff with in-line comments
Download patch
Index: runtime/observatory/tests/service/debugger_location_second_test.dart
diff --git a/runtime/observatory/tests/service/debugger_location_second_test.dart b/runtime/observatory/tests/service/debugger_location_second_test.dart
index b2463ab0c05b9a739844bd366bc7649e013aca2c..48ac9169998df9cedb1a14697016b9eed179cb04 100644
--- a/runtime/observatory/tests/service/debugger_location_second_test.dart
+++ b/runtime/observatory/tests/service/debugger_location_second_test.dart
@@ -19,7 +19,7 @@ void testFunction() {
int i = 0;
while (i == 0) {
debugger();
- print('loop'); // Line A.
+ print('loop'); // Line A.
print('loop');
}
}
@@ -33,8 +33,7 @@ class TestDebugger extends Debugger {
int currentFrame = 0;
}
-void debugger_location_dummy_function() {
-}
+void debugger_location_dummy_function() {}
class DebuggerLocationTestFoo {
DebuggerLocationTestFoo(this.field);
@@ -46,8 +45,7 @@ class DebuggerLocationTestFoo {
int field;
}
-class DebuggerLocationTestBar {
-}
+class DebuggerLocationTestBar {}
Future<Debugger> initDebugger(Isolate isolate) {
return isolate.getStack().then((stack) {
@@ -56,154 +54,156 @@ Future<Debugger> initDebugger(Isolate isolate) {
}
var tests = [
-
-hasStoppedAtBreakpoint,
+ hasStoppedAtBreakpoint,
// Load the isolate's libraries
-(Isolate isolate) async {
- for (var lib in isolate.libraries) {
- await lib.load();
- }
-},
+ (Isolate isolate) async {
+ for (var lib in isolate.libraries) {
+ await lib.load();
+ }
+ },
// Parse method
-(Isolate isolate) async {
- var debugger = await initDebugger(isolate);
- var loc =
- await DebuggerLocation.parse(debugger, 'DebuggerLocationTestFoo.method');
- expect(loc.valid, isTrue);
- expect(loc.toString(), equals('DebuggerLocationTestFoo.method'));
-},
+ (Isolate isolate) async {
+ var debugger = await initDebugger(isolate);
+ var loc = await DebuggerLocation.parse(
+ debugger, 'DebuggerLocationTestFoo.method');
+ expect(loc.valid, isTrue);
+ expect(loc.toString(), equals('DebuggerLocationTestFoo.method'));
+ },
// Parse method
-(Isolate isolate) async {
- var debugger = await initDebugger(isolate);
- var loc =
- await DebuggerLocation.parse(debugger, 'DebuggerLocationTestFoo.field=');
- expect(loc.valid, isTrue);
- expect(loc.toString(), equals('DebuggerLocationTestFoo.field='));
-},
+ (Isolate isolate) async {
+ var debugger = await initDebugger(isolate);
+ var loc = await DebuggerLocation.parse(
+ debugger, 'DebuggerLocationTestFoo.field=');
+ expect(loc.valid, isTrue);
+ expect(loc.toString(), equals('DebuggerLocationTestFoo.field='));
+ },
// Parse bad method
-(Isolate isolate) async {
- var debugger = await initDebugger(isolate);
- var loc =
- await DebuggerLocation.parse(debugger, 'DebuggerLocationTestFoo.missing');
- expect(loc.valid, isFalse);
- expect(loc.toString(), equals(
- 'invalid source location '
- '(Function \'DebuggerLocationTestFoo.missing\' not found)'));
-},
+ (Isolate isolate) async {
+ var debugger = await initDebugger(isolate);
+ var loc = await DebuggerLocation.parse(
+ debugger, 'DebuggerLocationTestFoo.missing');
+ expect(loc.valid, isFalse);
+ expect(
+ loc.toString(),
+ equals('invalid source location '
+ '(Function \'DebuggerLocationTestFoo.missing\' not found)'));
+ },
// Complete function + script
-(Isolate isolate) async {
- var debugger = await initDebugger(isolate);
- var completions = await DebuggerLocation.complete(debugger, 'debugger_loc');
- expect(completions.toString(), equals(
- '[debugger_location_dummy_function,'
- ' debugger_location.dart:,'
- ' debugger_location_second_test.dart:]'));
-},
+ (Isolate isolate) async {
+ var debugger = await initDebugger(isolate);
+ var completions = await DebuggerLocation.complete(debugger, 'debugger_loc');
+ expect(
+ completions.toString(),
+ equals('[debugger_location_dummy_function,'
+ ' debugger_location.dart:,'
+ ' debugger_location_second_test.dart:]'));
+ },
// Complete class
-(Isolate isolate) async {
- var debugger = await initDebugger(isolate);
- var completions =
- await DebuggerLocation.complete(debugger, 'DebuggerLocationTe');
- expect(completions.toString(), equals(
- '[DebuggerLocationTestBar,'
- ' DebuggerLocationTestFoo]'));
-},
+ (Isolate isolate) async {
+ var debugger = await initDebugger(isolate);
+ var completions =
+ await DebuggerLocation.complete(debugger, 'DebuggerLocationTe');
+ expect(
+ completions.toString(),
+ equals('[DebuggerLocationTestBar,'
+ ' DebuggerLocationTestFoo]'));
+ },
// No completions: unqualified name
-(Isolate isolate) async {
- var debugger = await initDebugger(isolate);
- var completions =
- await DebuggerLocation.complete(debugger, 'debugger_locXYZZY');
- expect(completions.toString(), equals('[]'));
-},
+ (Isolate isolate) async {
+ var debugger = await initDebugger(isolate);
+ var completions =
+ await DebuggerLocation.complete(debugger, 'debugger_locXYZZY');
+ expect(completions.toString(), equals('[]'));
+ },
// Complete method
-(Isolate isolate) async {
- var debugger = await initDebugger(isolate);
- var completions =
- await DebuggerLocation.complete(debugger, 'DebuggerLocationTestFoo.m');
- expect(completions.toString(), equals(
- '[DebuggerLocationTestFoo.madness,'
- ' DebuggerLocationTestFoo.method]'));
-},
+ (Isolate isolate) async {
+ var debugger = await initDebugger(isolate);
+ var completions =
+ await DebuggerLocation.complete(debugger, 'DebuggerLocationTestFoo.m');
+ expect(
+ completions.toString(),
+ equals('[DebuggerLocationTestFoo.madness,'
+ ' DebuggerLocationTestFoo.method]'));
+ },
// No completions: qualified name
-(Isolate isolate) async {
- var debugger = await initDebugger(isolate);
- var completions =
- await DebuggerLocation.complete(debugger, 'DebuggerLocationTestFoo.q');
- expect(completions.toString(), equals('[]'));
-},
+ (Isolate isolate) async {
+ var debugger = await initDebugger(isolate);
+ var completions =
+ await DebuggerLocation.complete(debugger, 'DebuggerLocationTestFoo.q');
+ expect(completions.toString(), equals('[]'));
+ },
// Complete script
-(Isolate isolate) async {
- var debugger = await initDebugger(isolate);
- var completions =
- await DebuggerLocation.complete(debugger, 'debugger_location_second_te');
- expect(completions.toString(), equals(
- '[debugger_location_second_test.dart:]'));
-},
+ (Isolate isolate) async {
+ var debugger = await initDebugger(isolate);
+ var completions = await DebuggerLocation.complete(
+ debugger, 'debugger_location_second_te');
+ expect(completions.toString(),
+ equals('[debugger_location_second_test.dart:]'));
+ },
// Complete script:line
-(Isolate isolate) async {
- var debugger = await initDebugger(isolate);
- var completions =
- await DebuggerLocation.complete(debugger,
- 'debugger_location_second_test.dart:11');
- expect(completions.toString(), equals(
- '[debugger_location_second_test.dart:${LINE_B + 0} ,'
- ' debugger_location_second_test.dart:${LINE_B + 0}:,'
- ' debugger_location_second_test.dart:${LINE_B + 1} ,'
- ' debugger_location_second_test.dart:${LINE_B + 1}:,'
- ' debugger_location_second_test.dart:${LINE_B + 2} ,'
- ' debugger_location_second_test.dart:${LINE_B + 2}:,'
- ' debugger_location_second_test.dart:${LINE_B + 3} ,'
- ' debugger_location_second_test.dart:${LINE_B + 3}:,'
- ' debugger_location_second_test.dart:${LINE_B + 4} ,'
- ' debugger_location_second_test.dart:${LINE_B + 4}:,'
- ' debugger_location_second_test.dart:${LINE_B + 5} ,'
- ' debugger_location_second_test.dart:${LINE_B + 5}:,'
- ' debugger_location_second_test.dart:${LINE_B + 6} ,'
- ' debugger_location_second_test.dart:${LINE_B + 6}:,'
- ' debugger_location_second_test.dart:${LINE_B + 9} ,'
- ' debugger_location_second_test.dart:${LINE_B + 9}:]'));
-},
+ (Isolate isolate) async {
+ var debugger = await initDebugger(isolate);
+ var completions = await DebuggerLocation.complete(
+ debugger, 'debugger_location_second_test.dart:11');
+ expect(
+ completions.toString(),
+ equals('[debugger_location_second_test.dart:${LINE_B + 0} ,'
+ ' debugger_location_second_test.dart:${LINE_B + 0}:,'
+ ' debugger_location_second_test.dart:${LINE_B + 1} ,'
+ ' debugger_location_second_test.dart:${LINE_B + 1}:,'
+ ' debugger_location_second_test.dart:${LINE_B + 2} ,'
+ ' debugger_location_second_test.dart:${LINE_B + 2}:,'
+ ' debugger_location_second_test.dart:${LINE_B + 3} ,'
+ ' debugger_location_second_test.dart:${LINE_B + 3}:,'
+ ' debugger_location_second_test.dart:${LINE_B + 4} ,'
+ ' debugger_location_second_test.dart:${LINE_B + 4}:,'
+ ' debugger_location_second_test.dart:${LINE_B + 5} ,'
+ ' debugger_location_second_test.dart:${LINE_B + 5}:,'
+ ' debugger_location_second_test.dart:${LINE_B + 6} ,'
+ ' debugger_location_second_test.dart:${LINE_B + 6}:,'
+ ' debugger_location_second_test.dart:${LINE_B + 9} ,'
+ ' debugger_location_second_test.dart:${LINE_B + 9}:]'));
+ },
// Complete script:line:col
-(Isolate isolate) async {
- var debugger = await initDebugger(isolate);
- var completions =
- await DebuggerLocation.complete(
- debugger,
- 'debugger_location_second_test.dart:$LINE_C:2');
- expect(completions.toString(), equals(
- '[debugger_location_second_test.dart:$LINE_C:2 ,'
- ' debugger_location_second_test.dart:$LINE_C:20 ,'
- ' debugger_location_second_test.dart:$LINE_C:21 ,'
- ' debugger_location_second_test.dart:$LINE_C:22 ,'
- ' debugger_location_second_test.dart:$LINE_C:23 ,'
- ' debugger_location_second_test.dart:$LINE_C:24 ]'));
-},
+ (Isolate isolate) async {
+ var debugger = await initDebugger(isolate);
+ var completions = await DebuggerLocation.complete(
+ debugger, 'debugger_location_second_test.dart:$LINE_C:2');
+ expect(
+ completions.toString(),
+ equals('[debugger_location_second_test.dart:$LINE_C:2 ,'
+ ' debugger_location_second_test.dart:$LINE_C:20 ,'
+ ' debugger_location_second_test.dart:$LINE_C:21 ,'
+ ' debugger_location_second_test.dart:$LINE_C:22 ,'
+ ' debugger_location_second_test.dart:$LINE_C:23 ,'
+ ' debugger_location_second_test.dart:$LINE_C:24 ]'));
+ },
// Complete without the script name.
-(Isolate isolate) async {
- var debugger = await initDebugger(isolate);
- var completions = await DebuggerLocation.complete(debugger, '$LINE_C:2');
- expect(completions.toString(), equals(
- '[debugger_location_second_test.dart:$LINE_C:2 ,'
- ' debugger_location_second_test.dart:$LINE_C:20 ,'
- ' debugger_location_second_test.dart:$LINE_C:21 ,'
- ' debugger_location_second_test.dart:$LINE_C:22 ,'
- ' debugger_location_second_test.dart:$LINE_C:23 ,'
- ' debugger_location_second_test.dart:$LINE_C:24 ]'));
-},
-
+ (Isolate isolate) async {
+ var debugger = await initDebugger(isolate);
+ var completions = await DebuggerLocation.complete(debugger, '$LINE_C:2');
+ expect(
+ completions.toString(),
+ equals('[debugger_location_second_test.dart:$LINE_C:2 ,'
+ ' debugger_location_second_test.dart:$LINE_C:20 ,'
+ ' debugger_location_second_test.dart:$LINE_C:21 ,'
+ ' debugger_location_second_test.dart:$LINE_C:22 ,'
+ ' debugger_location_second_test.dart:$LINE_C:23 ,'
+ ' debugger_location_second_test.dart:$LINE_C:24 ]'));
+ },
];
main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction);

Powered by Google App Engine
This is Rietveld 408576698