Commit 1a50db33 authored by Mitch McDermott's avatar Mitch McDermott Committed by Commit Bot

Add leading dot to our extension for `showSaveFilePicker` calls.

This change is required since the API was updated in http://crrev/c/2360597.

Bug: b/165769795
Change-Id: I918d5bfa0ab7887e356f91465425d28f6b73c1bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2366380
Commit-Queue: Mitchell McDermott <mcdermottm@google.com>
Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800050}
parent 9cdfc7fe
...@@ -290,7 +290,7 @@ guestMessagePipe.registerHandler(Message.OPEN_FILE, async () => { ...@@ -290,7 +290,7 @@ guestMessagePipe.registerHandler(Message.OPEN_FILE, async () => {
* @return {!Promise<!FileSystemFileHandle>} * @return {!Promise<!FileSystemFileHandle>}
*/ */
function pickWritableFile(suggestedName, mimeType) { function pickWritableFile(suggestedName, mimeType) {
const extension = suggestedName.split('.').reverse()[0]; const extension = '.' + suggestedName.split('.').reverse()[0];
// TODO(b/161087799): Add a default filename when it's supported by the // TODO(b/161087799): Add a default filename when it's supported by the
// native file api. // native file api.
/** @type {!FilePickerOptions} */ /** @type {!FilePickerOptions} */
......
...@@ -921,8 +921,8 @@ TEST_F('MediaAppUIBrowserTest', 'RequestSaveFileIPC', async () => { ...@@ -921,8 +921,8 @@ TEST_F('MediaAppUIBrowserTest', 'RequestSaveFileIPC', async () => {
const lastToken = [...tokenMap.keys()].slice(-1)[0]; const lastToken = [...tokenMap.keys()].slice(-1)[0];
assertMatch(result.testQueryResult, lastToken); assertMatch(result.testQueryResult, lastToken);
assertEquals(options.types.length, 1); assertEquals(options.types.length, 1);
assertEquals(options.types[0].description, 'png'); assertEquals(options.types[0].description, '.png');
assertDeepEquals(options.types[0].accept['image/png'], ['png']); assertDeepEquals(options.types[0].accept['image/png'], ['.png']);
testDone(); testDone();
}); });
......
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