From 5dea81735517ea58265a2f58ad6ae85e51540650 Mon Sep 17 00:00:00 2001 From: Ross Wollman Date: Tue, 9 Aug 2022 10:44:52 -0700 Subject: [PATCH] test: corrupted large string repro (#16369) Repro for #16367. --- tests/page/page-evaluate.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/page/page-evaluate.spec.ts b/tests/page/page-evaluate.spec.ts index 07e8f6b084..9e7ea8695a 100644 --- a/tests/page/page-evaluate.spec.ts +++ b/tests/page/page-evaluate.spec.ts @@ -135,6 +135,19 @@ it('should work with unicode chars', async ({ page }) => { expect(result).toBe(42); }); +it('should work with large strings', async ({ page }) => { + const expected = 'x'.repeat(40000); + expect(await page.evaluate(data => data, expected)).toBe(expected); +}); + +it('should work with large unicode strings', async ({ page, browserName, platform }) => { + it.fail(browserName === 'firefox' && platform !== 'linux'); + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/16367' }); + + const expected = '🎭'.repeat(10000); + expect(await page.evaluate(data => data, expected)).toBe(expected); +}); + it('should throw when evaluation triggers reload', async ({ page }) => { let error = null; await page.evaluate(() => {