Commit aa1c2802 authored by Kuo Jen Wei's avatar Kuo Jen Wei Committed by Commit Bot

[CCA] Fix rename to same video filename for recording duration < 1s.

Bug: 994491
Test: Record video < 1s, see if any "unable to save file" toast pop up.

Change-Id: I544509ac0fb4bba0c743dd230e62abe17039eda4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1806160
Auto-Submit: Kuo Jen Wei <inker@chromium.org>
Reviewed-by: default avatarShik Chen <shik@chromium.org>
Commit-Queue: Kuo Jen Wei <inker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697122}
parent 7f28f70d
......@@ -321,6 +321,9 @@ cca.models.FileSystem.saveVideo = async function(tempfile, filename) {
// Assuming content of tempfile contains all recorded chunks appended together
// and is a well-formed video. The work needed here is just to move the file
// to the correct directory and rename as the specified filename.
if (tempfile.name == filename) {
return tempfile;
}
return new Promise(
(resolve, reject) =>
tempfile.moveTo(nonNullDir, filename, resolve, reject));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment