mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
Merge pull request #125754 from microsoft/alex/update-playwright
Update to `playwright@1.11.1`
This commit is contained in:
commit
0c87771e7b
4
.github/workflows/rich-navigation.yml
vendored
4
.github/workflows/rich-navigation.yml
vendored
|
@ -19,9 +19,9 @@ jobs:
|
|||
key: ${{ runner.os }}-dependencies-${{ hashfiles('yarn.lock') }}
|
||||
restore-keys: ${{ runner.os }}-dependencies-
|
||||
|
||||
- uses: actions/setup-node@v1
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 10
|
||||
node-version: 12
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.caching-stage.outputs.cache-hit != 'true'
|
||||
|
|
|
@ -4,11 +4,9 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const path = require("path");
|
||||
const retry_1 = require("./retry");
|
||||
const { installBrowsersWithProgressBar } = require('playwright/lib/install/installer');
|
||||
const playwrightPath = path.dirname(require.resolve('playwright'));
|
||||
async function install() {
|
||||
await retry_1.retry(() => installBrowsersWithProgressBar(playwrightPath));
|
||||
await retry_1.retry(() => installBrowsersWithProgressBar());
|
||||
}
|
||||
install();
|
||||
|
|
|
@ -3,13 +3,11 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as path from 'path';
|
||||
import { retry } from './retry';
|
||||
const { installBrowsersWithProgressBar } = require('playwright/lib/install/installer');
|
||||
const playwrightPath = path.dirname(require.resolve('playwright'));
|
||||
|
||||
async function install() {
|
||||
await retry(() => installBrowsersWithProgressBar(playwrightPath));
|
||||
await retry(() => installBrowsersWithProgressBar());
|
||||
}
|
||||
|
||||
install();
|
||||
|
|
|
@ -178,7 +178,7 @@
|
|||
"opn": "^6.0.0",
|
||||
"optimist": "0.3.5",
|
||||
"p-all": "^1.0.0",
|
||||
"playwright": "1.8.0",
|
||||
"playwright": "1.11.1",
|
||||
"pump": "^1.0.1",
|
||||
"queue": "3.0.6",
|
||||
"rcedit": "^1.1.0",
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
|
||||
import { DEFAULT_LOG_LEVEL, LogLevel, AdapterLogger, ILogger } from 'vs/platform/log/common/log';
|
||||
|
||||
interface IAutomatedWindow {
|
||||
export interface IAutomatedWindow {
|
||||
codeAutomationLog(type: string, args: any[]): void;
|
||||
codeAutomationExit(code: number): void;
|
||||
}
|
||||
|
||||
function logLevelToString(level: LogLevel): string {
|
||||
|
@ -16,7 +17,7 @@ function logLevelToString(level: LogLevel): string {
|
|||
case LogLevel.Info: return 'info';
|
||||
case LogLevel.Warning: return 'warn';
|
||||
case LogLevel.Error: return 'error';
|
||||
case LogLevel.Critical: return 'critical';
|
||||
case LogLevel.Critical: return 'error';
|
||||
}
|
||||
return 'info';
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ import { createStyleSheet } from 'vs/base/browser/dom';
|
|||
import { EncodingMode, ITextFileEditorModel, IResolvedTextFileEditorModel, ITextFileService, isTextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { gotoNextLocation, gotoPreviousLocation } from 'vs/platform/theme/common/iconRegistry';
|
||||
import { Codicon } from 'vs/base/common/codicons';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
|
||||
class DiffActionRunner extends ActionRunner {
|
||||
|
||||
|
@ -1142,7 +1143,7 @@ export class DirtyDiffModel extends Disposable {
|
|||
}
|
||||
|
||||
this.setChanges(changes);
|
||||
});
|
||||
}, (err) => onUnexpectedError(err));
|
||||
}
|
||||
|
||||
private setChanges(changes: IChange[]): void {
|
||||
|
|
|
@ -23,6 +23,11 @@ const isSafari = navigator.vendor && navigator.vendor.indexOf('Apple') > -1 &&
|
|||
navigator.userAgent.indexOf('CriOS') === -1 &&
|
||||
navigator.userAgent.indexOf('FxiOS') === -1;
|
||||
|
||||
const isFirefox = (
|
||||
navigator.userAgent &&
|
||||
navigator.userAgent.indexOf('Firefox') >= 0
|
||||
);
|
||||
|
||||
const searchParams = new URL(location.toString()).searchParams;
|
||||
const ID = searchParams.get('id');
|
||||
const expectedWorkerVersion = parseInt(searchParams.get('swVersion'));
|
||||
|
@ -674,7 +679,9 @@ export async function createWebviewManager(host) {
|
|||
newFrame.setAttribute('id', 'pending-frame');
|
||||
newFrame.setAttribute('frameborder', '0');
|
||||
newFrame.setAttribute('sandbox', options.allowScripts ? 'allow-scripts allow-forms allow-same-origin allow-pointer-lock allow-downloads' : 'allow-same-origin allow-pointer-lock');
|
||||
newFrame.setAttribute('allow', options.allowScripts ? 'clipboard-read; clipboard-write;' : '');
|
||||
if (!isFirefox) {
|
||||
newFrame.setAttribute('allow', options.allowScripts ? 'clipboard-read; clipboard-write;' : '');
|
||||
}
|
||||
// We should just be able to use srcdoc, but I wasn't
|
||||
// seeing the service worker applying properly.
|
||||
// Fake load an empty on the correct origin and then write real html
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { isFirefox } from 'vs/base/browser/browser';
|
||||
import { addDisposableListener } from 'vs/base/browser/dom';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IMenuService } from 'vs/platform/actions/common/actions';
|
||||
|
@ -81,7 +82,9 @@ export class IFrameWebview extends BaseWebview<HTMLIFrameElement> implements Web
|
|||
const element = document.createElement('iframe');
|
||||
element.className = `webview ${options.customClasses || ''}`;
|
||||
element.sandbox.add('allow-scripts', 'allow-same-origin', 'allow-forms', 'allow-pointer-lock', 'allow-downloads');
|
||||
element.setAttribute('allow', 'clipboard-read; clipboard-write;');
|
||||
if (!isFirefox) {
|
||||
element.setAttribute('allow', 'clipboard-read; clipboard-write;');
|
||||
}
|
||||
element.style.border = 'none';
|
||||
element.style.width = '100%';
|
||||
element.style.height = '100%';
|
||||
|
|
|
@ -28,6 +28,7 @@ import { IExtensionManagementService } from 'vs/platform/extensionManagement/com
|
|||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { IExtensionManifestPropertiesService } from 'vs/workbench/services/extensions/common/extensionManifestPropertiesService';
|
||||
import { IUserDataInitializationService } from 'vs/workbench/services/userData/browser/userDataInit';
|
||||
import { IAutomatedWindow } from 'vs/platform/log/browser/log';
|
||||
|
||||
export class ExtensionService extends AbstractExtensionService implements IExtensionService {
|
||||
|
||||
|
@ -220,10 +221,10 @@ export class ExtensionService extends AbstractExtensionService implements IExten
|
|||
// Dispose everything associated with the extension host
|
||||
this.stopExtensionHosts();
|
||||
|
||||
// We log the exit code to the console. Do NOT remove this
|
||||
// code as the automated integration tests in browser rely
|
||||
// on this message to exit properly.
|
||||
console.log(`vscode:exit ${code}`);
|
||||
const automatedWindow = window as unknown as IAutomatedWindow;
|
||||
if (typeof automatedWindow.codeAutomationExit === 'function') {
|
||||
automatedWindow.codeAutomationExit(code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,23 +54,20 @@ async function runTestsInBrowser(browserType: BrowserType, endpoint: url.UrlWith
|
|||
console[type](...args);
|
||||
});
|
||||
|
||||
page.on('console', async (msg: playwright.ConsoleMessage) => {
|
||||
const msgText = msg.text();
|
||||
if (msgText.indexOf('vscode:exit') >= 0) {
|
||||
try {
|
||||
await browser.close();
|
||||
} catch (error) {
|
||||
console.error(`Error when closing browser: ${error}`);
|
||||
}
|
||||
|
||||
try {
|
||||
await pkill(server.pid);
|
||||
} catch (error) {
|
||||
console.error(`Error when killing server process tree: ${error}`);
|
||||
}
|
||||
|
||||
process.exit(msgText === 'vscode:exit 0' ? 0 : 1);
|
||||
await page.exposeFunction('codeAutomationExit', async (code: number) => {
|
||||
try {
|
||||
await browser.close();
|
||||
} catch (error) {
|
||||
console.error(`Error when closing browser: ${error}`);
|
||||
}
|
||||
|
||||
try {
|
||||
await pkill(server.pid);
|
||||
} catch (error) {
|
||||
console.error(`Error when killing server process tree: ${error}`);
|
||||
}
|
||||
|
||||
process.exit(code);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
29
yarn.lock
29
yarn.lock
|
@ -3259,6 +3259,11 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.3, escape-string-regexp@^
|
|||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
||||
|
||||
escape-string-regexp@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344"
|
||||
integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==
|
||||
|
||||
eslint-plugin-jsdoc@^19.1.0:
|
||||
version "19.1.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-19.1.0.tgz#fcc17f0378fdd6ee1c847a79b7211745cb05d014"
|
||||
|
@ -7313,10 +7318,10 @@ pkg-dir@^4.1.0:
|
|||
dependencies:
|
||||
find-up "^4.0.0"
|
||||
|
||||
playwright@1.8.0:
|
||||
version "1.8.0"
|
||||
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.8.0.tgz#8eca2250967ee892b9fdfec44e2358455ab0f8e3"
|
||||
integrity sha512-urMJDLX92KawbkWKrt3chVVBPQsuuNwlS5St7I5YQENXAEItoyUqX7FjiYaoPgXifKqe1+BKC+7pBAq1QUkgSw==
|
||||
playwright@1.11.1:
|
||||
version "1.11.1"
|
||||
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.11.1.tgz#c5f2946db5195bd099a57ce4e188c01057876cff"
|
||||
integrity sha512-UuMrYuvzttbJXUD7sTVcQBsGRojelGepvuQPD+QtVm/n5zyKvkiUErU/DGRXfX8VDZRdQ5D6qVqZndrydC2b4w==
|
||||
dependencies:
|
||||
commander "^6.1.0"
|
||||
debug "^4.1.1"
|
||||
|
@ -7329,7 +7334,9 @@ playwright@1.8.0:
|
|||
proper-lockfile "^4.1.1"
|
||||
proxy-from-env "^1.1.0"
|
||||
rimraf "^3.0.2"
|
||||
stack-utils "^2.0.3"
|
||||
ws "^7.3.1"
|
||||
yazl "^2.5.1"
|
||||
|
||||
plist@^3.0.1:
|
||||
version "3.0.1"
|
||||
|
@ -8869,6 +8876,13 @@ stack-trace@0.0.10:
|
|||
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0"
|
||||
integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=
|
||||
|
||||
stack-utils@^2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.3.tgz#cd5f030126ff116b78ccb3c027fe302713b61277"
|
||||
integrity sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw==
|
||||
dependencies:
|
||||
escape-string-regexp "^2.0.0"
|
||||
|
||||
static-extend@^0.1.1:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"
|
||||
|
@ -10541,6 +10555,13 @@ yazl@^2.2.1, yazl@^2.4.3:
|
|||
dependencies:
|
||||
buffer-crc32 "~0.2.3"
|
||||
|
||||
yazl@^2.5.1:
|
||||
version "2.5.1"
|
||||
resolved "https://registry.yarnpkg.com/yazl/-/yazl-2.5.1.tgz#a3d65d3dd659a5b0937850e8609f22fffa2b5c35"
|
||||
integrity sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==
|
||||
dependencies:
|
||||
buffer-crc32 "~0.2.3"
|
||||
|
||||
yocto-queue@^0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
|
||||
|
|
Loading…
Reference in a new issue