From 73b6b4caba207900d919ff2afb03b0ed5500bea7 Mon Sep 17 00:00:00 2001 From: Lawrence Forooghian Date: Thu, 20 Jun 2024 15:20:59 -0300 Subject: [PATCH] [UTS] Disable use of bestTransport / availableTransport private APIs This is part of removing some common private API usage for the unified test suite. As mentioned in cfc66aa, client libraries running in unified test suite are expected to only use WebSocket transport. --- test/common/modules/shared_helper.js | 17 +---------------- test/realtime/init.test.js | 3 ++- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/test/common/modules/shared_helper.js b/test/common/modules/shared_helper.js index b07238239..5deb3199f 100644 --- a/test/common/modules/shared_helper.js +++ b/test/common/modules/shared_helper.js @@ -121,25 +121,10 @@ define([ } get availableTransports() { - const helper = this.addingHelperFunction('availableTransports'); - return helper._availableTransports; - } - - get _availableTransports() { - this.recordPrivateApi('call.Utils.keysArray'); - this.recordPrivateApi('call.ConnectionManager.supportedTransports'); - this.recordPrivateApi('read.Realtime._transports'); - return utils.keysArray( - clientModule.Ably.Realtime.ConnectionManager.supportedTransports(clientModule.Ably.Realtime._transports), - ); + return ['web_socket']; } get bestTransport() { - const helper = this.addingHelperFunction('bestTransport'); - return helper._bestTransport; - } - - get _bestTransport() { return this.availableTransports[0]; } diff --git a/test/realtime/init.test.js b/test/realtime/init.test.js index 02dbb732b..79e9844d3 100644 --- a/test/realtime/init.test.js +++ b/test/realtime/init.test.js @@ -403,7 +403,8 @@ define(['ably', 'shared_helper', 'chai'], function (Ably, Helper, chai) { try { realtime = helper.AblyRealtime({ transports: helper.availableTransports }); helper.recordPrivateApi('read.connectionManager.baseTransport'); - expect(realtime.connection.connectionManager.baseTransport).to.equal('comet'); + // There’s no base transport now that we’re only specifiying web_socket + //expect(realtime.connection.connectionManager.baseTransport).to.equal('comet'); helper.recordPrivateApi('read.connectionManager.webSocketTransportAvailable'); expect(realtime.connection.connectionManager.webSocketTransportAvailable).to.be.ok; helper.closeAndFinish(done, realtime);