mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
notebook webview test
This commit is contained in:
@@ -689,7 +689,7 @@ suite('regression', () => {
|
||||
|
||||
});
|
||||
|
||||
suite('webview resource uri', () => {
|
||||
suite('webview', () => {
|
||||
test('asWebviewUri', async function () {
|
||||
const resource = vscode.Uri.parse(join(vscode.workspace.rootPath || '', './first.vsctestnb'));
|
||||
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
|
||||
@@ -698,4 +698,23 @@ suite('webview resource uri', () => {
|
||||
assert.equal(uri.scheme, 'vscode-webview-resource');
|
||||
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
|
||||
});
|
||||
|
||||
test('custom renderer message', async function () {
|
||||
const resource = vscode.Uri.parse(join(vscode.workspace.rootPath || '', './customRenderer.vsctestnb'));
|
||||
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
|
||||
|
||||
const editor = vscode.notebook.activeNotebookEditor;
|
||||
const promise = new Promise(resolve => {
|
||||
const messageEmitter = editor?.onDidReceiveMessage(e => {
|
||||
if (e.type === 'custom_renderer_initialize') {
|
||||
resolve();
|
||||
messageEmitter?.dispose();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
await vscode.commands.executeCommand('notebook.cell.execute');
|
||||
await promise;
|
||||
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user