mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Port VS Code telemetry opt-in dialog (#1130)
This commit is contained in:
@@ -96,11 +96,11 @@ suite('Notifications', () => {
|
||||
assert.equal(called, 1);
|
||||
|
||||
called = 0;
|
||||
item1.onDidDispose(() => {
|
||||
item1.onDidClose(() => {
|
||||
called++;
|
||||
});
|
||||
|
||||
item1.dispose();
|
||||
item1.close();
|
||||
assert.equal(called, 1);
|
||||
|
||||
// Error with Action
|
||||
@@ -157,11 +157,11 @@ suite('Notifications', () => {
|
||||
assert.equal(model.notifications.length, 3);
|
||||
|
||||
let called = 0;
|
||||
item1Handle.onDidDispose(() => {
|
||||
item1Handle.onDidClose(() => {
|
||||
called++;
|
||||
});
|
||||
|
||||
item1Handle.dispose();
|
||||
item1Handle.close();
|
||||
assert.equal(called, 1);
|
||||
assert.equal(model.notifications.length, 2);
|
||||
assert.equal(lastEvent.item.severity, item1.severity);
|
||||
@@ -176,7 +176,7 @@ suite('Notifications', () => {
|
||||
assert.equal(lastEvent.index, 0);
|
||||
assert.equal(lastEvent.kind, NotificationChangeType.ADD);
|
||||
|
||||
item2Handle.dispose();
|
||||
item2Handle.close();
|
||||
assert.equal(model.notifications.length, 1);
|
||||
assert.equal(lastEvent.item.severity, item2Duplicate.severity);
|
||||
assert.equal(lastEvent.item.message.value, item2Duplicate.message);
|
||||
|
||||
@@ -9,7 +9,7 @@ import * as assert from 'assert';
|
||||
import { MainThreadMessageService } from 'vs/workbench/api/electron-browser/mainThreadMessageService';
|
||||
import { TPromise as Promise, TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IChoiceService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { INotificationService, INotification, NoOpNotification, INotificationHandle } from 'vs/platform/notification/common/notification';
|
||||
import { INotificationService, INotification, NoOpNotification, INotificationHandle, IPromptChoice, Severity } from 'vs/platform/notification/common/notification';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
|
||||
const emptyChoiceService = new class implements IChoiceService {
|
||||
@@ -41,6 +41,9 @@ const emptyNotificationService = new class implements INotificationService {
|
||||
error(...args: any[]): never {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
prompt(severity: Severity, message: string, choices: IPromptChoice[], onCancel?: () => void): INotificationHandle {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
};
|
||||
|
||||
class EmptyNotificationService implements INotificationService {
|
||||
@@ -64,6 +67,9 @@ class EmptyNotificationService implements INotificationService {
|
||||
error(message: any): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
prompt(severity: Severity, message: string, choices: IPromptChoice[], onCancel?: () => void): INotificationHandle {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
}
|
||||
|
||||
suite('ExtHostMessageService', function () {
|
||||
|
||||
@@ -63,7 +63,7 @@ import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKe
|
||||
import { ITextBufferFactory, DefaultEndOfLine, EndOfLinePreference } from 'vs/editor/common/model';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { IChoiceService, IConfirmation, IConfirmationResult, IConfirmationService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { INotificationService, INotificationHandle, INotification, NoOpNotification } from 'vs/platform/notification/common/notification';
|
||||
import { INotificationService, INotificationHandle, INotification, NoOpNotification, IPromptChoice } from 'vs/platform/notification/common/notification';
|
||||
|
||||
export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput {
|
||||
return instantiationService.createInstance(FileEditorInput, resource, void 0);
|
||||
@@ -331,6 +331,10 @@ export class TestNotificationService implements INotificationService {
|
||||
public notify(notification: INotification): INotificationHandle {
|
||||
return TestNotificationService.NO_OP;
|
||||
}
|
||||
|
||||
public prompt(severity: Severity, message: string, choices: IPromptChoice[], onCancel?: () => void): INotificationHandle {
|
||||
return TestNotificationService.NO_OP;
|
||||
}
|
||||
}
|
||||
|
||||
export class TestConfirmationService implements IConfirmationService {
|
||||
|
||||
Reference in New Issue
Block a user