Revert "attempt to lock clipboard"

This reverts commit b659cb07ca.
This commit is contained in:
Konstantinos Kaloutas
2023-03-07 19:40:54 +02:00
committed by Tienson Qin
parent 5d646b67c1
commit f6b9a55cbc
5 changed files with 2 additions and 39 deletions

View File

@@ -1,14 +1,9 @@
import { expect } from '@playwright/test'
import { test } from './fixtures'
import { createRandomPage, enterNextBlock, modKey, lockClipboard } from './utils'
import { createRandomPage, enterNextBlock, modKey } from './utils'
import { dispatch_kb_events } from './util/keyboard-events'
import { UnlockFunction } from 'cross-process-lock';
import * as kb_events from './util/keyboard-events'
let unlock: UnlockFunction;
test.beforeEach(async () => { unlock = await lockClipboard() });
test.afterEach(async () => await unlock());
test('hashtag and quare brackets in same line #4178', async ({ page }) => {
await createRandomPage(page)

View File

@@ -3,8 +3,6 @@ import { expect, ConsoleMessage } from '@playwright/test'
import * as process from 'process'
import { Block } from './types'
import * as pathlib from 'path'
import { lock, UnlockFunction } from 'cross-process-lock';
import { writeFileSync, existsSync } from 'fs';
export const IsMac = process.platform === 'darwin'
export const IsLinux = process.platform === 'linux'
@@ -282,14 +280,3 @@ export async function getIsWebAPIClipboardSupported(page: Page): Promise<boolean
// @ts-ignore "clipboard-write" is not included in TS's type definition for permissionName
return await queryPermission(page, "clipboard-write") && await doesClipboardItemExists(page)
}
// It should lock clipboard tests so that we can run one test at a time.
// Copied from https://github.com/microsoft/playwright/issues/13097#issuecomment-1445271511
export const lockClipboard = async (): Promise<UnlockFunction> => {
const name = 'tmp/clipboard'
if (!existsSync(name))
writeFileSync(name, '', 'utf8')
return await lock(name, { waitTimeout: 30000 })
};

View File

@@ -1,11 +1,6 @@
import { expect } from '@playwright/test'
import { test } from './fixtures'
import { modKey, lockClipboard } from './utils'
import { UnlockFunction } from 'cross-process-lock';
let unlock: UnlockFunction;
test.beforeEach(async () => { unlock = await lockClipboard() });
test.afterEach(async () => await unlock());
import { modKey } from './utils'
test('enable whiteboards', async ({ page }) => {
await expect(page.locator('.nav-header .whiteboard')).toBeHidden()

View File

@@ -14,7 +14,6 @@
"@types/gulp": "^4.0.7",
"autoprefixer": "^10.4.13",
"cross-env": "^7.0.3",
"cross-process-lock": "^2.1.0",
"cssnano": "^5.1.13",
"del": "^6.0.0",
"gulp": "^4.0.2",

View File

@@ -2043,14 +2043,6 @@ cross-env@^7.0.3:
dependencies:
cross-spawn "^7.0.1"
cross-process-lock@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cross-process-lock/-/cross-process-lock-2.1.0.tgz#820c5ad7bfab3ac6ad58366cabfa0b068f277e59"
integrity sha512-aB/oyutqsmkI59L3VNFkvFiiuAvEoczhD2n6Twu5p/zNYUc7hnMNLexiJFGyYBvqSQKIJCjFnC57yqoC8o7UEw==
dependencies:
debug "^4.3.4"
tslib "^2.5.0"
cross-spawn@^6.0.0, cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
@@ -7263,11 +7255,6 @@ tslib@^2.0.1, tslib@^2.1.0, tslib@^2.4.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==
tslib@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf"
integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==
tty-browserify@0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"