Issue 1:
Context:

Playwright Version: playwright-chromium@1.2.1

Operating System: Windows 10 Build 18363.900

Node.js version: 12.18.3

Browser: MS Edge Chromium Version 84.0.522.52 (Official build) (64-bit)

Code Snippet

const EDGE_PATH = require("edge-paths").getEdgePath();
const chromium = require('playwright-chromium').chromium;

const test = async () => {
console.warn('Starting browser');
const browser = await chromium.launch({
executablePath: EDGE_PATH,
headless: true,
// logger: {
//	isEnabled: (name, severity) => {
//	return name === 'protocol';
//	},
//	log: (name, severity, message, args) => console.log(`${name} [${severity}] ${message}`)
// }
});

const pageUrl = 'https://google.com';
const closeBrowser = async timeout => {
return new Promise(resolve => {
setTimeout(async () => {
console.log('Closing browser');
await browser.close();
resolve();
}, timeout);
});
};

const context = await browser.newContext();
const page = await context.newPage();
await page.goto(pageUrl);
await closeBrowser(1000);
};

test();

Describe the bug

Hi!

When I tried to use MS Edge Chromium for testing it crashes on browser closing.

I provided simple script that reproduces my problem.

After browser closing I have console error. This error is due to the "...\AppData\Local\Temp\playwright_chromiumdev_profile-8VPUjL\CrashpadMetrics-active.pma" can't be unlinked.

[Error: EPERM: operation not permitted, unlink '....\AppData\Local\Temp\playwright_chromiumdev_profile-8VPUjL\CrashpadMetrics-active.pma'] {
errno: -4048,
code: 'EPERM',
syscall: 'unlink',
path: '....\\AppData\\Local\\Temp\\playwright_chromiumdev_profile-8VPUjL\\CrashpadMetrics-active.pma'
}

I suppose when playwright-chromium cleans temp folder MS Edge writes crash report there.

The same error appears when browser running in headless mode inside Windows Docker container.

Additionally I see system window with error. This window sais that MS Edge has stopped working.

In case when browser is started with headless=false this problem is not reproduced.

Other interesting thing: when logger with 'protocol' level is attached to the playwright, code often stops on the page.goto() command without any errors.

Issue 2:
Context:

Playwright Version: tested on versions 1.6.1, 1.3.0 and 1.4.0

Operating System:

Edition	Windows 10 Enterprise

Version	20H2

Installed on	‎8/‎20/‎2020

OS build	19042.630

Experience	Windows Feature Experience Pack 120.2212.31.0

Node.js version: v12.10.0

Browser: MS Edge Chromium Version 86.0.622.69

Extra: Jest v. 23.6 on Visual Studio Code

Code Snippet

Help us help you! Put down a short code snippet that illustrates your bug and

that we can run and debug locally. For example:

import { chromium } from "playwright";

import { getEdgePath } from "edge-paths";

jest.setTimeout(10000);
test("Basic Test", async () => {
const browser = await chromium.launch({
headless: false,
executablePath: getEdgePath()
});
const context = await browser.newContext();
const page = await context.newPage();
await page.goto("https://www.google.com");
await page.close();
await context.close();
await browser.close();
});

Describe the bug

If you run this test it will pass but then you will see

console.error node_modules/playwright/lib/server/helper.js:59

[Error: EPERM: operation not permitted, unlink '[userpath]\AppData\Local\Temp\playwright_chromiumdev_profile-IAueWz\CrashpadMetrics-active.pma'] {

errno: -4048,

code: 'EPERM',

syscall: 'unlink',

path: '[userpath]\AppData\Local\Temp\playwright_chromiumdev_profile-IAueWz\CrashpadMetrics-active.pma'

}

This error won't occur if you run the test in head mode.

And if you open task manager you will see two msedge.exe processes that haven't ended <-- This issue is specific to Edge browser I believe