提交 656183c6 编写于 作者: H hu0475

完成telephony子系统http模块的跨平台测试套

Signed-off-by: Nhu0475 <huyanqiang5@huawei.com>
上级 674079b0
/*
* 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
......
/*
* 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
......
/*
* 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
......
/*
* 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
......
/*
* 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
......
/*
* 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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册