Push breakpoint URIs to Project and remove unused string paths (#23395)

This commit is contained in:
Danny Tuppeny
2018-10-24 07:21:48 +01:00
committed by GitHub
parent aa83f77a49
commit 64bf567b0e
4 changed files with 6 additions and 9 deletions

View File

@@ -33,13 +33,13 @@ void main() {
Future<VMIsolate> breakInBuildMethod(FlutterTestDriver flutter) async {
return _flutter.breakAt(
Uri.parse('package:test/main.dart'),
_project.buildMethodBreakpointUri,
_project.buildMethodBreakpointLine);
}
Future<VMIsolate> breakInTopLevelFunction(FlutterTestDriver flutter) async {
return _flutter.breakAt(
Uri.parse('package:test/main.dart'),
_project.topLevelFunctionBreakpointUri,
_project.topLevelFunctionBreakpointLine);
}

View File

@@ -41,7 +41,7 @@ void main() {
test('reload hits breakpoints after reload', () async {
await _flutter.run(withDebugger: true);
final VMIsolate isolate = await _flutter.breakAt(
Uri.parse('package:test/main.dart'),
_project.breakpointUri,
_project.breakpointLine);
expect(isolate.pauseEvent, isInstanceOf<VMPauseBreakpointEvent>());
});

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_tools/src/base/file_system.dart';
import 'test_project.dart';
class BasicProject extends TestProject {
@@ -41,9 +39,9 @@ class BasicProject extends TestProject {
}
''';
String get buildMethodBreakpointFile => breakpointFile;
Uri get buildMethodBreakpointUri => breakpointUri;
int get buildMethodBreakpointLine => breakpointLine;
String get topLevelFunctionBreakpointFile => fs.path.join(dir.path, 'lib', 'main.dart');
Uri get topLevelFunctionBreakpointUri => breakpointUri;
int get topLevelFunctionBreakpointLine => lineContaining(main, '// TOP LEVEL BREAKPOINT');
}

View File

@@ -16,8 +16,7 @@ abstract class TestProject {
String get main;
// Valid locations for a breakpoint for tests that just need to break somewhere.
String get breakpointFile => fs.path.join(
dir.path, 'lib', 'main.dart');
Uri get breakpointUri => Uri.parse('package:test/main.dart');
int get breakpointLine => lineContaining(main, '// BREAKPOINT');
Future<void> setUpIn(Directory dir) async {