From 1d7a6a1d480a00136b4aa8e7073fca66839c9489 Mon Sep 17 00:00:00 2001 From: hu0475 Date: Sat, 15 Jul 2023 11:40:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90telephony=E5=AD=90=E7=B3=BB?= =?UTF-8?q?=E7=BB=9FConnection=E6=A8=A1=E5=9D=97=E7=9A=84=E8=B7=A8?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=B5=8B=E8=AF=95=E5=A5=97=20=E5=AE=8C?= =?UTF-8?q?=E6=88=90telephony=E5=AD=90=E7=B3=BB=E7=BB=9FWebSocket=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E7=9A=84=E8=B7=A8=E5=B9=B3=E5=8F=B0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hu0475 --- telephony/crossplatform/BUILD.gn | 4 +- .../telephonyConnectionetstest/BUILD.gn | 4 +- .../telephonyWebSocketetstest/BUILD.gn | 4 +- .../src/main/ets/test/WebSocket.test.ets | 66 +++---------------- 4 files changed, 15 insertions(+), 63 deletions(-) diff --git a/telephony/crossplatform/BUILD.gn b/telephony/crossplatform/BUILD.gn index 904065cbb..ee0755c0b 100644 --- a/telephony/crossplatform/BUILD.gn +++ b/telephony/crossplatform/BUILD.gn @@ -16,8 +16,8 @@ group("crossplatform") { testonly = true if (is_standard_system) { deps = [ - "telephonyConnectionetstest:ActsCrossPlatformConnectionTest", - "telephonyWebSocketetstest:ActsCrossPlatformWebSocketTest", + "telephonyConnectionetstest:ActsCrossplatformConnectionTest", + "telephonyWebSocketetstest:ActsCrossplatformWebSocketTest", ] } } diff --git a/telephony/crossplatform/telephonyConnectionetstest/BUILD.gn b/telephony/crossplatform/telephonyConnectionetstest/BUILD.gn index a5895cbef..6f04401f5 100644 --- a/telephony/crossplatform/telephonyConnectionetstest/BUILD.gn +++ b/telephony/crossplatform/telephonyConnectionetstest/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsCrossPlatformConnectionTest") { +ohos_js_hap_suite("ActsCrossplatformConnectionTest") { hap_profile = "src/main/module.json" deps = [ ":windowStage_js_assets", @@ -21,7 +21,7 @@ ohos_js_hap_suite("ActsCrossPlatformConnectionTest") { ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" # hap_name: HAP的名字,可选,默认为目标名 - hap_name = "ActsCrossPlatformConnectionTest" + hap_name = "ActsCrossplatformConnectionTest" subsystem_name = "communication" part_name = "netstack" } diff --git a/telephony/crossplatform/telephonyWebSocketetstest/BUILD.gn b/telephony/crossplatform/telephonyWebSocketetstest/BUILD.gn index 824f40135..b6d19de03 100644 --- a/telephony/crossplatform/telephonyWebSocketetstest/BUILD.gn +++ b/telephony/crossplatform/telephonyWebSocketetstest/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsCrossPlatformWebSocketTest") { +ohos_js_hap_suite("ActsCrossplatformWebSocketTest") { hap_profile = "src/main/module.json" deps = [ ":windowStage_js_assets", @@ -21,7 +21,7 @@ ohos_js_hap_suite("ActsCrossPlatformWebSocketTest") { ets2abc = true certificate_profile = "./signature/openharmony_sx.p7b" # hap_name: HAP的名字,可选,默认为目标名 - hap_name = "ActsCrossPlatformWebSocketTest" + hap_name = "ActsCrossplatformWebSocketTest" subsystem_name = "communication" part_name = "netstack" } diff --git a/telephony/crossplatform/telephonyWebSocketetstest/src/main/ets/test/WebSocket.test.ets b/telephony/crossplatform/telephonyWebSocketetstest/src/main/ets/test/WebSocket.test.ets index e13a06852..27dcc534e 100644 --- a/telephony/crossplatform/telephonyWebSocketetstest/src/main/ets/test/WebSocket.test.ets +++ b/telephony/crossplatform/telephonyWebSocketetstest/src/main/ets/test/WebSocket.test.ets @@ -352,14 +352,14 @@ export default function webSocketTest() { }); /* - * @tc.number: TEST_ON_MESSAGE_001 - * @tc.name : testOn_Message001 + * @tc.number: TEST_ON_OFF_MESSAGE_001 + * @tc.name : testOn_Off_Message001 * @tc.desc : Subscribe to WebSocket received server message events, using callback as an asynchronous method. The maximum length of each message is 4K, and more than 4K automatic fragmentation. * @tc.size : MediumTest * @tc.type : Method * @tc.level : Level 2 */ - it('testOn_Message001', 0, async function (done) { + it('testOn_Off_Message001', 0, async function (done) { let ws = webSocket.createWebSocket(); done(); ws.on('message', (err, value) => { @@ -370,30 +370,14 @@ export default function webSocketTest() { }); /* - * @tc.number: TEST_OFF_MESSAGE_001 - * @tc.name : testOff_Message001 - * @tc.desc : Unsubscribe to WebSocket received server message events, using callback as an asynchronous method. The maximum length of each message is 4K, and more than 4K automatic fragmentation. - * @tc.size : MediumTest - * @tc.type : Method - * @tc.level : Level 2 - */ - it('testOff_Message001', 0, async function (done) { - let ws = webSocket.createWebSocket(); - done(); - ws.on('message'); - ws.off('message'); - expect(true).assertTrue(); - }); - - /* - * @tc.number: TEST_On_CLOSE_001 - * @tc.name : testOn_Close001 + * @tc.number: TEST_On_Off_CLOSE_001 + * @tc.name : testOn_Off_Close001 * @tc.desc : Subscribe to WebSocket shutdown events, using the callback method as an asynchronous method. * @tc.size : MediumTest * @tc.type : Method * @tc.level : Level 2 */ - it('testOn_Close001', 0, async function (done) { + it('testOn_Off_Close001', 0, async function (done) { let ws = webSocket.createWebSocket(); done(); ws.on('close', (err, value) => { @@ -404,30 +388,14 @@ export default function webSocketTest() { }); /* - * @tc.number: TEST_OFF_CLOSE_001 - * @tc.name : testOff_Close001 + * @tc.number: TEST_ON_OFF_ERROR_001 + * @tc.name : testOn_Off_Error001 * @tc.desc : Unsubscribe to WebSocket shutdown events, using the callback method as an asynchronous method. * @tc.size : MediumTest * @tc.type : Method * @tc.level : Level 2 */ - it('testOff_Close001', 0, async function (done) { - let ws = webSocket.createWebSocket(); - done(); - ws.on('close'); - ws.off('close'); - expect(true).assertTrue(); - }); - - /* - * @tc.number: TEST_ON_ERROR_001 - * @tc.name : testOn_Error001 - * @tc.desc : Unsubscribe to WebSocket shutdown events, using the callback method as an asynchronous method. - * @tc.size : MediumTest - * @tc.type : Method - * @tc.level : Level 2 - */ - it('testOn_Error001', 0, async function (done) { + it('testOn_Off_Error001', 0, async function (done) { let ws = webSocket.createWebSocket(); done(); ws.on('error', (err) => { @@ -437,22 +405,6 @@ export default function webSocketTest() { expect(true).assertTrue(); }); - /* - * @tc.number: TEST_OFF_Error_001 - * @tc.name : testOff_Error001 - * @tc.desc : Unsubscribe to WebSocket shutdown events, using the callback method as an asynchronous method. - * @tc.size : MediumTest - * @tc.type : Method - * @tc.level : Level 2 - */ - it('testOff_Error001', 0, async function (done) { - let ws = webSocket.createWebSocket(); - done(); - ws.on('error'); - ws.off('error'); - expect(true).assertTrue(); - }); - }) } \ No newline at end of file -- GitLab