The refusal fixture flips — mono joins stereo now, stereo onto mono refuses
Browse files at this commit8c00c2830cf448b3baa580e04ce27975e385967eParent: a72c5c5- test
- the refusal fixture flips — mono joins stereo now, stereo onto mono refuses
1 changed file +13 -8
crates/app/src/tests/editing.rsmodified+13 -8
| @@ -1461,26 +1461,31 @@ fn group_reaches_the_sound_before_a_video_layer_over_it() { | |||
| 1461 | /// refused file cannot leave a row behind. | 1461 | /// refused file cannot leave a row behind. |
| 1462 | #[test] | 1462 | #[test] |
| 1463 | fn a_refused_import_leaves_no_row_and_an_accepted_one_is_whole() { | 1463 | fn a_refused_import_leaves_no_row_and_an_accepted_one_is_whole() { |
| 1464 | - let mut session = PlaybackSession::open(asset("test_av.mp4")).expect("open the fixture"); | 1464 | + // A mono timeline: since a mono track up-mixes onto a wider timeline |
| 1465 | + // (`engine::audio::widen`), the refusal left standing is the reverse -- | ||
| 1466 | + // a wider file cannot join a mono timeline, nothing narrows a source. | ||
| 1467 | + let mut session = PlaybackSession::open(asset("test_ac3.mp4")).expect("open the fixture"); | ||
| 1465 | // Silent like the engine suite: this opens the real device. | 1468 | // Silent like the engine suite: this opens the real device. |
| 1466 | session.set_gain(0.0); | 1469 | session.set_gain(0.0); |
| 1467 | assert_eq!(session.sources().len(), 1); | 1470 | assert_eq!(session.sources().len(), 1); |
| 1468 | // 640x360 joins now (the project canvas places it), and so does a file | 1471 | // 640x360 joins now (the project canvas places it), and so does a file |
| 1469 | // with no sound (it plays silence over its span). What is left is one | 1472 | // with no sound (it plays silence over its span). What is left is one |
| 1470 | - // output device: a mono track cannot join a stereo timeline. | 1473 | + // output device: a stereo track cannot join a mono timeline. |
| 1471 | let refusal = session | 1474 | let refusal = session |
| 1472 | - .import(&asset("test_ac3.mp4")) | 1475 | + .import(&asset("test_av.mp4")) |
| 1473 | - .expect_err("a mono track must not join a stereo timeline") | 1476 | + .expect_err("a stereo track must not join a mono timeline") |
| 1474 | .to_string(); | 1477 | .to_string(); |
| 1475 | assert!(refusal.contains("audio"), "refusal must name it: {refusal}"); | 1478 | assert!(refusal.contains("audio"), "refusal must name it: {refusal}"); |
| 1476 | assert_eq!(session.sources().len(), 1, "a refusal added a row"); | 1479 | assert_eq!(session.sources().len(), 1, "a refusal added a row"); |
| 1477 | - // An accepted one does add a row, and it reads as the whole file: 4 s | 1480 | + // An accepted one does add a row, and it reads as the whole file: 3 s |
| 1478 | // at 30 fps, its own length and not one taken off the lanes. | 1481 | // at 30 fps, its own length and not one taken off the lanes. |
| 1479 | - session.import(&asset("test_av2.mp4")).expect("av2 matches"); | 1482 | + session |
| 1483 | + .import(&asset("test_audio_only.mp4")) | ||
| 1484 | + .expect("mono matches mono"); | ||
| 1480 | assert_eq!(session.sources().len(), 2); | 1485 | assert_eq!(session.sources().len(), 2); |
| 1481 | let second = session.sources()[1].path.clone(); | 1486 | let second = session.sources()[1].path.clone(); |
| 1482 | - assert_eq!(session.file_frames(&second), 120); | 1487 | + assert_eq!(session.file_frames(&second), 90); |
| 1483 | - assert_eq!(timecode(120. / 30., 30.), "00:00:04:00"); | 1488 | + assert_eq!(timecode(90. / 30., 30.), "00:00:03:00"); |
| 1484 | } | 1489 | } |
| 1485 | 1490 | ||
| 1486 | /// What the Add button and a dropped row both do, minus the pointer: the | 1491 | /// What the Add button and a dropped row both do, minus the pointer: the |