| // Copyright 2024, the Dart project authors. Please see the AUTHORS file |
| // for details. 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:deps/browsers/firefox.dart'; |
| import 'package:deps/package.dart'; |
| import 'package:file/file.dart'; |
| import 'package:file/local.dart'; |
| import 'package:test/test.dart'; |
| |
| void main() { |
| test('firefox package', () async { |
| final firefox = FirefoxPackage("platform", "os", "1.2.3+5"); |
| expect(firefox.name, "dart/browsers/firefox/platform"); |
| expect( |
| firefox.source, |
| Uri.parse( |
| "https://archive.mozilla.org/pub/firefox/candidates/1.2.3-candidates/build5/os/en-US/firefox-1.2.3.zip")); |
| }); |
| |
| test('firefox linux package', () async { |
| final firefox = FirefoxPackage("platform", "linux-x86_64", "1.2.3+5"); |
| expect( |
| firefox.source, |
| Uri.parse( |
| "https://archive.mozilla.org/pub/firefox/candidates/1.2.3-candidates/build5/linux-x86_64/en-US/firefox-1.2.3.tar.bz2")); |
| }); |
| |
| group('integration test', () { |
| final fileSystem = LocalFileSystem(); |
| late Directory workingDir; |
| |
| setUp(() async => |
| workingDir = await fileSystem.systemTempDirectory.createTemp()); |
| tearDown(() async => await workingDir.delete(recursive: true)); |
| |
| for (final MapEntry(key: platform, value: os) |
| in {'linux-amd64': 'linux-x86_64', 'windows-amd64': 'win64'}.entries) { |
| test('firefox $platform', () async { |
| await dryRun( |
| () async => FirefoxPackage(platform, os, '111.0.1+2') |
| .create(workingDir, false), |
| true); |
| }); |
| } |
| }); |
| } |