mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

This PR makes the following improvements to web hot reload support and related tests: - The `--start-paused` flag is now silently added when running with `-d web-server --web-experimental-hot-reload` if it is not already present. - Refactored test infrastructure to allow specifying the device parameter (e.g., `'chrome'`, `'web-server'`) when running integration tests. - Added a new `web_run_web_server_test` to run flows on the web-server device. - Updated existing tests to explicitly pass the correct device parameter where needed. - We are currently not able to test hot reload on the web-server device as this is not yet supported. Fixes https://github.com/dart-lang/sdk/issues/60289
40 lines
1.2 KiB
Dart
40 lines
1.2 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.
|
|
|
|
@Tags(<String>['flutter-test-driver'])
|
|
library;
|
|
|
|
import 'package:file/file.dart';
|
|
import 'package:flutter_tools/src/base/file_system.dart';
|
|
import 'package:flutter_tools/src/web/web_device.dart' show GoogleChromeDevice;
|
|
|
|
import '../integration.shard/test_data/basic_project.dart';
|
|
import '../integration.shard/test_driver.dart';
|
|
import '../integration.shard/test_utils.dart';
|
|
import '../src/common.dart';
|
|
|
|
void main() {
|
|
late Directory tempDir;
|
|
final BasicProjectWithUnaryMain project = BasicProjectWithUnaryMain();
|
|
late FlutterRunTestDriver flutter;
|
|
|
|
setUp(() async {
|
|
tempDir = createResolvedTempDirectorySync('run_test.');
|
|
await project.setUpIn(tempDir);
|
|
flutter = FlutterRunTestDriver(tempDir);
|
|
});
|
|
|
|
tearDown(() async {
|
|
await flutter.stop();
|
|
tryToDelete(tempDir);
|
|
});
|
|
|
|
testWithoutContext('flutter run works on chrome devices with a unary main function', () async {
|
|
await flutter.run(
|
|
device: GoogleChromeDevice.kChromeDeviceId,
|
|
additionalCommandArgs: <String>['--verbose'],
|
|
);
|
|
});
|
|
}
|