diff --git a/packages/path-provider/CHANGELOG.md b/packages/path-provider/CHANGELOG.md index 7ebc965d7d59..ee708465d463 100644 --- a/packages/path-provider/CHANGELOG.md +++ b/packages/path-provider/CHANGELOG.md @@ -1,7 +1,10 @@ -## [0.1.1] - 2017-05-04 +## [0.1.2] - 2017-05-08 + +* Add test. -* Change to README.md +## [0.1.1] - 2017-05-04 +* Change to README.md. ## [0.1.0] - 2017-05-03 diff --git a/packages/path-provider/pubspec.yaml b/packages/path-provider/pubspec.yaml index 1d11c45190ed..c0ad13a5f908 100644 --- a/packages/path-provider/pubspec.yaml +++ b/packages/path-provider/pubspec.yaml @@ -1,6 +1,6 @@ name: path_provider -version: 0.1.1 +version: 0.1.2 description: A Flutter plugin for getting commonly used locations on the filesystem. author: Flutter Team homepage: https://github.com/flutter/plugins @@ -13,3 +13,7 @@ flutter: dependencies: flutter: sdk: flutter + +dev_dependencies: + flutter_test: + sdk: flutter \ No newline at end of file diff --git a/packages/path-provider/test/path_provider_test.dart b/packages/path-provider/test/path_provider_test.dart new file mode 100644 index 000000000000..47cd22b2a70e --- /dev/null +++ b/packages/path-provider/test/path_provider_test.dart @@ -0,0 +1,55 @@ +// Copyright 2017 The Chromium 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:flutter/services.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:test/test.dart'; + +void main() { + const channel = const MethodChannel('plugins.flutter.io/path_provider'); + final List log = []; + String response; + + channel.setMockMethodCallHandler((MethodCall methodCall) async { + log.add(methodCall); + return response; + }); + + tearDown(() { + log.clear(); + }); + + test('getTemporaryDirectory test', () async { + response = null; + Directory directory = await getTemporaryDirectory(); + expect(log, equals([new MethodCall('getTemporaryDirectory')])); + expect(directory, isNull); + }); + + test('getApplicationDocumentsDirectory test', () async { + response = null; + Directory directory = await getApplicationDocumentsDirectory(); + expect( + log, + equals([new MethodCall('getApplicationDocumentsDirectory')]), + ); + expect(directory, isNull); + }); + + test('TemporaryDirectory path test', () async { + final String fakePath = "/foo/bar/baz"; + response = fakePath; + Directory directory = await getTemporaryDirectory(); + expect(directory.path, equals(fakePath)); + }); + + test('ApplicationDocumentsDirectory path test', () async { + final String fakePath = "/foo/bar/baz"; + response = fakePath; + Directory directory = await getApplicationDocumentsDirectory(); + expect(directory.path, equals(fakePath)); + }); +} diff --git a/packages/url-launcher/CHANGELOG.md b/packages/url-launcher/CHANGELOG.md index 9b75f61dbbc4..5b9b6049b568 100644 --- a/packages/url-launcher/CHANGELOG.md +++ b/packages/url-launcher/CHANGELOG.md @@ -1,14 +1,18 @@ +## [0.3.4] - 2017-05-08 + +* Add test. + ## [0.3.3] - 2017-05-05 * Change to buildToolsVersion ## [0.3.2] - 2017-05-04 -* Change to README.md +* Change to README.md. ## [0.3.1] - 2017-05-01 -* Change to README.md +* Change to README.md. ## [0.3.0] - 2017-04-27 diff --git a/packages/url-launcher/ios/Classes/UrlLauncherPlugin.h b/packages/url-launcher/ios/Classes/UrlLauncherPlugin.h index a827ad7c2ece..0dc931f3cf28 100644 --- a/packages/url-launcher/ios/Classes/UrlLauncherPlugin.h +++ b/packages/url-launcher/ios/Classes/UrlLauncherPlugin.h @@ -1,3 +1,7 @@ +// Copyright 2017 The Chromium 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 @interface UrlLauncherPlugin : NSObject diff --git a/packages/url-launcher/ios/Classes/UrlLauncherPlugin.m b/packages/url-launcher/ios/Classes/UrlLauncherPlugin.m index 1b31ddb08328..4bea2265c757 100644 --- a/packages/url-launcher/ios/Classes/UrlLauncherPlugin.m +++ b/packages/url-launcher/ios/Classes/UrlLauncherPlugin.m @@ -1,3 +1,7 @@ +// Copyright 2017 The Chromium 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 "UrlLauncherPlugin.h" @implementation UrlLauncherPlugin { diff --git a/packages/url-launcher/pubspec.yaml b/packages/url-launcher/pubspec.yaml index a3e6f0e662fe..50abbf41a5e3 100644 --- a/packages/url-launcher/pubspec.yaml +++ b/packages/url-launcher/pubspec.yaml @@ -1,6 +1,6 @@ name: url_launcher -version: 0.3.3 +version: 0.3.4 description: A Flutter plugin for launching a URL author: Flutter Team homepage: https://github.com/flutter/plugins @@ -13,3 +13,7 @@ flutter: dependencies: flutter: sdk: flutter + +dev_dependencies: + flutter_test: + sdk: flutter diff --git a/packages/url-launcher/test/url_launcher_test.dart b/packages/url-launcher/test/url_launcher_test.dart new file mode 100644 index 000000000000..25cdd74e1a37 --- /dev/null +++ b/packages/url-launcher/test/url_launcher_test.dart @@ -0,0 +1,34 @@ +// Copyright 2017 The Chromium 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 'package:flutter/services.dart'; +import 'package:test/test.dart'; +import 'package:url_launcher/url_launcher.dart'; + +void main() { + const channel = const MethodChannel('plugins.flutter.io/url_launcher'); + final List log = []; + channel.setMockMethodCallHandler((MethodCall methodCall) async { + log.add(methodCall); + }); + + tearDown(() { + log.clear(); + }); + + test('canLaunch test', () async { + await canLaunch('http://example.com/'); + expect( + log, + equals([new MethodCall('canLaunch', 'http://example.com/')]), + ); + log.clear(); + }); + + test('launch test', () async { + await launch('http://example.com/'); + expect(log, + equals([new MethodCall('launch', 'http://example.com/')])); + }); +}