Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/all_plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
fetch-depth: 0
- name: 'Install Flutter'
run: ./.github/workflows/scripts/install-flutter.sh stable
run: ./.github/workflows/scripts/install-flutter.sh beta
- name: 'Install Tools'
run: |
./.github/workflows/scripts/install-tools.sh
Expand All @@ -43,7 +43,7 @@ jobs:
with:
fetch-depth: 0
- name: 'Install Flutter'
run: ./.github/workflows/scripts/install-flutter.sh stable
run: ./.github/workflows/scripts/install-flutter.sh beta
- name: 'Install Tools'
run: |
./.github/workflows/scripts/install-tools.sh
Expand Down Expand Up @@ -75,15 +75,15 @@ jobs:
with:
fetch-depth: 0
- name: 'Install Flutter'
run: ./.github/workflows/scripts/install-flutter.sh stable
run: ./.github/workflows/scripts/install-flutter.sh beta
- name: 'Install Tools'
run: ./.github/workflows/scripts/install-tools.sh
- name: 'Bootstrap Workspace'
run: melos bootstrap
- name: 'Build Example Snapshots'
run: |
melos exec -c 1 --scope="*example*" -- \
flutter build aot
flutter build bundle
test:
runs-on: ubuntu-latest
timeout-minutes: 15
Expand All @@ -92,7 +92,7 @@ jobs:
with:
fetch-depth: 0
- name: 'Install Flutter'
run: ./.github/workflows/scripts/install-flutter.sh stable
run: ./.github/workflows/scripts/install-flutter.sh beta
- name: 'Install Tools'
run: ./.github/workflows/scripts/install-tools.sh
- name: 'Bootstrap Workspace'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,18 @@
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';
import 'dart:convert';
import 'dart:io';

import 'package:flutter_driver/flutter_driver.dart';
import 'package:vm_service_client/vm_service_client.dart';

Future<StreamSubscription<VMIsolateRef>> resumeIsolatesOnPause(
FlutterDriver driver) async {
final vm = await driver.serviceClient.getVM();
print('for isolates');
for (final isolateRef in vm.isolates) {
final isolate = await isolateRef.load();
if (isolate.isPaused) {
print('isolate.resume');
await isolate.resume();
}
}
return driver.serviceClient.onIsolateRunnable
.asBroadcastStream()
.listen((VMIsolateRef isolateRef) async {
print('onIsolateRunnable');
final isolate = await isolateRef.load();
if (isolate.isPaused) {
print('isolate.resume');
await isolate.resume();
}
});
}

Future<void> main() async {
final driver = await FlutterDriver.connect();
// flutter drive causes isolates to be paused on spawn. The background isolate
// for this plugin will need to be resumed for the test to pass.
final subscription = await resumeIsolatesOnPause(driver);
final result =
await driver.requestData(null, timeout: const Duration(minutes: 5));
final data = await driver.requestData(
null,
timeout: const Duration(minutes: 1),
);
await driver.close();
await subscription.cancel();
exit(result == 'pass' ? 0 : 1);
final Map<String, dynamic> result = jsonDecode(data);
exit(result['result'] == 'true' ? 0 : 1);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is the same that the flutter/plugins project is doing

}
4 changes: 2 additions & 2 deletions packages/device_info_plus/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import 'package:flutter/services.dart';
import 'package:device_info_plus/device_info_plus.dart';

void main() {
runZoned(() {
runZonedGuarded(() {
runApp(MyApp());
}, onError: (dynamic error, dynamic stack) {
}, (dynamic error, dynamic stack) {
print(error);
print(stack);
});
Expand Down