You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

27 lines
1008 B

  1. // Copyright 2013 The Flutter Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. import 'package:flutter_test/flutter_test.dart';
  5. import 'package:integration_test/integration_test.dart';
  6. import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart';
  7. void main() {
  8. IntegrationTestWidgetsFlutterBinding.ensureInitialized();
  9. testWidgets('canLaunch', (WidgetTester _) async {
  10. final UrlLauncherPlatform launcher = UrlLauncherPlatform.instance;
  11. expect(await launcher.canLaunch('randomstring'), false);
  12. // Generally all devices should have some default browser.
  13. expect(await launcher.canLaunch('http://flutter.dev'), true);
  14. // SMS handling is available by default on test devices.
  15. expect(await launcher.canLaunch('sms:5555555555'), true);
  16. // tel: and mailto: links may not be openable on every device. iOS
  17. // simulators notably can't open these link types.
  18. });
  19. }