Skip to content

Commit 54b04f1

Browse files
committed
Patched Android mock messaging
1 parent 0ddcbb0 commit 54b04f1

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

injected/integration-test/page-objects/duckplayer-overlays.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,7 @@ export class DuckplayerOverlays {
309309
await this.build.switch({
310310
android: async () => {
311311
await this.collector.updateMockResponse({
312-
initialSetup: {
313-
locale: 'en',
314-
env: 'development',
315-
platform: { name: 'android ' },
316-
},
312+
initialSetup: {},
317313
});
318314
},
319315
apple: async () => {
@@ -530,7 +526,7 @@ export class DuckplayerOverlays {
530526
await this.build.switch({
531527
android: async () => {
532528
// Android produces a TypeError due to how its messaging lib is wired up
533-
await this.didSendException('TypeError', "undefined is not an object (evaluating 'init2.settings.pip')");
529+
await this.didSendException('TypeError', "Cannot read properties of undefined (reading 'privatePlayerMode')");
534530
},
535531
apple: async () => {
536532
await this.didSendException('InitialSetupError', 'Error: an unknown error occurred');

messaging/lib/test-utils.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ export function mockAndroidMessaging(params) {
305305
),
306306
);
307307

308+
// force a 'tick' to allow tests to reset mocks before reading responses
309+
await new Promise((resolve) => setTimeout(resolve, 0));
310+
308311
// if it's a notification, simulate the empty response and don't check for a response
309312
if (!('id' in msg)) {
310313
return;

0 commit comments

Comments
 (0)