Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
b027315
fix: resume after release
Gustl22 May 23, 2023
ff3c66b
Merge branch 'main' into gustl22/resume-release
Gustl22 Jun 28, 2023
090e1ab
tests: test audio sources in lib
Gustl22 Aug 1, 2023
8dadebb
run with every source
Gustl22 Aug 2, 2023
36c3979
remove redundant resources
Gustl22 Aug 2, 2023
8560005
move to platform tests
Gustl22 Aug 2, 2023
f4008de
move to platform tests
Gustl22 Aug 2, 2023
73466b7
move to platform tests
Gustl22 Aug 2, 2023
eba3b0e
Merge remote-tracking branch 'upstream/main' into gustl22/shorter-tes…
Gustl22 Aug 2, 2023
fd9a8f2
fix platform tests
Gustl22 Aug 2, 2023
19ea8ce
test order
Gustl22 Aug 2, 2023
45f8ca9
release mode release
Gustl22 Aug 2, 2023
80a5d5f
positionEvent
Gustl22 Aug 2, 2023
e70529e
durationEvent
Gustl22 Aug 3, 2023
47eb51d
fix: disposing event channel
Gustl22 Aug 3, 2023
c474d55
fix: duration tests
Gustl22 Aug 3, 2023
b86ce45
[WIP]: remove pump for linux
Gustl22 Aug 3, 2023
2008f10
Allow 1 ms discrepancy for position
Gustl22 Aug 7, 2023
07ef77d
skip sources with variable bitrate
Gustl22 Aug 7, 2023
a9a52e3
skip sources with variable bitrate
Gustl22 Aug 7, 2023
2a516cc
exclude some tests
Gustl22 Aug 7, 2023
df4accc
remove linux pumps, where not necessary
Gustl22 Aug 8, 2023
04e60b6
add one more pump
Gustl22 Aug 8, 2023
d6ca59a
convert logging and error tests to platform
Gustl22 Aug 8, 2023
6227a4c
fix: completing preparedCompleter twice
Gustl22 Aug 8, 2023
719e596
add pumpLinux again
Gustl22 Aug 8, 2023
77892ea
test: add cooldown for mpga on web
Gustl22 Aug 9, 2023
7e3f776
Merge branch 'main' into gustl22/shorter-test-runs
Gustl22 Aug 10, 2023
cd3952b
Merge branch 'gustl22/shorter-test-runs' of https://github.com/bluefi…
Gustl22 Aug 10, 2023
13c0577
[WIP] server: stream wav
Gustl22 Aug 10, 2023
f2e2e90
server: stream wav
Gustl22 Aug 11, 2023
edde98a
server: stream mpeg
Gustl22 Aug 11, 2023
56ade7a
server: throttle stream
Gustl22 Aug 11, 2023
dfe2925
fix path
Gustl22 Aug 11, 2023
18d8220
rename import
Gustl22 Aug 11, 2023
befbaa0
use live stream as source
Gustl22 Aug 11, 2023
af3a237
tests: remove mpga cooldown
Gustl22 Aug 11, 2023
e8d83a6
record stream
Gustl22 Aug 12, 2023
7e5a1e6
record stream
Gustl22 Aug 12, 2023
d63c06d
fix size
Gustl22 Aug 12, 2023
dfcdcd9
fix recording
Gustl22 Aug 12, 2023
40141d6
remove unnecessary prints
Gustl22 Aug 12, 2023
e364886
Merge remote-tracking branch 'upstream/gustl22/resume-release' into g…
Gustl22 Aug 12, 2023
f3025e9
fix: release web
Gustl22 Aug 12, 2023
5a05286
fix: dispose web
Gustl22 Aug 12, 2023
36f71ba
fix global log event test
Gustl22 Aug 12, 2023
1cce3fa
more deviation for VBR duration
Gustl22 Aug 13, 2023
9675cf8
dart format .
Gustl22 Aug 13, 2023
69f4127
ci: update flutter version
Gustl22 Aug 14, 2023
5c8b9b2
fix: platform tests
Gustl22 Aug 14, 2023
ae8f44f
fix: platform tests
Gustl22 Aug 14, 2023
f661c04
test: Add live stream endpoints to server
Gustl22 Aug 15, 2023
a7ec6a8
Merge branch 'gustl22/local-mpeg-stream' into gustl22/shorter-test-runs
Gustl22 Aug 15, 2023
bef5023
change to path
Gustl22 Aug 15, 2023
dc07dbf
Merge branch 'gustl22/local-mpeg-stream' into gustl22/shorter-test-runs
Gustl22 Aug 15, 2023
247f39f
skip some linux tests
Gustl22 Aug 15, 2023
77d18c3
Merge branch 'main' into gustl22/shorter-test-runs
Gustl22 Aug 15, 2023
29a0e46
test: release & release mode
Gustl22 Aug 15, 2023
12e3e3f
test: release & release mode
Gustl22 Aug 15, 2023
edcaefb
test: complete event
Gustl22 Aug 15, 2023
1346c55
test: get null value on duration and position
Gustl22 Aug 15, 2023
e46b177
test: enable release mode release for all platforms
Gustl22 Aug 15, 2023
5b36fe3
feat(android): return null, if not initialized
Gustl22 Aug 15, 2023
cede3c7
feat(darwin): return time of current item
Gustl22 Aug 15, 2023
6a36482
feat(linux): optional position and duration
Gustl22 Aug 15, 2023
a6e0cad
feat(windows): optional position and duration
Gustl22 Aug 15, 2023
7d04621
feat(windows): release & dispose
Gustl22 Aug 15, 2023
458c7c7
feat(windows): simplify releasing mfMediaSource
Gustl22 Aug 15, 2023
c24cdbd
feat(windows): release m_mediaEngine
Gustl22 Aug 15, 2023
619fdc3
feat(linux): optional values
Gustl22 Aug 15, 2023
ac2df4b
fix(darwin): self reference
Gustl22 Aug 15, 2023
9e7eee3
ci(linux): attempt to fix using c++17
Gustl22 Aug 15, 2023
052e62d
Revert "ci(linux): attempt to fix using c++17"
Gustl22 Aug 15, 2023
5a5bcdb
ci(linux,windows): include "optional" header
Gustl22 Aug 15, 2023
2b7500b
feat(windows): optional values
Gustl22 Aug 16, 2023
dbb4e89
feat(windows): use nan, fix null
Gustl22 Aug 16, 2023
e109504
feat(windows): return nan of position if not initialized
Gustl22 Aug 16, 2023
dd79643
feat: make stream position and duration nullable
Gustl22 Aug 16, 2023
e5382e2
tests: make stream position and duration nullable
Gustl22 Aug 16, 2023
1a01be5
tests: fallback for zero on live streams
Gustl22 Aug 16, 2023
c7d4010
Revert "test: enable release mode release for all platforms"
Gustl22 Aug 16, 2023
b73dbc1
docs: release for linux und windows
Gustl22 Aug 16, 2023
36e359d
feat(linux): release
Gustl22 Aug 16, 2023
c2c7ce9
flutter analyze & dart format
Gustl22 Aug 16, 2023
855105d
test: add duration.zero for special case on stream for app tests
Gustl22 Aug 16, 2023
4ba5a39
Merge remote-tracking branch 'upstream/main' into gustl22/resume-release
Gustl22 Aug 16, 2023
581a25a
fix(web): check release Mode on call
Gustl22 Aug 16, 2023
6d58fe3
fix(web): don't release on stop
Gustl22 Aug 16, 2023
7b388a3
Merge branch 'main' into gustl22/shorter-test-runs
Gustl22 Aug 16, 2023
c3387b7
Merge branch 'gustl22/resume-release' into gustl22/shorter-test-runs
Gustl22 Aug 16, 2023
b638bcd
Merge remote-tracking branch 'upstream/main' into gustl22/shorter-tes…
Gustl22 Aug 17, 2023
06e7681
Merge remote-tracking branch 'upstream/main' into gustl22/shorter-tes…
Gustl22 Aug 17, 2023
2c3e7ff
Revert "ci(windows): Replace virtual audio device Scream with sound-c…
Gustl22 Aug 17, 2023
6543418
Merge branch 'main' into gustl22/shorter-test-runs
Gustl22 Aug 17, 2023
75ee782
Merge remote-tracking branch 'upstream/main' into gustl22/shorter-tes…
Gustl22 Aug 17, 2023
10eaa88
Merge remote-tracking branch 'upstream/main' into gustl22/shorter-tes…
Gustl22 Aug 17, 2023
a6dac2f
update
Gustl22 Aug 17, 2023
c228786
Merge remote-tracking branch 'upstream/main' into gustl22/shorter-tes…
Gustl22 Aug 18, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,68 +8,73 @@ class AppSourceTestData extends SourceTestData {
AppSourceTestData({
required this.sourceKey,
required super.duration,
super.isVBR,
});

@override
String toString() {
return 'UiSourceTestData('
'sourceKey: $sourceKey, '
'duration: $duration'
'duration: $duration, '
'isVBR: $isVBR'
')';
}
}

final _features = PlatformFeatures.instance();

// All sources are tested again in lib or platform tests,
// therefore comment most of them to save testing time
final audioTestDataList = [
if (_features.hasUrlSource)
AppSourceTestData(
sourceKey: 'url-remote-wav-1',
duration: const Duration(milliseconds: 451),
),
if (_features.hasUrlSource)
/*if (_features.hasUrlSource)
AppSourceTestData(
sourceKey: 'url-remote-wav-2',
duration: const Duration(seconds: 1, milliseconds: 068),
),
if (_features.hasUrlSource)
),*/
/*if (_features.hasUrlSource)
AppSourceTestData(
sourceKey: 'url-remote-mp3-1',
isVBR: true,
duration: const Duration(minutes: 3, seconds: 30, milliseconds: 77),
),
if (_features.hasUrlSource)
),*/
/*if (_features.hasUrlSource)
AppSourceTestData(
sourceKey: 'url-remote-mp3-2',
duration: const Duration(minutes: 1, seconds: 34, milliseconds: 119),
),
),*/
if (_features.hasUrlSource && _features.hasPlaylistSourceType)
AppSourceTestData(
sourceKey: 'url-remote-m3u8',
duration: null,
),
if (_features.hasUrlSource)
/*if (_features.hasUrlSource)
AppSourceTestData(
sourceKey: 'url-remote-mpga',
duration: null,
),
if (_features.hasAssetSource)
),*/
/*if (_features.hasAssetSource)
AppSourceTestData(
sourceKey: 'asset-wav',
duration: const Duration(seconds: 1, milliseconds: 068),
),
if (_features.hasAssetSource)
),*/
/*if (_features.hasAssetSource)
AppSourceTestData(
sourceKey: 'asset-mp3',
duration: const Duration(minutes: 1, seconds: 34, milliseconds: 119),
),
if (_features.hasBytesSource)
),*/
/*if (_features.hasBytesSource)
AppSourceTestData(
sourceKey: 'bytes-local',
duration: const Duration(seconds: 1, milliseconds: 068),
),
if (_features.hasBytesSource)
),*/
/*if (_features.hasBytesSource)
AppSourceTestData(
sourceKey: 'bytes-remote',
duration: const Duration(minutes: 3, seconds: 30, milliseconds: 76),
),
),*/
];
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,6 @@ $lastFailureMsg''',
}
await pumpAndSettle();
}

bool durationRangeMatcher(
Duration? actual,
Duration? expected, {
Duration deviation = const Duration(seconds: 1),
}) {
if (actual == null && expected == null) {
return true;
}
if (actual == null || expected == null) {
return false;
}
return actual >= (expected - deviation) && actual <= (expected + deviation);
}
}

void expectWidgetHasText(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Future<void> testControlsTab(
await tester.stop();
}

// Test all features in low latency mode:
final isBytesSource = audioSourceTestData.sourceKey.contains('bytes');
if (features.hasLowLatency &&
!audioSourceTestData.isLiveStream &&
Expand Down Expand Up @@ -150,7 +151,6 @@ extension ControlsWidgetTester on WidgetTester {
printWithTimeOnFailure('Test Volume: $volume');
await scrollToAndTap(Key('control-volume-$volume'));
await resume();
// TODO(Gustl22): get volume from native implementation
await pump(timeout);
await stop();
}
Expand All @@ -162,7 +162,6 @@ extension ControlsWidgetTester on WidgetTester {
printWithTimeOnFailure('Test Balance: $balance');
await scrollToAndTap(Key('control-balance-$balance'));
await resume();
// TODO(novikov): get balance from native implementation
await pump(timeout);
await stop();
}
Expand All @@ -174,7 +173,6 @@ extension ControlsWidgetTester on WidgetTester {
printWithTimeOnFailure('Test Rate: $rate');
await scrollToAndTap(Key('control-rate-$rate'));
await resume();
// TODO(Gustl22): get rate from native implementation
await pump(timeout);
await stop();
}
Expand Down Expand Up @@ -224,6 +222,5 @@ extension ControlsWidgetTester on WidgetTester {
if (isResume) {
await resume();
}
// TODO(Gustl22): get release mode from native implementation
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ Future<void> testStreamsTab(
await tester.testPosition(Duration.zero);
}

final isImmediateDurationSupported =
features.hasMp3Duration || !audioSourceTestData.sourceKey.contains('mp3');

if (features.hasDurationEvent && isImmediateDurationSupported) {
if (features.hasDurationEvent && !audioSourceTestData.isVBR) {
// Display duration before playing
await tester.testDuration(audioSourceTestData.duration);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ class LibSourceTestData extends SourceTestData {
LibSourceTestData({
required this.source,
required super.duration,
super.isVBR,
});

@override
String toString() {
return 'RawSourceTestData('
return 'LibSourceTestData('
'source: $source, '
'duration: $duration'
'duration: $duration, '
'isVBR: $isVBR'
')';
}
}
Expand All @@ -32,39 +34,67 @@ final wavUrl1TestData = LibSourceTestData(
final mp3Url1TestData = LibSourceTestData(
source: UrlSource(mp3Url1),
duration: const Duration(minutes: 3, seconds: 30, milliseconds: 77),
isVBR: true,
);

final audioTestDataList = [
if (_features.hasUrlSource) wavUrl1TestData,
if (_features.hasUrlSource)
LibSourceTestData(
source: UrlSource(wavUrl2),
duration: const Duration(seconds: 1, milliseconds: 068),
),
if (_features.hasUrlSource) mp3Url1TestData,
if (_features.hasUrlSource)
LibSourceTestData(
source: UrlSource(mp3Url2),
duration: const Duration(minutes: 1, seconds: 34, milliseconds: 119),
),
if (_features.hasUrlSource && _features.hasPlaylistSourceType)
LibSourceTestData(
source: UrlSource(m3u8StreamUrl),
duration: null,
),
if (_features.hasUrlSource)
LibSourceTestData(
source: UrlSource(mpgaStreamUrl),
duration: null,
),
if (_features.hasAssetSource)
LibSourceTestData(
source: AssetSource(wavAsset),
duration: const Duration(seconds: 1, milliseconds: 068),
),
if (_features.hasAssetSource)
LibSourceTestData(
source: AssetSource(mp3Asset),
duration: const Duration(minutes: 1, seconds: 34, milliseconds: 119),
),
];
final m3u8UrlTestData = LibSourceTestData(
source: UrlSource(m3u8StreamUrl),
duration: null,
);

final mpgaUrlTestData = LibSourceTestData(
source: UrlSource(mpgaStreamUrl),
duration: null,
);

final wavAssetTestData = LibSourceTestData(
source: AssetSource(wavAsset),
duration: const Duration(seconds: 1, milliseconds: 068),
);

final invalidAssetTestData = LibSourceTestData(
source: AssetSource(invalidAsset),
duration: null,
);

final nonExistentUrlTestData = LibSourceTestData(
source: UrlSource('non_existent.txt'),
duration: null,
);

// Some sources are commented which are considered redundant
Future<List<LibSourceTestData>> getAudioTestDataList() async {
return [
if (_features.hasUrlSource) wavUrl1TestData,
/*if (_features.hasUrlSource)
LibSourceTestData(
source: UrlSource(wavUrl2),
duration: const Duration(seconds: 1, milliseconds: 068),
),*/
if (_features.hasUrlSource) mp3Url1TestData,
/*if (_features.hasUrlSource)
LibSourceTestData(
source: UrlSource(mp3Url2),
duration: const Duration(minutes: 1, seconds: 34, milliseconds: 119),
),*/
if (_features.hasUrlSource && _features.hasPlaylistSourceType)
m3u8UrlTestData,
if (_features.hasUrlSource) mpgaUrlTestData,
if (_features.hasAssetSource) wavAssetTestData,
/*if (_features.hasAssetSource)
LibSourceTestData(
source: AssetSource(mp3Asset),
duration: const Duration(minutes: 1, seconds: 34, milliseconds: 119),
),*/
if (_features.hasBytesSource)
LibSourceTestData(
source: BytesSource(await AudioCache.instance.loadAsBytes(wavAsset)),
duration: const Duration(seconds: 1, milliseconds: 068),
),
/*if (_features.hasBytesSource)
LibSourceTestData(
source: BytesSource(await readBytes(Uri.parse(mp3Url1))),
duration: const Duration(minutes: 3, seconds: 30, milliseconds: 76),
),*/
];
}
10 changes: 4 additions & 6 deletions packages/audioplayers/example/integration_test/lib_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ import 'lib/lib_test_utils.dart';
import 'platform_features.dart';
import 'test_utils.dart';

void main() {
final features = PlatformFeatures.instance();

void main() async {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

final features = PlatformFeatures.instance();
final isAndroid = !kIsWeb && Platform.isAndroid;
final audioTestDataList = await getAudioTestDataList();

group('play multiple sources', () {
testWidgets(
Expand Down Expand Up @@ -56,8 +55,7 @@ void main() {
(WidgetTester tester) async {
final player = AudioPlayer();

for (var i = 0; i < audioTestDataList.length; i++) {
final td = audioTestDataList[i];
for (final td in audioTestDataList) {
await tester.pumpLinux();
await player.play(td.source);
await tester.pumpAndSettle();
Expand Down
Loading