spotube/flutter/dev/bots/test/run_command_test.dart
Rahul Sahani b5a8835c28 Enhance media controls and add social sharing features
Add enhanced media controls and social sharing features.

* **Enhanced Media Controls:**
  - Add volume control slider to `PlayerControls` widget in `lib/modules/player/player_controls.dart`.
  - Implement keyboard shortcuts for media controls (play/pause, next/previous track, volume up/down) in `PlayerControls` widget.
  - Add "lyrics" button to `PlayerView` widget in `lib/modules/player/player.dart`.

* **Social Sharing Features:**
  - Add feature to share the currently playing track on social media platforms in `lib/components/track_tile/track_options.dart`.
  - Add share button to `TrackPresentationTopSection` widget in `lib/components/track_presentation/presentation_top.dart`.

* **Settings:**
  - Add dark mode toggle in the settings page in `lib/pages/settings/settings.dart`.

* **CI Configuration:**
  - Add `.ci.yaml` file for continuous integration configuration.
2025-03-09 13:34:56 +05:30

66 lines
3.1 KiB
Dart

// Copyright 2014 The Flutter 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' as io;
import '../run_command.dart';
import '../utils.dart';
import 'common.dart';
void main() {
// These tests only run on Linux. They test platform-agnostic code that is
// triggered by platform-sensitive code. To avoid having to complicate our
// test harness by using a mockable process manager, the tests rely on one
// platform's conventions (Linux having `sh`). The logic being tested is not
// so critical that it matters that we're only testing it on one platform.
test('short output on runCommand failure', () async {
final List<Object?> log = <String>[];
final PrintCallback oldPrint = print;
print = log.add;
try {
await runCommand('/usr/bin/sh', <String>['-c', 'echo test; false']);
expect(log, <Object>[
startsWith('RUNNING:'),
'workingDirectory: null, executable: /usr/bin/sh, arguments: [-c, echo test; false]',
'test',
'╔═╡ERROR #1╞════════════════════════════════════════════════════════════════════',
startsWith('║ Command: '),
'║ Command exited with exit code 1 but expected zero exit code.',
startsWith('║ Working directory: '),
'║ stdout and stderr output:',
'║ test',
'',
'╚═══════════════════════════════════════════════════════════════════════════════',
]);
} finally {
print = oldPrint;
resetErrorStatus();
}
}, skip: !io.Platform.isLinux); // [intended] See comments above.
test('long output on runCommand failure', () async {
final List<Object?> log = <String>[];
final PrintCallback oldPrint = print;
print = log.add;
try {
await runCommand('/usr/bin/sh', <String>['-c', 'echo ${"meow" * 1024}; false']);
expect(log, <Object>[
startsWith('RUNNING:'),
'workingDirectory: null, executable: /usr/bin/sh, arguments: [-c, echo ${"meow" * 1024}; false]',
'meow' * 1024,
'╔═╡ERROR #1╞════════════════════════════════════════════════════════════════════',
startsWith('║ Command: '),
'║ Command exited with exit code 1 but expected zero exit code.',
startsWith('║ Working directory: '),
'╚═══════════════════════════════════════════════════════════════════════════════',
]);
} finally {
print = oldPrint;
resetErrorStatus();
}
}, skip: !io.Platform.isLinux); // [intended] See comments above.
}