mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 00:59:03 +01:00
Enable webview tests on remote as well (#102444)
* Enable webview tests on remote as well * Delete conditional test type
This commit is contained in:
@@ -7,7 +7,7 @@ import * as assert from 'assert';
|
||||
import 'mocha';
|
||||
import * as os from 'os';
|
||||
import * as vscode from 'vscode';
|
||||
import { closeAllEditors, conditionalTest, delay, disposeAll } from '../utils';
|
||||
import { closeAllEditors, delay, disposeAll } from '../utils';
|
||||
|
||||
const webviewId = 'myWebview';
|
||||
|
||||
@@ -86,7 +86,7 @@ suite('vscode API - webview', () => {
|
||||
}
|
||||
});
|
||||
|
||||
conditionalTest('webviews should preserve vscode API state when they are hidden', async () => {
|
||||
test('webviews should preserve vscode API state when they are hidden', async () => {
|
||||
const webview = _register(vscode.window.createWebviewPanel(webviewId, 'title', { viewColumn: vscode.ViewColumn.One }, { enableScripts: true }));
|
||||
const ready = getMesssage(webview);
|
||||
webview.webview.html = createHtmlDocumentWithBody(/*html*/`
|
||||
@@ -129,7 +129,7 @@ suite('vscode API - webview', () => {
|
||||
assert.strictEqual(secondResponse.value, 1);
|
||||
});
|
||||
|
||||
conditionalTest('webviews should preserve their context when they are moved between view columns', async () => {
|
||||
test('webviews should preserve their context when they are moved between view columns', async () => {
|
||||
const doc = await vscode.workspace.openTextDocument(testDocument);
|
||||
await vscode.window.showTextDocument(doc, vscode.ViewColumn.One);
|
||||
|
||||
@@ -150,7 +150,7 @@ suite('vscode API - webview', () => {
|
||||
assert.strictEqual(secondResponse.value, 1);
|
||||
});
|
||||
|
||||
conditionalTest('webviews with retainContextWhenHidden should preserve their context when they are hidden', async () => {
|
||||
test('webviews with retainContextWhenHidden should preserve their context when they are hidden', async () => {
|
||||
const webview = _register(vscode.window.createWebviewPanel(webviewId, 'title', { viewColumn: vscode.ViewColumn.One }, { enableScripts: true, retainContextWhenHidden: true }));
|
||||
const ready = getMesssage(webview);
|
||||
|
||||
@@ -172,7 +172,7 @@ suite('vscode API - webview', () => {
|
||||
assert.strictEqual(secondResponse.value, 1);
|
||||
});
|
||||
|
||||
conditionalTest('webviews with retainContextWhenHidden should preserve their page position when hidden', async () => {
|
||||
test('webviews with retainContextWhenHidden should preserve their page position when hidden', async () => {
|
||||
const webview = _register(vscode.window.createWebviewPanel(webviewId, 'title', { viewColumn: vscode.ViewColumn.One }, { enableScripts: true, retainContextWhenHidden: true }));
|
||||
const ready = getMesssage(webview);
|
||||
webview.webview.html = createHtmlDocumentWithBody(/*html*/`
|
||||
@@ -212,7 +212,7 @@ suite('vscode API - webview', () => {
|
||||
assert.strictEqual(Math.round(secondResponse.value), 100);
|
||||
});
|
||||
|
||||
conditionalTest('webviews with retainContextWhenHidden should be able to recive messages while hidden', async () => {
|
||||
test('webviews with retainContextWhenHidden should be able to recive messages while hidden', async () => {
|
||||
const webview = _register(vscode.window.createWebviewPanel(webviewId, 'title', { viewColumn: vscode.ViewColumn.One }, { enableScripts: true, retainContextWhenHidden: true }));
|
||||
const ready = getMesssage(webview);
|
||||
|
||||
@@ -239,7 +239,7 @@ suite('vscode API - webview', () => {
|
||||
});
|
||||
|
||||
|
||||
conditionalTest('webviews should only be able to load resources from workspace by default', async () => {
|
||||
test('webviews should only be able to load resources from workspace by default', async () => {
|
||||
const webview = _register(vscode.window.createWebviewPanel(webviewId, 'title', {
|
||||
viewColumn: vscode.ViewColumn.One
|
||||
}, {
|
||||
@@ -284,7 +284,7 @@ suite('vscode API - webview', () => {
|
||||
}
|
||||
});
|
||||
|
||||
conditionalTest('webviews should allow overriding allowed resource paths using localResourceRoots', async () => {
|
||||
test('webviews should allow overriding allowed resource paths using localResourceRoots', async () => {
|
||||
const webview = _register(vscode.window.createWebviewPanel(webviewId, 'title', { viewColumn: vscode.ViewColumn.One }, {
|
||||
enableScripts: true,
|
||||
localResourceRoots: [workspaceFile('sub')]
|
||||
@@ -312,7 +312,7 @@ suite('vscode API - webview', () => {
|
||||
}
|
||||
});
|
||||
|
||||
conditionalTest('webviews using hard-coded old style vscode-resource uri should work', async () => {
|
||||
test('webviews using hard-coded old style vscode-resource uri should work', async () => {
|
||||
const webview = _register(vscode.window.createWebviewPanel(webviewId, 'title', { viewColumn: vscode.ViewColumn.One }, {
|
||||
enableScripts: true,
|
||||
localResourceRoots: [workspaceFile('sub')]
|
||||
@@ -366,7 +366,7 @@ suite('vscode API - webview', () => {
|
||||
});
|
||||
|
||||
if (os.platform() === 'darwin') {
|
||||
conditionalTest('webview can copy text from webview', async () => {
|
||||
test('webview can copy text from webview', async () => {
|
||||
const expectedText = `webview text from: ${Date.now()}!`;
|
||||
|
||||
const webview = _register(vscode.window.createWebviewPanel(webviewId, 'title', { viewColumn: vscode.ViewColumn.One }, { enableScripts: true, retainContextWhenHidden: true }));
|
||||
|
||||
Reference in New Issue
Block a user