From 2da4915e6b66561b2111820900ced66a66dd0f7a Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Thu, 9 Nov 2023 10:20:36 +0100 Subject: [PATCH] chore: remove sharedId check (#11328) --- packages/puppeteer-core/src/bidi/Serializer.ts | 3 +-- test/TestExpectations.json | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/puppeteer-core/src/bidi/Serializer.ts b/packages/puppeteer-core/src/bidi/Serializer.ts index 643e8405fbc4e..077f3e025b34e 100644 --- a/packages/puppeteer-core/src/bidi/Serializer.ts +++ b/packages/puppeteer-core/src/bidi/Serializer.ts @@ -157,8 +157,7 @@ export class BidiSerializer { if (objectHandle) { if ( objectHandle.realm.environment.context() !== - sandbox.environment.context() && - !('sharedId' in objectHandle.remoteValue()) + sandbox.environment.context() ) { throw new Error( 'JSHandles can be evaluated only in the context they were created!' diff --git a/test/TestExpectations.json b/test/TestExpectations.json index 3ebee477c9450..c3a443596adb1 100644 --- a/test/TestExpectations.json +++ b/test/TestExpectations.json @@ -551,12 +551,6 @@ "parameters": ["cdp"], "expectations": ["FAIL"] }, - { - "testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluate should throw if elementHandles are from other frames", - "platforms": ["darwin", "linux", "win32"], - "parameters": ["webDriverBiDi"], - "expectations": ["FAIL"] - }, { "testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluateOnNewDocument *", "platforms": ["darwin", "linux", "win32"], @@ -1769,6 +1763,18 @@ "parameters": ["cdp", "firefox"], "expectations": ["SKIP"] }, + { + "testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluate should throw if elementHandles are from other frames", + "platforms": ["darwin", "linux", "win32"], + "parameters": ["firefox", "webDriverBiDi"], + "expectations": ["FAIL"] + }, + { + "testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluate should throw if elementHandles are from other frames", + "platforms": ["darwin", "linux", "win32"], + "parameters": ["chrome", "webDriverBiDi"], + "expectations": ["PASS"] + }, { "testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluate should throw when evaluation triggers reload", "platforms": ["darwin", "linux", "win32"],