mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-03 01:25:38 -05:00
Merge from vscode 1eb87b0e9ce9886afeaecec22b31abd0d9b7939f (#7282)
* Merge from vscode 1eb87b0e9ce9886afeaecec22b31abd0d9b7939f * fix various icon issues * fix preview features
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
import * as assert from 'assert';
|
||||
|
||||
import { isURLDomainTrusted } from 'vs/workbench/contrib/url/common/url.contribution';
|
||||
import { isURLDomainTrusted } from 'vs/workbench/contrib/url/common/trustedDomainsValidator';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
suite('Link protection domain matching', () => {
|
||||
@@ -32,11 +32,11 @@ suite('Link protection domain matching', () => {
|
||||
|
||||
test('* star', () => {
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://a.x.org'), ['https://*.x.org']));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://a.b.x.org'), ['https://*.x.org']));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://a.x.org'), ['https://a.x.*']));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://a.x.org'), ['https://a.*.org']));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://a.x.org'), ['https://*.*.org']));
|
||||
|
||||
assert.ok(!isURLDomainTrusted(URI.parse('https://a.b.c.org'), ['https://*.*.org']));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://a.b.c.org'), ['https://*.*.*.org']));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://a.b.x.org'), ['https://*.b.*.org']));
|
||||
assert.ok(isURLDomainTrusted(URI.parse('https://a.a.b.x.org'), ['https://*.b.*.org']));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -20,6 +20,10 @@ const emptyDialogService = new class implements IDialogService {
|
||||
confirm(): never {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
|
||||
about(): never {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
};
|
||||
|
||||
const emptyCommandService: ICommandService = {
|
||||
|
||||
@@ -82,10 +82,11 @@ import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedPr
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { WorkbenchEnvironmentService } from 'vs/workbench/services/environment/node/environmentService';
|
||||
import { VSBuffer, VSBufferReadable } from 'vs/base/common/buffer';
|
||||
import { NodeTextFileService } from 'vs/workbench/services/textfile/node/textFileService';
|
||||
import { NativeTextFileService } from 'vs/workbench/services/textfile/electron-browser/nativeTextFileService';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { IProductService } from 'vs/platform/product/common/product';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { IHostService } from 'vs/workbench/services/host/browser/host';
|
||||
|
||||
export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput {
|
||||
return instantiationService.createInstance(FileEditorInput, resource, undefined, undefined);
|
||||
@@ -180,7 +181,7 @@ export class TestContextService implements IWorkspaceContextService {
|
||||
}
|
||||
}
|
||||
|
||||
export class TestTextFileService extends NodeTextFileService {
|
||||
export class TestTextFileService extends NativeTextFileService {
|
||||
public cleanupBackupsBeforeShutdownCalled: boolean;
|
||||
|
||||
private promptPath: URI;
|
||||
@@ -199,7 +200,7 @@ export class TestTextFileService extends NodeTextFileService {
|
||||
@IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService,
|
||||
@INotificationService notificationService: INotificationService,
|
||||
@IBackupFileService backupFileService: IBackupFileService,
|
||||
@IWindowsService windowsService: IWindowsService,
|
||||
@IHostService hostService: IHostService,
|
||||
@IHistoryService historyService: IHistoryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IDialogService dialogService: IDialogService,
|
||||
@@ -219,7 +220,7 @@ export class TestTextFileService extends NodeTextFileService {
|
||||
environmentService,
|
||||
notificationService,
|
||||
backupFileService,
|
||||
windowsService,
|
||||
hostService,
|
||||
historyService,
|
||||
contextKeyService,
|
||||
dialogService,
|
||||
@@ -311,6 +312,7 @@ export function workbenchInstantiationService(): IInstantiationService {
|
||||
instantiationService.stub(IDecorationsService, new TestDecorationsService());
|
||||
instantiationService.stub(IExtensionService, new TestExtensionService());
|
||||
instantiationService.stub(IWindowsService, new TestWindowsService());
|
||||
instantiationService.stub(IHostService, <IHostService>instantiationService.createInstance(TestHostService));
|
||||
instantiationService.stub(ITextFileService, <ITextFileService>instantiationService.createInstance(TestTextFileService));
|
||||
instantiationService.stub(ITextModelService, <ITextModelService>instantiationService.createInstance(TextModelResolverService));
|
||||
instantiationService.stub(IThemeService, new TestThemeService());
|
||||
@@ -402,6 +404,10 @@ export class TestDialogService implements IDialogService {
|
||||
public show(_severity: Severity, _message: string, _buttons: string[], _options?: IDialogOptions): Promise<IShowResult> {
|
||||
return Promise.resolve({ choice: 0 });
|
||||
}
|
||||
|
||||
public about(): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
export class TestFileDialogService implements IFileDialogService {
|
||||
@@ -1345,8 +1351,6 @@ export class TestWindowsService implements IWindowsService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
public windowCount = 1;
|
||||
|
||||
readonly onWindowOpen: Event<number> = Event.None;
|
||||
readonly onWindowFocus: Event<number> = Event.None;
|
||||
readonly onWindowBlur: Event<number> = Event.None;
|
||||
@@ -1486,18 +1490,6 @@ export class TestWindowsService implements IWindowsService {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
|
||||
getWindowCount(): Promise<number> {
|
||||
return Promise.resolve(this.windowCount);
|
||||
}
|
||||
|
||||
log(_severity: string, _args: string[]): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
showItemInFolder(_path: URI): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
newWindowTab(): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
@@ -1553,10 +1545,6 @@ export class TestWindowsService implements IWindowsService {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
|
||||
openAboutDialog(): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
resolveProxy(windowId: number, url: string): Promise<string | undefined> {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
@@ -1642,3 +1630,10 @@ export class RemoteFileSystemProvider implements IFileSystemProvider {
|
||||
}
|
||||
|
||||
export const productService: IProductService = { _serviceBrand: undefined, ...product };
|
||||
|
||||
export class TestHostService implements IHostService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
windowCount = Promise.resolve(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user