From 656183c6bba043966e5a8e1b82408b955d04afa3 Mon Sep 17 00:00:00 2001 From: hu0475 Date: Tue, 11 Jul 2023 23:22:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90telephony=E5=AD=90=E7=B3=BB?= =?UTF-8?q?=E7=BB=9Fhttp=E6=A8=A1=E5=9D=97=E7=9A=84=E8=B7=A8=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E6=B5=8B=E8=AF=95=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hu0475 --- .../main/ets/test/HttpRequestJsunit.test.ets | 2 +- .../test/HttpRequestOptionsJsunit.test.ets | 44 ++++++++++++++++++- .../ets/test/HttpResponseCacheJsunit.test.ets | 2 +- .../main/ets/test/HttpResponseJsunit.test.ets | 2 +- .../ets/test/RequestMethodJsunit.test.ets | 2 +- .../main/ets/test/ResponseCodeJsunit.test.ets | 3 +- 6 files changed, 48 insertions(+), 7 deletions(-) diff --git a/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpRequestJsunit.test.ets b/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpRequestJsunit.test.ets index 73302d70e..16ab0d724 100644 --- a/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpRequestJsunit.test.ets +++ b/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpRequestJsunit.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpRequestOptionsJsunit.test.ets b/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpRequestOptionsJsunit.test.ets index d71612ac9..5b55188aa 100644 --- a/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpRequestOptionsJsunit.test.ets +++ b/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpRequestOptionsJsunit.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -622,6 +622,48 @@ export default function HttpRequestOptionsJsunit() { } }); + /** + * @tc.number TEST_TELEPHONYHTTPREQUESTOPTIONSPRIORITY_002 + * @tc.name testTelephonyHttpRequestOptionsPriority002 + * @tc.desc Test Test HttpRequestOptions property. + * @tc.size: MediumTest + * @tc.type: Method + * @tc.level: level 2 + */ + it("testTelephonyHttpRequestOptionsPriority002", 0, async function (done) { + var casename = 'Telephony_Http_HttpRequestOptions_priority_0100'; + console.log("-----------------------HttpRequestOptions_priority Test is starting-----------------------"); + try { + let httpRequestOptions = { + method: http.RequestMethod.GET, + extraData: { + //tn=albumsdetail&word=渐变风格插画&fr=albumslist&album_tab=设计素材&album_id=409&rn=30 + tn: "albumsdetail", + work: "渐变风格插画", + fr: "albumslist", + album_tab: "设计素材", + album_id: "409", + rn: "30" + }, + header: "content-type': 'application/json", + readTimeout: 60000, + connectTimeout: 60000, + priority: 1000 + } + var httpRequest = http.createHttp(); + httpRequest.request("https://image.baidu.com/search/albumsdetail/", httpRequestOptions, (err, data) => { + console.log(casename + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data.responseCode == 200).assertTrue(); + console.log("-----------------------HttpRequestOptions_extraData Test end-----------------------"); + done(); + }); + } catch (error) { + console.log("testTelephonyHttpRequestOptionsPriority001 : error = " + error); + expect(false).assertTrue(); + done(); + } + }); + /** * @tc.number TEST_TELEPHONY_HTTPREQUESTOPTIONS_USINGPROTOCOL_001 * @tc.name testTelephonyHttpRequestOptionsUsingProtocol001 diff --git a/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpResponseCacheJsunit.test.ets b/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpResponseCacheJsunit.test.ets index 16f31dd0e..7eb13c7d1 100644 --- a/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpResponseCacheJsunit.test.ets +++ b/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpResponseCacheJsunit.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpResponseJsunit.test.ets b/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpResponseJsunit.test.ets index db03a30c3..65a94de4b 100644 --- a/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpResponseJsunit.test.ets +++ b/telephony/crossplatform/telephony_http_test/src/main/ets/test/HttpResponseJsunit.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/telephony/crossplatform/telephony_http_test/src/main/ets/test/RequestMethodJsunit.test.ets b/telephony/crossplatform/telephony_http_test/src/main/ets/test/RequestMethodJsunit.test.ets index 9688cf509..c4f63a404 100644 --- a/telephony/crossplatform/telephony_http_test/src/main/ets/test/RequestMethodJsunit.test.ets +++ b/telephony/crossplatform/telephony_http_test/src/main/ets/test/RequestMethodJsunit.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/telephony/crossplatform/telephony_http_test/src/main/ets/test/ResponseCodeJsunit.test.ets b/telephony/crossplatform/telephony_http_test/src/main/ets/test/ResponseCodeJsunit.test.ets index 2bfd371f2..97f167356 100644 --- a/telephony/crossplatform/telephony_http_test/src/main/ets/test/ResponseCodeJsunit.test.ets +++ b/telephony/crossplatform/telephony_http_test/src/main/ets/test/ResponseCodeJsunit.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the 'License') * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -772,7 +772,6 @@ export default function responseCodeJsunit() { * @tc.type: Enum * @tc.level: level 0 */ - it("testTelephonyHttpResponseCodeUnavailable001", 0, async function (done) { console.log("-----------------------ResponseCode UNAVAILABLE Test is starting-----------------------"); try { -- GitLab