flutter/packages/flutter_tools/test/web.shard/debugger_stepping_web_test.dart
Anna Gringauze edf26e756d
Move web integration tool tests to web.shard (#70226)
* Move web integration tool tests to web.shard

Web integration tool tests depend on DDC changes in SDK. This change
moves them to a separate shard and subshard so CI bot configurations
can run them separately.

In particular, with will allow running those tests on dart CI flutter
HHH web bot instead of a non-web one, allowing early detection and easy
classification of issues caused by SDK changes as VM- or Web related.

* Enabled verbose mode for flaky web_tool_tests

* Split out the test changes to be commited first
2020-11-11 15:42:15 -08:00

58 lines
1.9 KiB
Dart

// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io';
import 'package:file/file.dart';
import '../integration.shard/test_data/stepping_project.dart';
import '../integration.shard/test_driver.dart';
import '../integration.shard/test_utils.dart';
import '../src/common.dart';
void main() {
Directory tempDirectory;
FlutterRunTestDriver flutter;
setUp(() {
tempDirectory = createResolvedTempDirectorySync('debugger_stepping_test.');
});
testWithoutContext('Web debugger can step over statements', () async {
final WebSteppingProject _project = WebSteppingProject();
await _project.setUpIn(tempDirectory);
flutter = FlutterRunTestDriver(tempDirectory);
await flutter.run(
withDebugger: true, startPaused: true, chrome: true,
additionalCommandArgs: <String>['--verbose']);
await flutter.addBreakpoint(_project.breakpointUri, _project.breakpointLine);
await flutter.resume();
await flutter.waitForPause(); // Now we should be on the breakpoint.
expect((await flutter.getSourceLocation()).line, equals(_project.breakpointLine));
// Issue 5 steps, ensuring that we end up on the annotated lines each time.
for (int i = 1; i <= _project.numberOfSteps; i += 1) {
await flutter.stepOverOrOverAsyncSuspension();
final SourcePosition location = await flutter.getSourceLocation();
final int actualLine = location.line;
// Get the line we're expected to stop at by searching for the comment
// within the source code.
final int expectedLine = _project.lineForStep(i);
expect(actualLine, equals(expectedLine),
reason: 'After $i steps, debugger should stop at $expectedLine but stopped at $actualLine'
);
}
}, skip: platform.isMacOS);
tearDown(() async {
await flutter.stop();
tryToDelete(tempDirectory);
});
}