mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge VS Code 1.21 source code (#1067)
* Initial VS Code 1.21 file copy with patches * A few more merges * Post npm install * Fix batch of build breaks * Fix more build breaks * Fix more build errors * Fix more build breaks * Runtime fixes 1 * Get connection dialog working with some todos * Fix a few packaging issues * Copy several node_modules to package build to fix loader issues * Fix breaks from master * A few more fixes * Make tests pass * First pass of license header updates * Second pass of license header updates * Fix restore dialog issues * Remove add additional themes menu items * fix select box issues where the list doesn't show up * formatting * Fix editor dispose issue * Copy over node modules to correct location on all platforms
This commit is contained in:
@@ -23,6 +23,7 @@ import { ConsoleLogMainService } from 'vs/platform/log/common/log';
|
||||
import { IWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { createHash } from 'crypto';
|
||||
import { getRandomTestPath } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
|
||||
suite('BackupMainService', () => {
|
||||
const parentDir = getRandomTestPath(os.tmpdir(), 'vsctests', 'backupservice');
|
||||
@@ -34,7 +35,7 @@ suite('BackupMainService', () => {
|
||||
class TestBackupMainService extends BackupMainService {
|
||||
|
||||
constructor(backupHome: string, backupWorkspacesPath: string, configService: TestConfigurationService) {
|
||||
super(environmentService, configService, new ConsoleLogMainService(environmentService));
|
||||
super(environmentService, configService, new ConsoleLogMainService());
|
||||
|
||||
this.backupHome = backupHome;
|
||||
this.workspacesJsonPath = backupWorkspacesPath;
|
||||
@@ -116,24 +117,24 @@ suite('BackupMainService', () => {
|
||||
service.registerFolderBackupSync(barFile.fsPath);
|
||||
service.loadSync();
|
||||
assert.deepEqual(service.getFolderBackupPaths(), []);
|
||||
assert.ok(!fs.exists(service.toBackupPath(fooFile.fsPath)));
|
||||
assert.ok(!fs.exists(service.toBackupPath(barFile.fsPath)));
|
||||
assert.ok(!fs.existsSync(service.toBackupPath(fooFile.fsPath)));
|
||||
assert.ok(!fs.existsSync(service.toBackupPath(barFile.fsPath)));
|
||||
|
||||
// 3) backup workspace path exists with empty folders within
|
||||
fs.mkdirSync(service.toBackupPath(fooFile.fsPath));
|
||||
fs.mkdirSync(service.toBackupPath(barFile.fsPath));
|
||||
fs.mkdirSync(path.join(service.toBackupPath(fooFile.fsPath), 'file'));
|
||||
fs.mkdirSync(path.join(service.toBackupPath(barFile.fsPath), 'untitled'));
|
||||
fs.mkdirSync(path.join(service.toBackupPath(fooFile.fsPath), Schemas.file));
|
||||
fs.mkdirSync(path.join(service.toBackupPath(barFile.fsPath), Schemas.untitled));
|
||||
service.registerFolderBackupSync(fooFile.fsPath);
|
||||
service.registerFolderBackupSync(barFile.fsPath);
|
||||
service.loadSync();
|
||||
assert.deepEqual(service.getFolderBackupPaths(), []);
|
||||
assert.ok(!fs.exists(service.toBackupPath(fooFile.fsPath)));
|
||||
assert.ok(!fs.exists(service.toBackupPath(barFile.fsPath)));
|
||||
assert.ok(!fs.existsSync(service.toBackupPath(fooFile.fsPath)));
|
||||
assert.ok(!fs.existsSync(service.toBackupPath(barFile.fsPath)));
|
||||
|
||||
// 4) backup workspace path points to a workspace that no longer exists
|
||||
// so it should convert the backup worspace to an empty workspace backup
|
||||
const fileBackups = path.join(service.toBackupPath(fooFile.fsPath), 'file');
|
||||
const fileBackups = path.join(service.toBackupPath(fooFile.fsPath), Schemas.file);
|
||||
fs.mkdirSync(service.toBackupPath(fooFile.fsPath));
|
||||
fs.mkdirSync(service.toBackupPath(barFile.fsPath));
|
||||
fs.mkdirSync(fileBackups);
|
||||
@@ -163,24 +164,24 @@ suite('BackupMainService', () => {
|
||||
service.registerWorkspaceBackupSync(toWorkspace(barFile.fsPath));
|
||||
service.loadSync();
|
||||
assert.deepEqual(service.getWorkspaceBackups(), []);
|
||||
assert.ok(!fs.exists(service.toBackupPath(fooFile.fsPath)));
|
||||
assert.ok(!fs.exists(service.toBackupPath(barFile.fsPath)));
|
||||
assert.ok(!fs.existsSync(service.toBackupPath(fooFile.fsPath)));
|
||||
assert.ok(!fs.existsSync(service.toBackupPath(barFile.fsPath)));
|
||||
|
||||
// 3) backup workspace path exists with empty folders within
|
||||
fs.mkdirSync(service.toBackupPath(fooFile.fsPath));
|
||||
fs.mkdirSync(service.toBackupPath(barFile.fsPath));
|
||||
fs.mkdirSync(path.join(service.toBackupPath(fooFile.fsPath), 'file'));
|
||||
fs.mkdirSync(path.join(service.toBackupPath(barFile.fsPath), 'untitled'));
|
||||
fs.mkdirSync(path.join(service.toBackupPath(fooFile.fsPath), Schemas.file));
|
||||
fs.mkdirSync(path.join(service.toBackupPath(barFile.fsPath), Schemas.untitled));
|
||||
service.registerWorkspaceBackupSync(toWorkspace(fooFile.fsPath));
|
||||
service.registerWorkspaceBackupSync(toWorkspace(barFile.fsPath));
|
||||
service.loadSync();
|
||||
assert.deepEqual(service.getWorkspaceBackups(), []);
|
||||
assert.ok(!fs.exists(service.toBackupPath(fooFile.fsPath)));
|
||||
assert.ok(!fs.exists(service.toBackupPath(barFile.fsPath)));
|
||||
assert.ok(!fs.existsSync(service.toBackupPath(fooFile.fsPath)));
|
||||
assert.ok(!fs.existsSync(service.toBackupPath(barFile.fsPath)));
|
||||
|
||||
// 4) backup workspace path points to a workspace that no longer exists
|
||||
// so it should convert the backup worspace to an empty workspace backup
|
||||
const fileBackups = path.join(service.toBackupPath(fooFile.fsPath), 'file');
|
||||
const fileBackups = path.join(service.toBackupPath(fooFile.fsPath), Schemas.file);
|
||||
fs.mkdirSync(service.toBackupPath(fooFile.fsPath));
|
||||
fs.mkdirSync(service.toBackupPath(barFile.fsPath));
|
||||
fs.mkdirSync(fileBackups);
|
||||
|
||||
Reference in New Issue
Block a user