Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
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
4 changes: 4 additions & 0 deletions packages/firebase_messaging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 5.0.6

* Additional integration tests.

## 5.0.5

* On Android, fix crash when calling `deleteInstanceID` with latest Flutter engine.
Expand Down
47 changes: 6 additions & 41 deletions packages/firebase_messaging/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,12 @@ dependencies:
path: ../
firebase_core: ^0.4.0

# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
dev_dependencies:
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
test: any

# The following section is specific to Flutter.
flutter:

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the Icons class.
uses-material-design: true

# To add assets to your application, add an assets section here, in
# this "flutter" section, as in:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg

# To add assets from package dependencies, first ensure the asset
# is in the lib/ directory of the dependency. Then,
# refer to the asset with a path prefixed with
# `packages/PACKAGE_NAME/`. Note: the `lib/` is implied, do not
# include `lib/` in the asset path.
#
# Here is an example:
#
# assets:
# - packages/PACKAGE_NAME/path/to/asset

# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import 'dart:async';
import 'package:flutter_driver/driver_extension.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:firebase_messaging/firebase_messaging.dart';

void main() {
final Completer<String> completer = Completer<String>();
enableFlutterDriverExtension(handler: (_) => completer.future);
tearDownAll(() => completer.complete(null));

group('$FirebaseMessaging', () {
final FirebaseMessaging firebaseMessaging = FirebaseMessaging();

test('autoInitEnabled', () async {
await firebaseMessaging.setAutoInitEnabled(false);
expect(await firebaseMessaging.autoInitEnabled(), false);
await firebaseMessaging.setAutoInitEnabled(true);
expect(await firebaseMessaging.autoInitEnabled(), true);
});

test('subscribeToTopic', () async {
firebaseMessaging.subscribeToTopic('foo');
Copy link
Contributor

Choose a reason for hiding this comment

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

Some idea, doesn't need to be in this PR. Maybe we can make subscribeToTopic and unsubscribeFromTopic to return a Future to indicate the invocation to the platform is happened correctly. That'd make the integration test easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, and will update in a subsequent PR

});

test('unsubscribeFromTopic', () async {
firebaseMessaging.unsubscribeFromTopic('foo');
});

test('deleteInstanceID', () async {
final bool result = await firebaseMessaging.deleteInstanceID();
expect(result, isTrue);
});
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'package:flutter_driver/flutter_driver.dart';

Future<void> main() async {
final FlutterDriver driver = await FlutterDriver.connect();
await driver.requestData(null, timeout: const Duration(minutes: 1));
driver.close();
}
4 changes: 3 additions & 1 deletion packages/firebase_messaging/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Cloud Messaging, a cross-platform
messaging solution that lets you reliably deliver messages on Android and iOS.
author: Flutter Team <flutter-dev@googlegroups.com>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_messaging
version: 5.0.5
version: 5.0.6

flutter:
plugin:
Expand All @@ -23,6 +23,8 @@ dev_dependencies:
flutter_test:
sdk: flutter
firebase_core: ^0.4.0
flutter_driver:
sdk: flutter

environment:
sdk: ">=2.0.0-dev.28.0 <3.0.0"
Expand Down