-
-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2502 from getsentry/temp/8.11.1
`8.11.1` release
- Loading branch information
Showing
9 changed files
with
91 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
flutter/example/integration_test/sentry_widgets_flutter_binding_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// ignore_for_file: avoid_print | ||
// ignore_for_file: invalid_use_of_internal_member | ||
|
||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
import 'package:sentry_flutter/sentry_flutter.dart'; | ||
|
||
// This needs needs to be run with: | ||
// | ||
// flutter drive \ | ||
// --driver=integration_test/test_driver/driver.dart \ | ||
// --target=integration_test/sentry_widgets_flutter_binding_test.dart --profile | ||
// | ||
// This test case will NOT fail in debug builds, hence why we need to test it | ||
// in at least a profile build. | ||
|
||
void main() { | ||
final originalBinding = | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
group('$SentryWidgetsFlutterBinding', () { | ||
testWidgets('return existing binding', (tester) async { | ||
final binding = SentryWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
expect(binding, equals(originalBinding)); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import 'package:integration_test/integration_test_driver.dart'; | ||
|
||
Future<void> main() => integrationDriver(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:flutter/widgets.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:sentry_flutter/src/binding_wrapper.dart'; | ||
|
||
// Note: testing that SentryWidgetsFlutterBinding.ensureInitialized() returns | ||
// the existing binding if one exists is not reliable to test in debug builds | ||
// A previous faulty implementation was passing in debug but not in profile/release builds | ||
// See flutter/example/integration_test/sentry_widgets_flutter_binding_test.dart | ||
|
||
void main() { | ||
group('$SentryWidgetsFlutterBinding', () { | ||
test( | ||
'no existing binding: ensureInitialized() returns SentryWidgetsFlutterBinding binding', | ||
() { | ||
final binding = SentryWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
expect(binding, equals(WidgetsBinding.instance)); | ||
}); | ||
}); | ||
} |