Fix drag-out losing audio and FX-container drops losing the capture; re-home ingest under shell/actions
This commit is contained in:
@@ -221,6 +221,52 @@ static void testMixedTallies() {
|
||||
CHECK(l.skippedDuplicate == 1);
|
||||
}
|
||||
|
||||
// --- OS hand-off ordering -----------------------------------------------------
|
||||
//
|
||||
// The drag-out-lands-without-audio regression: the shell used to wind its internal drag down
|
||||
// (release capture, clear drag state) BEFORE checking whether the payload had resolved to any
|
||||
// on-disk file. A payload that resolved to nothing therefore consumed the gesture — the drag
|
||||
// died half-torn-down and the user saw a drop with no audio and dragged again. The two side
|
||||
// effects are one decision; these pin that.
|
||||
|
||||
// Nothing draggable -> hand off nothing AND keep the internal drag alive.
|
||||
static void testEmptyPathsHandsOffNothingAndKeepsInternalDrag() {
|
||||
const OsHandoff h = decideOsHandoff({});
|
||||
CHECK(!h.startOsDrag);
|
||||
CHECK(!h.releaseInternalDrag);
|
||||
}
|
||||
|
||||
// A resolvable payload -> release the internal drag, then start the OS drag.
|
||||
static void testResolvablePayloadHandsOff() {
|
||||
const OsHandoff one = decideOsHandoff({"C:/proj/bank/a.wav"});
|
||||
CHECK(one.startOsDrag);
|
||||
CHECK(one.releaseInternalDrag);
|
||||
const OsHandoff many = decideOsHandoff({"a.wav", "b.wav", "c.wav"});
|
||||
CHECK(many.startOsDrag);
|
||||
CHECK(many.releaseInternalDrag);
|
||||
}
|
||||
|
||||
// The coupling itself: releasing without starting is the defect, so it must be unreachable
|
||||
// for every input the assembler can produce.
|
||||
static void testNeverReleasesWithoutStarting() {
|
||||
const std::vector<std::vector<std::string>> inputs = {
|
||||
{}, {"a.wav"}, {"a.wav", "b.wav"}, {""},
|
||||
};
|
||||
for (const std::vector<std::string>& in : inputs) {
|
||||
const OsHandoff h = decideOsHandoff(in);
|
||||
CHECK(!(h.releaseInternalDrag && !h.startOsDrag));
|
||||
}
|
||||
}
|
||||
|
||||
// End to end through the assembler: a selection whose every entry is stale/unresolvable
|
||||
// yields the keep-the-drag verdict, which is exactly the case the shell used to mishandle.
|
||||
static void testAllSkippedSelectionKeepsInternalDrag() {
|
||||
const PathList l = assemblePathList({missing("g1.wav"), unresolved()});
|
||||
const OsHandoff h = decideOsHandoff(l.paths);
|
||||
CHECK(!h.startOsDrag);
|
||||
CHECK(!h.releaseInternalDrag);
|
||||
}
|
||||
|
||||
int main() {
|
||||
testInsidePanelStaysInternal();
|
||||
testLeavingClientAreaIsOsDrag();
|
||||
@@ -244,6 +290,11 @@ int main() {
|
||||
testAllSkippedYieldsEmpty();
|
||||
testMixedTallies();
|
||||
|
||||
testEmptyPathsHandsOffNothingAndKeepsInternalDrag();
|
||||
testResolvablePayloadHandsOff();
|
||||
testNeverReleasesWithoutStarting();
|
||||
testAllSkippedSelectionKeepsInternalDrag();
|
||||
|
||||
if (g_fail == 0) std::printf("All tests passed.\n");
|
||||
return g_fail ? 1 : 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user