Merge from vscode 1a81711a85e38ccf784110568ebf3784ab9094a5 (#9161)

* Merge from vscode 1a81711a85e38ccf784110568ebf3784ab9094a5

* small spacing fix
This commit is contained in:
Anthony Dresser
2020-02-15 00:43:09 -06:00
committed by GitHub
parent 74b89a0a85
commit 873c6a39fe
78 changed files with 1474 additions and 1011 deletions

View File

@@ -141,10 +141,12 @@ export function connect(engine: 'chromium' | 'webkit' | 'firefox' = 'chromium'):
return new Promise(async (c) => {
const browser = await playwright[engine].launch({
// Run in Edge dev on macOS
// executablePath: '/Applications/Microsoft\ Edge\ Dev.app/Contents/MacOS/Microsoft\ Edge\ Dev'
// executablePath: '/Applications/Microsoft\ Edge\ Dev.app/Contents/MacOS/Microsoft\ Edge\ Dev',
headless: false
});
const page = (await browser.defaultContext().pages())[0];
await page.setViewport({ width, height });
const context = await browser.newContext();
const page = await context.newPage();
await page.setViewportSize({ width, height });
await page.goto(`${endpoint}&folder=vscode-remote://localhost:9888${URI.file(workspacePath!).path}`);
const result = {
client: { dispose: () => browser.close() && teardown() },

View File

@@ -9,6 +9,7 @@
"devDependencies": {
"@types/mkdirp": "0.5.1",
"@types/node": "^12.11.7",
"@types/optimist": "0.0.29",
"@types/rimraf": "2.0.2",
"@types/tmp": "^0.1.0",
"rimraf": "^2.6.1",

View File

@@ -11,8 +11,9 @@ import * as tmp from 'tmp';
import * as rimraf from 'rimraf';
import { URI } from 'vscode-uri';
import * as kill from 'tree-kill';
import * as optimistLib from 'optimist';
const optimist = require('optimist')
const optimist = optimistLib
.describe('workspacePath', 'path to the workspace to open in the test').string('workspacePath')
.describe('extensionDevelopmentPath', 'path to the extension to test').string('extensionDevelopmentPath')
.describe('extensionTestsPath', 'path to the extension tests').string('extensionTestsPath')
@@ -28,11 +29,12 @@ if (optimist.argv.help) {
const width = 1200;
const height = 800;
async function runTestsInBrowser(browserType: string, endpoint: url.UrlWithStringQuery, server: cp.ChildProcess): Promise<void> {
async function runTestsInBrowser(browserType: 'chromium' | 'firefox' | 'webkit', endpoint: url.UrlWithStringQuery, server: cp.ChildProcess): Promise<void> {
const args = process.platform === 'linux' && browserType === 'chromium' ? ['--no-sandbox'] : undefined; // disable sandbox to run chrome on certain Linux distros
const browser = await playwright[browserType].launch({ headless: !Boolean(optimist.argv.debug), dumpio: true, args });
const page = (await browser.defaultContext().pages())[0];
await page.setViewport({ width, height });
const context = await browser.newContext();
const page = await context.newPage();
await page.setViewportSize({ width, height });
const host = endpoint.host;
const protocol = 'vscode-remote';

View File

@@ -38,6 +38,11 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.26.tgz#213e153babac0ed169d44a6d919501e68f59dea9"
integrity sha512-UmUm94/QZvU5xLcUlNR8hA7Ac+fGpO1EG/a8bcWVz0P0LqtxFmun9Y2bbtuckwGboWJIT70DoWq1r3hb56n3DA==
"@types/optimist@0.0.29":
version "0.0.29"
resolved "https://registry.yarnpkg.com/@types/optimist/-/optimist-0.0.29.tgz#a8873580b3a84b69ac1e687323b15fbbeb90479a"
integrity sha1-qIc1gLOoS2msHmhzI7Ffu+uQR5o=
"@types/rimraf@2.0.2":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-2.0.2.tgz#7f0fc3cf0ff0ad2a99bb723ae1764f30acaf8b6e"

View File

@@ -120,7 +120,8 @@ const testModules = (async function () {
async function runTestsInBrowser(testModules, browserType) {
const args = process.platform === 'linux' && browserType === 'chromium' ? ['--no-sandbox'] : undefined; // disable sandbox to run chrome on certain Linux distros
const browser = await playwright[browserType].launch({ headless: !Boolean(argv.debug), dumpio: true, args });
const page = (await browser.defaultContext().pages())[0]
const context = await browser.newContext();
const page = await context.newPage();
const target = url.pathToFileURL(path.join(__dirname, 'renderer.html'));
if (argv.build) {
target.search = `?build=true`;