From 225c3c185c192829e80e776ea853c093196b6cc9 Mon Sep 17 00:00:00 2001 From: Jackson Kearl Date: Thu, 22 Oct 2020 17:51:08 -0700 Subject: [PATCH] Make indexedb tests work on windows. Ref #108566. --- .../test/browser/indexedDBFileService.test.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/vs/platform/files/test/browser/indexedDBFileService.test.ts b/src/vs/platform/files/test/browser/indexedDBFileService.test.ts index d3561ce6a23..c03cfba6745 100644 --- a/src/vs/platform/files/test/browser/indexedDBFileService.test.ts +++ b/src/vs/platform/files/test/browser/indexedDBFileService.test.ts @@ -6,16 +6,18 @@ import * as assert from 'assert'; import { FileService } from 'vs/platform/files/common/fileService'; import { Schemas } from 'vs/base/common/network'; -import { join } from 'vs/base/common/path'; +import { posix } from 'vs/base/common/path'; import { URI } from 'vs/base/common/uri'; import { FileOperation, FileOperationEvent } from 'vs/platform/files/common/files'; import { NullLogService } from 'vs/platform/log/common/log'; import { DisposableStore } from 'vs/base/common/lifecycle'; import { IIndexedDBFileSystemProvider, IndexedDB, INDEXEDDB_LOGS_OBJECT_STORE, INDEXEDDB_USERDATA_OBJECT_STORE } from 'vs/platform/files/browser/indexedDBFileSystemProvider'; import { assertIsDefined } from 'vs/base/common/types'; -import { isWindows } from 'vs/base/common/platform'; -(isWindows /* not working on windows yet */ ? suite.skip : suite)('IndexedDB File Service', function () { +// FileService doesn't work with \'s in paths. +const join = posix.join; + +suite('IndexedDB File Service', function () { const logSchema = 'logs'; @@ -57,7 +59,7 @@ import { isWindows } from 'vs/base/common/platform'; const parent = await service.resolve(makeUserdataURI(testDir)); - const newFolderResource = makeUserdataURI(join(parent.resource.fsPath, 'newFolder')); + const newFolderResource = makeUserdataURI(join(parent.resource.path, 'newFolder')); assert.equal((await userdataFileProvider.readdir(parent.resource)).length, 0); const newFolder = await service.createFolder(newFolderResource); @@ -66,9 +68,9 @@ import { isWindows } from 'vs/base/common/platform'; // assert.equal((await userdataFileProvider.readdir(parent.resource)).length, 1); assert.ok(event); - assert.equal(event!.resource.fsPath, newFolderResource.fsPath); + assert.equal(event!.resource.path, newFolderResource.path); assert.equal(event!.operation, FileOperation.CREATE); - assert.equal(event!.target!.resource.fsPath, newFolderResource.fsPath); + assert.equal(event!.target!.resource.path, newFolderResource.path); assert.equal(event!.target!.isDirectory, true); }); }); -- GitLab