diff --git a/compileruntime/convertxml_lib_standard/src/main/js/default/pages/index/index.css b/compileruntime/convertxml_lib_standard/src/main/js/default/pages/index/index.css index 2b1965821483f4f8c8b97c86ef07fe87ea767d01..5bcfb2e8b6d4da7f7cdefb090c3eeaccd70009c9 100644 --- a/compileruntime/convertxml_lib_standard/src/main/js/default/pages/index/index.css +++ b/compileruntime/convertxml_lib_standard/src/main/js/default/pages/index/index.css @@ -1,3 +1,18 @@ +/* + * Copyright (C) 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + .container { flex-direction: column; justify-content: center; diff --git a/compileruntime/convertxml_lib_standard/src/main/js/default/pages/index/index.hml b/compileruntime/convertxml_lib_standard/src/main/js/default/pages/index/index.hml index abeadefb6faa934b6dc51d6bbcf66b765485e5ad..a9e4220170a2effe96285d0feda7d698e2035bf3 100644 --- a/compileruntime/convertxml_lib_standard/src/main/js/default/pages/index/index.hml +++ b/compileruntime/convertxml_lib_standard/src/main/js/default/pages/index/index.hml @@ -1,3 +1,18 @@ + +
{{ $t('strings.hello') }} {{ title }} diff --git a/compileruntime/convertxml_lib_standard/src/main/js/default/pages/index/index.js b/compileruntime/convertxml_lib_standard/src/main/js/default/pages/index/index.js index 1806b5a93ed38eaf1f558d9aa37fd0feac24fa63..e104eaf7a17c519d3227097d9725fec83d8e7850 100644 --- a/compileruntime/convertxml_lib_standard/src/main/js/default/pages/index/index.js +++ b/compileruntime/convertxml_lib_standard/src/main/js/default/pages/index/index.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * Copyright (C) 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/compileruntime/convertxml_lib_standard/src/main/js/test/convertxml.test.js b/compileruntime/convertxml_lib_standard/src/main/js/test/convertxml.test.js index 0db34a21f18a8f74904f4a2a6e2298d97febeb06..f413b6d8a6bb3aa813a3771355cb3ac70eba4eb1 100644 --- a/compileruntime/convertxml_lib_standard/src/main/js/test/convertxml.test.js +++ b/compileruntime/convertxml_lib_standard/src/main/js/test/convertxml.test.js @@ -23,16 +23,16 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert001', 0, function () { - var xml = + let xml = '' + '' + ' Happy' + ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, spaces: 0}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, spaces: 0}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ '"_name":"note",'+ @@ -60,16 +60,16 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert002', 0, function () { - var xml = + let xml = '' + '' + ' Happy ' + ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false,trim :true}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false,trim :true}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ '"_name":"note",'+ @@ -97,16 +97,16 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert003', 0, function () { - var xml = + let xml = '' + '' + ' Happy' + ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreDeclaration: true}); - var str1 = '{"_elements":[{"_type":"element",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, ignoreDeclaration: true}); + let str1 = '{"_elements":[{"_type":"element",'+ '"_name":"note",'+ '"_attributes":{"importance":"high",'+ '"logged":"true"},'+ @@ -132,7 +132,7 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert004', 0, function () { - var xml = + let xml = '' + '' + ' '+ @@ -140,9 +140,9 @@ describe('XmlTest', function () { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreInstruction: true}); - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, ignoreInstruction: true}); + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ '"_name":"note",'+ @@ -171,16 +171,16 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert005', 0, function () { - var xml = + let xml = '' + '' + ' Happy' + ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreAttributes: true}); - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, ignoreAttributes: true}); + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ '"_name":"note",'+ @@ -206,7 +206,7 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert006', 0, function () { - var xml = + let xml = '' + '' + ' '+ @@ -214,9 +214,9 @@ describe('XmlTest', function () { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreComment: true}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, ignoreComment: true}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ '"_name":"note",'+ @@ -244,7 +244,7 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert007', 0, function () { - var xml = + let xml = '' + ''+ '' + @@ -252,9 +252,9 @@ describe('XmlTest', function () { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreComment: true}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, ignoreComment: true}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ '"_name":"note",'+ @@ -282,7 +282,7 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert008', 0, function () { - var xml = + let xml = '' + '' + ' ]]>'+ @@ -290,9 +290,9 @@ describe('XmlTest', function () { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreCDATA: true}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, ignoreCDATA: true}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ '"_name":"note",'+ @@ -320,14 +320,14 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert009', 0, function () { - var xml = + let xml = '' + '' + ' Happy' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, spaces: 4}) - var str = '{\n'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, spaces: 4}) + let str = '{\n'+ ' "_declaration": {\n'+ ' "_attributes": {\n'+ ' "version": "1.0",\n'+ @@ -367,7 +367,7 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert010', 0, function () { - var xml = + let xml = '' + ''+ '' + @@ -375,9 +375,9 @@ describe('XmlTest', function () { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreDoctype: true}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, ignoreDoctype: true}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ '"_name":"note",'+ @@ -405,16 +405,16 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert011', 0, function () { - var xml = + let xml = '' + '' + ' Happy' + ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, ignoreText: true}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, ignoreText: true}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ '"_name":"note",'+ @@ -436,16 +436,16 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert012', 0, function () { - var xml = + let xml = '' + '' + ' Happy' + ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, declarationKey: "123"}) - var str1 = '{"123":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, declarationKey: "123"}) + let str1 = '{"123":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ '"_name":"note",'+ @@ -473,7 +473,7 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert013', 0, function () { - var xml = + let xml = '' + '' + ' '+ @@ -481,9 +481,9 @@ describe('XmlTest', function () { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, instructionKey: "123"}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, instructionKey: "123"}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ '"_name":"note",'+ @@ -514,7 +514,7 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert014', 0, function () { - var xml = + let xml = '' + '' + ' '+ @@ -522,9 +522,9 @@ describe('XmlTest', function () { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, attributesKey: "123"}) - var str1 = '{"_declaration":{"123":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, attributesKey: "123"}) + let str1 = '{"_declaration":{"123":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"123":{"importance":"high",'+ '"logged":"true"},'+ @@ -555,16 +555,16 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert015', 0, function () { - var xml = + let xml = '' + '' + ' Happy' + ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, textKey: "123"}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, textKey: "123"}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ '"_name":"note",'+ @@ -592,7 +592,7 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert016', 0, function () { - var xml = + let xml = '' + '' + ' '+ @@ -600,9 +600,9 @@ describe('XmlTest', function () { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, cdataKey: "123"}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, cdataKey: "123"}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ '"_name":"note",'+ @@ -632,7 +632,7 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert017', 0, function () { - var xml = + let xml = '' + ''+ '' + @@ -640,9 +640,9 @@ describe('XmlTest', function () { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, commentKey: "123"}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, commentKey: "123"}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"123":"note",'+ '"_type":"comment"},'+ @@ -672,7 +672,7 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert018', 0, function () { - var xml = + let xml = '' + '' + ' '+ @@ -680,9 +680,9 @@ describe('XmlTest', function () { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, parentKey: "123"}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, parentKey: "123"}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"element",'+ '"_name":"note",'+ @@ -714,16 +714,16 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert019', 0, function () { - var xml = + let xml = '' + '' + ' Happy' + ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, typeKey: "123"}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, typeKey: "123"}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"123":"element",'+ '"_name":"note",'+ @@ -751,16 +751,16 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert020', 0, function () { - var xml = + let xml = '' + '' + ' Happy' + ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, nameKey: "123"}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, nameKey: "123"}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"123":"note",'+ '"_type":"element",'+ @@ -788,16 +788,16 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert021', 0, function () { - var xml = + let xml = '' + '' + ' Happy' + ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, elementsKey: "123"}) - var str1 = '{"123":[{"123":[{"123":[{"_type":"text",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, elementsKey: "123"}) + let str1 = '{"123":[{"123":[{"123":[{"_type":"text",'+ '"_text":"Happy"}],'+ '"_type":"element",'+ '"_name":"title"},'+ @@ -825,10 +825,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert022', 0, function () { - var xml = ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_declaration":{}}' + let xml = ''; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_declaration":{}}' expect(result1).assertEqual(str1); }) @@ -839,10 +839,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert023', 0, function () { - var xml = ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let xml = ''; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}}}' expect(result1).assertEqual(str1); }) @@ -854,10 +854,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert024', 0, function () { - var xml = '\n'; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_declaration":{},"_elements":[{"_type":"element","_name":"a"}]}' + let xml = '\n'; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_declaration":{},"_elements":[{"_type":"element","_name":"a"}]}' expect(result1).assertEqual(str1); }) @@ -868,10 +868,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert025', 0, function () { - var xml = ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_elements":[{"_type":"instruction",'+ + let xml = ''; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_elements":[{"_type":"instruction",'+ '"_name":"go",'+ '"_instruction":"there"}]}' expect(result1).assertEqual(str1); @@ -884,10 +884,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert026', 0, function () { - var xml = ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_elements":[{"_type":"instruction",'+ + let xml = ''; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_elements":[{"_type":"instruction",'+ '"_name":"go",'+ '"_instruction":"there"},'+ '{"_type":"instruction",'+ @@ -903,10 +903,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert027', 0, function () { - var xml = ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_elements":[{"_type":"comment","_comment":"'+ + let xml = ''; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_elements":[{"_type":"comment","_comment":"'+ ' \t'+ ' Hello '+ 'World! '+ @@ -922,10 +922,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert028', 0, function () { - var xml = '\n'; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_elements":[{"_type":"comment","_comment":"'+ + let xml = '\n'; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_elements":[{"_type":"comment","_comment":"'+ ' \t'+ ' Hello '+ '\t '+ @@ -944,10 +944,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert029', 0, function () { - var xml = ' \t ]]>'; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_elements":[{"_type":"cdata","_cdata":"'+ + let xml = ' \t ]]>'; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_elements":[{"_type":"cdata","_cdata":"'+ ' \t'+ ' '+ '\t '+ @@ -962,10 +962,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert030', 0, function () { - var xml = ' " and & \t ]]>'; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_elements":[{"_type":"cdata","_cdata":"'+ + let xml = ' " and & \t ]]>'; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_elements":[{"_type":"cdata","_cdata":"'+ ' \t'+ ' data"},{"_type":"cdata","_cdata":"< '+ '> '+ @@ -984,10 +984,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert031', 0, function () { - var xml = ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_elements":[{"_type":"element",'+ + let xml = ''; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_elements":[{"_type":"element",'+ '"_name":"a"}]}' expect(result1).assertEqual(str1); }) @@ -999,10 +999,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert032', 0, function () { - var xml = '\n'; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact : false}) - var str1 = '{"_elements":[{"_type":"element",'+ + let xml = '\n'; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact : false}) + let str1 = '{"_elements":[{"_type":"element",'+ '"_name":"a"},'+ '{"_type":"element",'+ '"_name":"a"}]}' @@ -1016,10 +1016,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert033', 0, function () { - var xml = '\n'; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_elements":[{"_type":"element",'+ + let xml = '\n'; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_elements":[{"_type":"element",'+ '"_name":"a"},'+ '{"_type":"element",'+ '"_name":"b"}]}' @@ -1033,10 +1033,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert034', 0, function () { - var xml = ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_elements":[{"_type":"element",'+ + let xml = ''; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_elements":[{"_type":"element",'+ '"_name":"a",'+ '"_attributes":{"x":"hello"}}]}' expect(result1).assertEqual(str1); @@ -1049,10 +1049,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert035', 0, function () { - var xml = ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_elements":[{"_type":"element",'+ + let xml = ''; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_elements":[{"_type":"element",'+ '"_name":"a",'+ '"_attributes":{"x":"1.234",'+ '"y":"It\'s"}}]}' @@ -1066,10 +1066,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert036', 0, function () { - var xml = ' \t Hi \t '; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_elements":[{"_type":"element","_name":"a","_elements":[{"_type":"text","_text":"'+ + let xml = ' \t Hi \t '; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_elements":[{"_type":"element","_name":"a","_elements":[{"_type":"text","_text":"'+ ' \t'+ ' Hi '+ '\t '+ @@ -1084,10 +1084,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert037', 0, function () { - var xml = ' Hi There \t '; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_elements":[{"_type":"element","_name":"a","_elements":[{"_type":"text","_text":"'+ + let xml = ' Hi There \t '; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_elements":[{"_type":"element","_name":"a","_elements":[{"_type":"text","_text":"'+ ' Hi '+ ' There '+ '\t '+ @@ -1102,10 +1102,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert038', 0, function () { - var xml = '\n\v\n'; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_elements":[{"_type":"element",'+ + let xml = '\n\v\n'; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_elements":[{"_type":"element",'+ '"_name":"a",'+ '"_elements":[{"_type":"element",'+ '"_name":"b"}]}]}' @@ -1119,10 +1119,10 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert039', 0, function () { - var xml = '\n\v\n\v\v\n\v\n'; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false}) - var str1 = '{"_elements":[{"_type":"element",'+ + let xml = '\n\v\n\v\v\n\v\n'; + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false}) + let str1 = '{"_elements":[{"_type":"element",'+ '"_name":"a",'+ '"_elements":[{"_type":"element",'+ '"_name":"b",'+ @@ -1138,7 +1138,7 @@ describe('XmlTest', function () { * @tc.author: lihucheng */ it('testConvert040', 0, function () { - var xml = + let xml = '' + ''+ '' + @@ -1146,9 +1146,9 @@ describe('XmlTest', function () { ' Work' + ' Play' + ''; - var convertml = new ConvertXML(); - var result1 = convertml.convert(xml, {compact: false, doctypeKey: 'doctype'}) - var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + let convertml = new ConvertXML(); + let result1 = convertml.convert(xml, {compact: false, doctypeKey: 'doctype'}) + let str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ '"encoding":"utf-8"}},'+ '"_elements":[{"_type":"doctype","doctype":"foo"},'+ '{"_type":"element",'+ diff --git a/compileruntime/process_lib_standard/src/main/js/default/pages/index/index.css b/compileruntime/process_lib_standard/src/main/js/default/pages/index/index.css index 2b1965821483f4f8c8b97c86ef07fe87ea767d01..5bcfb2e8b6d4da7f7cdefb090c3eeaccd70009c9 100644 --- a/compileruntime/process_lib_standard/src/main/js/default/pages/index/index.css +++ b/compileruntime/process_lib_standard/src/main/js/default/pages/index/index.css @@ -1,3 +1,18 @@ +/* + * Copyright (C) 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + .container { flex-direction: column; justify-content: center; diff --git a/compileruntime/process_lib_standard/src/main/js/default/pages/index/index.hml b/compileruntime/process_lib_standard/src/main/js/default/pages/index/index.hml index 20a4e40d9a4ee698bf8e485840457dd43233a376..81d7b7d182db5b6534a7acd9d76c081efd0d268c 100644 --- a/compileruntime/process_lib_standard/src/main/js/default/pages/index/index.hml +++ b/compileruntime/process_lib_standard/src/main/js/default/pages/index/index.hml @@ -1,3 +1,18 @@ + +
{{ $t('strings.hello') }} {{title}} diff --git a/compileruntime/process_lib_standard/src/main/js/test/Process.test.js b/compileruntime/process_lib_standard/src/main/js/test/Process.test.js index 018d91a145a8f1df6c9e0309266f5f33a7fbbafb..f07cc8e8181da7bb730eee848d01d12b1e2a8cf4 100644 --- a/compileruntime/process_lib_standard/src/main/js/test/Process.test.js +++ b/compileruntime/process_lib_standard/src/main/js/test/Process.test.js @@ -23,11 +23,11 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testRunCmd001', 0, async function (done) { - var child = process.runCmd('echo abc') + let child = process.runCmd('echo abc') child.wait() - var array = new Uint8Array([97, 98, 99, 10, 0]) + let array = new Uint8Array([97, 98, 99, 10, 0]) await child.getOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]) } }); @@ -41,11 +41,11 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testRunCmd002', 0, async function (done) { - var child = process.runCmd('echo abc;', { maxBuffer : 2 }) + let child = process.runCmd('echo abc;', { maxBuffer : 2 }) child.wait() - var array = new Uint8Array([97, 98, 0]) + let array = new Uint8Array([97, 98, 0]) await child.getOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]) } }); @@ -59,11 +59,11 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testRunCmd003', 0, async function (done) { - var child = process.runCmd('sleep 5; echo abc;', { timeout : 1, killSignal : 9 }) + let child = process.runCmd('sleep 5; echo abc;', { timeout : 1, killSignal : 9 }) child.wait() - var array = new Uint8Array([0]) + let array = new Uint8Array([0]) await child.getOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]) } }); @@ -78,11 +78,11 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testRunCmd004', 0, async function (done) { - var child = process.runCmd('sleep 2; echo abc;', { timeout : 9000, killSignal : 9 }) + let child = process.runCmd('sleep 2; echo abc;', { timeout : 9000, killSignal : 9 }) child.wait() - var array = new Uint8Array([97, 98, 99, 10, 0]) + let array = new Uint8Array([97, 98, 99, 10, 0]) await child.getOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]) } }); @@ -97,11 +97,11 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testRunCmd005', 0, async function (done) { - var child = process.runCmd('echo abc', { maxBuffer : 1000 }) + let child = process.runCmd('echo abc', { maxBuffer : 1000 }) child.wait() - var array = new Uint8Array([97, 98, 99, 10, 0]) + let array = new Uint8Array([97, 98, 99, 10, 0]) await child.getOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]) } }); @@ -115,11 +115,11 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetOutput001', 0, async function (done) { - var child = process.runCmd('echo bcd;') - var array = new Uint8Array([98, 99, 100, 10, 0]) + let child = process.runCmd('echo bcd;') + let array = new Uint8Array([98, 99, 100, 10, 0]) child.wait(); await child.getOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]) } }); @@ -133,11 +133,11 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetOutput002', 0, async function (done) { - var child = process.runCmd('echo 123;'); - var array = new Uint8Array([49, 50, 51, 10, 0]); + let child = process.runCmd('echo 123;'); + let array = new Uint8Array([49, 50, 51, 10, 0]); child.wait(); await child.getOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]); } }); @@ -151,11 +151,11 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetOutput003', 0, async function (done) { - var child = process.runCmd('echo helloWorld;'); - var array = new Uint8Array([104, 101, 108, 108, 111, 87, 111, 114, 108, 100, 10, 0]); + let child = process.runCmd('echo helloWorld;'); + let array = new Uint8Array([104, 101, 108, 108, 111, 87, 111, 114, 108, 100, 10, 0]); child.wait(); await child.getOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]); } }); @@ -169,11 +169,11 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetOutput004', 0, async function (done) { - var child = process.runCmd('echo 浣犲�?'); - var array = new Uint8Array([230, 181, 163, 231, 138, 178, 239, 191, 189, 63, 10, 0]); + let child = process.runCmd('echo 浣犲�?'); + let array = new Uint8Array([230, 181, 163, 231, 138, 178, 239, 191, 189, 63, 10, 0]); child.wait(); await child.getOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]); } }); @@ -187,11 +187,11 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetOutput005', 0, async function (done) { - var child = process.runCmd('echo ~_~;'); - var array = new Uint8Array([126, 95, 126, 10, 0]); + let child = process.runCmd('echo ~_~;'); + let array = new Uint8Array([126, 95, 126, 10, 0]); child.wait(); await child.getOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]); } }); @@ -205,12 +205,12 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetErrorOutput001', 0, async function (done) { - var child = process.runCmd('makdir 1.txt') + let child = process.runCmd('makdir 1.txt') child.wait() - var array = new Uint8Array([115, 104, 58, 32, 109, 97, 107, 100, 105, 114, 58, 32, 105, 110, 97, 99, 99, + let array = new Uint8Array([115, 104, 58, 32, 109, 97, 107, 100, 105, 114, 58, 32, 105, 110, 97, 99, 99, 101, 115, 115, 105, 98, 108, 101, 32, 111, 114, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 10, 0]) await child.getErrorOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]) } }); @@ -224,11 +224,11 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetErrorOutput002', 0, async function (done) { - var child = process.runCmd('echo "error" 1>&2') + let child = process.runCmd('echo "error" 1>&2') child.wait() - var array = new Uint8Array([101, 114, 114, 111, 114, 10, 0]) + let array = new Uint8Array([101, 114, 114, 111, 114, 10, 0]) await child.getErrorOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]) } }); @@ -242,12 +242,12 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetErrorOutput003', 0, async function (done) { - var child = process.runCmd('1') + let child = process.runCmd('1') child.wait() - var array = new Uint8Array([115, 104, 58, 32, 49, 58, 32, 105, 110, 97, 99, 99, 101, 115, 115, 105, 98, + let array = new Uint8Array([115, 104, 58, 32, 49, 58, 32, 105, 110, 97, 99, 99, 101, 115, 115, 105, 98, 108, 101, 32, 111, 114, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 10, 0]) await child.getErrorOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]) } }); @@ -261,12 +261,12 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetErrorOutput004', 0, async function (done) { - var child = process.runCmd('chmod 777 123') - var array = new Uint8Array([99, 104, 109, 111, 100, 58, 32, 49, 50, 51, 58, 32, 78, 111, 32, 115, 117, 99, + let child = process.runCmd('chmod 777 123') + let array = new Uint8Array([99, 104, 109, 111, 100, 58, 32, 49, 50, 51, 58, 32, 78, 111, 32, 115, 117, 99, 104, 32, 102, 105, 108, 101, 32, 111, 114, 32, 100, 105, 114, 101, 99, 116, 111, 114, 121, 10, 0]); child.wait(); await child.getErrorOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]) } }); @@ -280,12 +280,12 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetErrorOutput005', 0, async function (done) { - var child = process.runCmd('cp ./1 ./2') - var array = new Uint8Array([99, 112, 58, 32, 98, 97, 100, 32, 39, 46, 47, 49, 39, 58, 32, 78, 111, 32, 115, + let child = process.runCmd('cp ./1 ./2') + let array = new Uint8Array([99, 112, 58, 32, 98, 97, 100, 32, 39, 46, 47, 49, 39, 58, 32, 78, 111, 32, 115, 117, 99, 104, 32, 102, 105, 108, 101, 32, 111, 114, 32, 100, 105, 114, 101, 99, 116, 111, 114, 121, 10, 0]) child.wait(); await child.getErrorOutput().then(val=>{ - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { expect(val[i]).assertEqual(array[i]) } }); @@ -299,7 +299,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testWait001', 0, async function (done) { - var child = process.runCmd('ls') + let child = process.runCmd('ls') await child.wait().then(val=>{ expect(val).assertEqual(0) }); @@ -313,7 +313,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testWait002', 0, async function (done) { - var child = process.runCmd('ls; sleep 5;') + let child = process.runCmd('ls; sleep 5;') child.kill(9); await child.wait().then(val=>{ expect(val).assertEqual(9) @@ -328,7 +328,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testWait003', 0, async function (done) { - var child = process.runCmd('echo helloWorld'); + let child = process.runCmd('echo helloWorld'); await child.wait().then(val=>{ expect(val).assertEqual(0); }); @@ -342,7 +342,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testWait004', 0, async function (done) { - var child = process.runCmd('mkdir 123'); + let child = process.runCmd('mkdir 123'); await child.wait().then(val=>{ expect(val).assertEqual(0); }); @@ -356,7 +356,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testWait005', 0, async function (done) { - var child = process.runCmd('sleep 5; echo abc;', { timeout : 1, killSignal : 9 }); + let child = process.runCmd('sleep 5; echo abc;', { timeout : 1, killSignal : 9 }); await child.wait().then(val=>{ expect(val).assertEqual(9); }); @@ -370,9 +370,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testchildPid001', 0, function () { - var child = process.runCmd('ls; sleep 5;') + let child = process.runCmd('ls; sleep 5;') child.wait() - var pid_ = child.pid + let pid_ = child.pid expect(pid_ > 0).assertEqual(true) }) @@ -383,9 +383,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPid002', 0, function () { - var child = process.runCmd('mkdir test.cpp') + let child = process.runCmd('mkdir test.cpp') child.wait() - var pid_ = child.pid + let pid_ = child.pid expect(pid_ > 0).assertEqual(true) }) @@ -396,9 +396,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPid003', 0, function () { - var child = process.runCmd('each abc') + let child = process.runCmd('each abc') child.wait() - var pid_ = child.pid + let pid_ = child.pid expect(pid_ > 0).assertEqual(true) }) @@ -409,9 +409,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPid004', 0, function () { - var child = process.runCmd('cd ..') + let child = process.runCmd('cd ..') child.wait() - var pid_ = child.pid + let pid_ = child.pid expect(pid_ > 0).assertEqual(true) }) @@ -422,9 +422,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPid005', 0, function () { - var child = process.runCmd('adc') + let child = process.runCmd('adc') child.wait() - var pid_ = child.pid + let pid_ = child.pid expect(pid_ > 0).assertEqual(true) }) @@ -435,9 +435,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPpid001', 0, function () { - var child = process.runCmd('ls; sleep 5;') - var status = child.wait() - var ppid_ = child.ppid + let child = process.runCmd('ls; sleep 5;') + let status = child.wait() + let ppid_ = child.ppid expect(ppid_ > 0).assertEqual(true) }) @@ -448,9 +448,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPpid002', 0, function () { - var child = process.runCmd('mkdir test.cpp') + let child = process.runCmd('mkdir test.cpp') child.wait() - var ppid_ = child.ppid + let ppid_ = child.ppid expect(ppid_ > 0).assertEqual(true) }) @@ -461,9 +461,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPpid003', 0, function () { - var child = process.runCmd('each abc') + let child = process.runCmd('each abc') child.wait() - var ppid_ = child.ppid + let ppid_ = child.ppid expect(ppid_ > 0).assertEqual(true) }) @@ -474,9 +474,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPpid004', 0, function () { - var child = process.runCmd('cd ..') + let child = process.runCmd('cd ..') child.wait() - var ppid_ = child.ppid + let ppid_ = child.ppid expect(ppid_ > 0).assertEqual(true) }) @@ -487,9 +487,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPpid005', 0, function () { - var child = process.runCmd('adc') + let child = process.runCmd('adc') child.wait() - var ppid_ = child.ppid + let ppid_ = child.ppid expect(ppid_ > 0).assertEqual(true) }) @@ -500,9 +500,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKill001', 0, function () { - var child = process.runCmd('ls; sleep 5s;') - var result = child.kill(13) - var temp = child.killed + let child = process.runCmd('ls; sleep 5s;') + let result = child.kill(13) + let temp = child.killed expect(temp).assertEqual(true) }) @@ -513,9 +513,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKill002', 0, function () { - var child = process.runCmd('ls; sleep 5s;') - var result = child.kill(1) - var temp = child.killed + let child = process.runCmd('ls; sleep 5s;') + let result = child.kill(1) + let temp = child.killed expect(temp).assertEqual(true) }) @@ -526,9 +526,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKill003', 0, function () { - var child = process.runCmd('ls; sleep 5s;') - var result = child.kill('SIGHUP') - var temp = child.killed + let child = process.runCmd('ls; sleep 5s;') + let result = child.kill('SIGHUP') + let temp = child.killed expect(temp).assertEqual(true) }) @@ -539,9 +539,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKill004', 0, function () { - var child = process.runCmd('ls; sleep 5s;') - var result = child.kill('ABC') - var temp = child.killed + let child = process.runCmd('ls; sleep 5s;') + let result = child.kill('ABC') + let temp = child.killed expect(temp).assertEqual(true) }) @@ -552,10 +552,10 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKill005', 0, function () { - var child = process.runCmd('ls') + let child = process.runCmd('ls') child.wait() - var result = child.kill(9) - var temp = child.killed + let result = child.kill(9) + let temp = child.killed expect(temp).assertEqual(false) }) @@ -566,8 +566,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testClose001', 0, function () { - var child = process.runCmd('ls; sleep 5s;') - var result = child.close() + let child = process.runCmd('ls; sleep 5s;') + let result = child.close() expect(child.exitCode).assertEqual(9) }) @@ -578,12 +578,12 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testClose002', 0, function () { - var child = process.runCmd('ls') + let child = process.runCmd('ls') function sleep(ms, callback) { setTimeout(callback, ms) } sleep(1000, () => {} ) - var result = child.close() + let result = child.close() expect(child.exitCode === 0).assertEqual(false) }) @@ -594,9 +594,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testClose003', 0, function () { - var child = process.runCmd('ls;') - var status = child.wait() - var result = child.close() + let child = process.runCmd('ls;') + let status = child.wait() + let result = child.close() expect(child.exitCode).assertEqual(0) }) @@ -607,8 +607,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testClose004', 0, function () { - var child = process.runCmd('ls') - var result = child.close() + let child = process.runCmd('ls') + let result = child.close() expect(child.exitCode).assertEqual(9) }) @@ -619,9 +619,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testClose005', 0, function () { - var child = process.runCmd('sleep 5; echo A') - var result = child.close() - var status = child.wait() + let child = process.runCmd('sleep 5; echo A') + let result = child.close() + let status = child.wait() expect(child.exitCode).assertEqual(9) }) @@ -632,9 +632,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKilled001', 0, function () { - var child = process.runCmd('ls; sleep 1s;') - var result = child.kill(3) - var temp = child.killed + let child = process.runCmd('ls; sleep 1s;') + let result = child.kill(3) + let temp = child.killed expect(temp).assertEqual(true) }) @@ -645,9 +645,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKilled002', 0, function () { - var child = process.runCmd('ls; sleep 1s;') - var result = child.close() - var temp = child.killed + let child = process.runCmd('ls; sleep 1s;') + let result = child.close() + let temp = child.killed expect(temp).assertEqual(false) }) @@ -658,10 +658,10 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKilled003', 0, function () { - var child = process.runCmd('ls; sleep 1s;') - var status = child.wait() - var result = child.kill(9) - var temp = child.killed + let child = process.runCmd('ls; sleep 1s;') + let status = child.wait() + let result = child.kill(9) + let temp = child.killed expect(temp).assertEqual(false) }) @@ -672,9 +672,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKilled004', 0, function () { - var child = process.runCmd('ls; sleep 5s;') - var result = child.kill('SIGHUP') - var temp = child.killed + let child = process.runCmd('ls; sleep 5s;') + let result = child.kill('SIGHUP') + let temp = child.killed expect(temp).assertEqual(true) }) @@ -685,9 +685,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKilled005', 0, function () { - var child = process.runCmd('ls; sleep 5s;') - var result = child.kill('1') - var temp = child.killed + let child = process.runCmd('ls; sleep 5s;') + let result = child.kill('1') + let temp = child.killed expect(temp).assertEqual(true) }) @@ -698,10 +698,10 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testExitCode001', 0, function () { - var child = process.runCmd('ls; sleep 5s;') - var temp = child.kill(9) + let child = process.runCmd('ls; sleep 5s;') + let temp = child.kill(9) child.wait() - var result = child.exitCode + let result = child.exitCode expect(result).assertEqual(9) }) @@ -712,9 +712,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testExitCode002', 0, function () { - var child = process.runCmd('ls;') + let child = process.runCmd('ls;') child.wait() - var result = child.exitCode + let result = child.exitCode expect(result).assertEqual(0) }) @@ -725,10 +725,10 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testExitCode003', 0, function () { - var child = process.runCmd('ls; sleep 5s;') + let child = process.runCmd('ls; sleep 5s;') child.close() child.wait() - var result = child.exitCode + let result = child.exitCode expect(result).assertEqual(9) }) @@ -739,10 +739,10 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testExitCode004', 0, function () { - var child = process.runCmd('ls') - var temp = child.kill('ABCD') + let child = process.runCmd('ls') + let temp = child.kill('ABCD') child.close() - var result = child.exitCode + let result = child.exitCode expect(result).assertEqual(0) }) @@ -753,9 +753,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testExitCode005', 0, function () { - var child = process.runCmd('echo A') - var result= child.wait() - var status = child.close() + let child = process.runCmd('echo A') + let result= child.wait() + let status = child.close() expect(child.exitCode).assertEqual(0) }) @@ -766,7 +766,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetUid001', 0, function () { - var result = process.uid + let result = process.uid if(result > 0) { var flag = true } @@ -780,8 +780,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetUid002', 0, function () { - for(var i = 0; i < 3; i++){ - var result = process.uid + for(let i = 0; i < 3; i++){ + let result = process.uid if(result != null) { if(result > 0) { var flag = true @@ -798,8 +798,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetUid003', 0, function () { - for(var i = 0; i < 6; i++){ - var result = process.uid + for(let i = 0; i < 6; i++){ + let result = process.uid if(result != null) { if(result > 0) { var flag = true @@ -816,8 +816,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetUid004', 0, function () { - for(var i = 0; i < 8; i++){ - var result = process.uid + for(let i = 0; i < 8; i++){ + let result = process.uid if(result != null) { if(result > 0) { var flag = true @@ -834,8 +834,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetUid005', 0, function () { - for(var i = 0; i < 5; i++){ - var result = process.uid + for(let i = 0; i < 5; i++){ + let result = process.uid if(result != null) { if(result > 0) { var flag = true @@ -852,7 +852,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetGid001', 0, function () { - var result = process.gid + let result = process.gid if(result > 0) { var flag = true } @@ -866,8 +866,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetGid002', 0, function () { - for(var i = 0; i < 3; i++){ - var result = process.gid + for(let i = 0; i < 3; i++){ + let result = process.gid if(result != null) { if(result > 0) { var flag = true @@ -884,8 +884,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetGid003', 0, function () { - for(var i = 0; i < 5; i++){ - var result = process.gid + for(let i = 0; i < 5; i++){ + let result = process.gid if(result != null) { if(result > 0) { var flag = true @@ -902,8 +902,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetGid004', 0, function () { - for(var i = 0; i < 6; i++){ - var result = process.gid + for(let i = 0; i < 6; i++){ + let result = process.gid if(result != null) { if(result > 0) { var flag = true @@ -920,8 +920,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetGid005', 0, function () { - for(var i = 0; i < 8; i++){ - var result = process.gid + for(let i = 0; i < 8; i++){ + let result = process.gid if(result != null) { if(result > 0) { var flag = true @@ -938,7 +938,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetEuid001', 0, function () { - var result = process.euid + let result = process.euid if(result > 0) { var flag = true } @@ -952,8 +952,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetEuid002', 0, function () { - for(var i = 0; i < 3; i++){ - var result = process.euid + for(let i = 0; i < 3; i++){ + let result = process.euid if(result != null) { if(result > 0) { var flag = true @@ -970,8 +970,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetEuid003', 0, function () { - for(var i = 0; i < 5; i++){ - var result = process.euid + for(let i = 0; i < 5; i++){ + let result = process.euid if(result != null) { if(result > 0) { var flag = true @@ -988,8 +988,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetEuid004', 0, function () { - for(var i = 0; i < 6; i++){ - var result = process.euid + for(let i = 0; i < 6; i++){ + let result = process.euid if(result != null) { if(result > 0) { var flag = true @@ -1006,8 +1006,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetEuid005', 0, function () { - for(var i = 0; i < 8; i++){ - var result = process.euid + for(let i = 0; i < 8; i++){ + let result = process.euid if(result != null) { if(result > 0) { var flag = true @@ -1024,7 +1024,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetEgid001', 0, function () { - var result = process.egid + let result = process.egid if(result > 0) { var flag = true } @@ -1038,8 +1038,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetEgid002', 0, function () { - for(var i = 0; i < 3; i++){ - var result = process.egid + for(let i = 0; i < 3; i++){ + let result = process.egid if(result != null) { if(result > 0) { var flag = true @@ -1056,8 +1056,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetEgid003', 0, function () { - for(var i = 0; i < 5; i++){ - var result = process.egid + for(let i = 0; i < 5; i++){ + let result = process.egid if(result != null) { if(result > 0) { var flag = true @@ -1074,8 +1074,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetEgid004', 0, function () { - for(var i = 0; i < 6; i++){ - var result = process.egid + for(let i = 0; i < 6; i++){ + let result = process.egid if(result != null) { if(result > 0) { var flag = true @@ -1092,8 +1092,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetEgid005', 0, function () { - for(var i = 0; i < 8; i++){ - var result = process.egid + for(let i = 0; i < 8; i++){ + let result = process.egid if(result != null) { if(result > 0) { var flag = true @@ -1110,8 +1110,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetGroups001', 0, function () { - var result = process.groups - var len = result.length + let result = process.groups + let len = result.length if(len > 0) { var flag = true } @@ -1125,10 +1125,10 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetGroups002', 0, function () { - for(var i = 0; i < 3; i++){ - var result = process.groups + for(let i = 0; i < 3; i++){ + let result = process.groups if(result != null) { - var len = result.length + let len = result.length if(len > 0) { var flag = true } @@ -1144,10 +1144,10 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetGroups003', 0, function () { - for(var i = 0; i < 5; i++){ - var result = process.groups + for(let i = 0; i < 5; i++){ + let result = process.groups if(result != null) { - var len = result.length + let len = result.length if(len > 0) { var flag = true } @@ -1163,10 +1163,10 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetGroups004', 0, function () { - for(var i = 0; i < 6; i++){ - var result = process.groups + for(let i = 0; i < 6; i++){ + let result = process.groups if(result != null) { - var len = result.length + let len = result.length if(len > 0) { var flag = true } @@ -1182,10 +1182,10 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testGetGroups005', 0, function () { - for(var i = 0; i < 8; i++){ - var result = process.groups + for(let i = 0; i < 8; i++){ + let result = process.groups if(result != null) { - var len = result.length + let len = result.length if(len > 0) { var flag = true } @@ -1201,8 +1201,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testChdir001', 0, function () { - var result = process.chdir('/system') - var result1 = process.cwd() + let result = process.chdir('/system') + let result1 = process.cwd() expect(result1).assertEqual('/system') }) @@ -1213,8 +1213,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testChdir002', 0, function () { - var result = process.chdir('/system/lib') - var result1 = process.cwd() + let result = process.chdir('/system/lib') + let result1 = process.cwd() expect(result1).assertEqual('/system/lib') }) @@ -1225,8 +1225,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testChdir003', 0, function () { - var result = process.chdir('/..') - var result1 = process.cwd() + let result = process.chdir('/..') + let result1 = process.cwd() expect(result1).assertEqual('/') }) @@ -1237,8 +1237,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testChdir004', 0, function () { - var result = process.chdir('/system/app') - var result1 = process.cwd() + let result = process.chdir('/system/app') + let result1 = process.cwd() expect(result1).assertEqual('/system/app') }) @@ -1249,8 +1249,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testChdir005', 0, function () { - var result = process.chdir('/data') - var result1 = process.cwd() + let result = process.chdir('/data') + let result1 = process.cwd() expect(result1).assertEqual('/data') }) @@ -1261,7 +1261,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKill001', 0, function () { - var result = process.kill(3, 123) + let result = process.kill(3, 123) expect(result).assertEqual(false) }) @@ -1272,8 +1272,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKill002', 0, function () { - var pres = process.pid - var result = process.kill(23, pres) + let pres = process.pid + let result = process.kill(23, pres) expect(result).assertEqual(true) }) @@ -1284,8 +1284,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKill003', 0, function () { - var pres = process.pid - var result = process.kill(28, pres) + let pres = process.pid + let result = process.kill(28, pres) expect(result).assertEqual(true) }) @@ -1296,8 +1296,8 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKill004', 0, function () { - var pres = process.pid - var result = process.kill(17, pres) + let pres = process.pid + let result = process.kill(17, pres) expect(result).assertEqual(true) }) @@ -1308,7 +1308,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testKill005', 0, function () { - var result = process.kill(3, 113) + let result = process.kill(3, 113) expect(result).assertEqual(false) }) @@ -1319,12 +1319,12 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testUptime001', 0, function () { - var result1 = process.uptime() + let result1 = process.uptime() function sleep(d){ while(process.uptime() - result1 <= d); } sleep(5); - var result2 = process.uptime() - 6 + let result2 = process.uptime() - 6 expect(result1).assertEqual(result2) }) @@ -1340,7 +1340,7 @@ describe('ChildProcessTest', function () { while(process.uptime() - result1 <= d); } sleep(8); - var result2 = process.uptime() - 9 + let result2 = process.uptime() - 9 expect(result1).assertEqual(result2) }) @@ -1351,12 +1351,12 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testUptime003', 0, function () { - var result1 = process.uptime() + let result1 = process.uptime() function sleep(d){ while(process.uptime() - result1 <= d); } sleep(10); - var result2 = process.uptime() - 11 + let result2 = process.uptime() - 11 expect(result1).assertEqual(result2) }) @@ -1367,12 +1367,12 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testUptime004', 0, function () { - var result1 = process.uptime() + let result1 = process.uptime() function sleep(d){ while(process.uptime() - result1 <= d); } sleep(7); - var result2 = process.uptime() - 8 + let result2 = process.uptime() - 8 expect(result1).assertEqual(result2) }) @@ -1399,7 +1399,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPid001', 0, function () { - var result = process.pid + let result = process.pid if(result > 0) { var flag = true } @@ -1413,9 +1413,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPid002', 0, function () { - for(var i = 0; i < 3; i++) + for(let i = 0; i < 3; i++) { - var result = process.pid + let result = process.pid if(result > 0) { var flag = true } @@ -1430,9 +1430,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPid003', 0, function () { - for(var i = 0; i < 5; i++) + for(let i = 0; i < 5; i++) { - var result = process.pid + let result = process.pid if(result > 0) { var flag = true } @@ -1447,9 +1447,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPid004', 0, function () { - for(var i = 0; i < 6; i++) + for(let i = 0; i < 6; i++) { - var result = process.pid + let result = process.pid if(result > 0) { var flag = true } @@ -1464,9 +1464,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPid005', 0, function () { - for(var i = 0; i < 8; i++) + for(let i = 0; i < 8; i++) { - var result = process.pid + let result = process.pid if(result > 0) { var flag = true } @@ -1481,7 +1481,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPpid001', 0, function () { - var result = process.ppid + let result = process.ppid if(result > 0) { var flag = true } @@ -1495,9 +1495,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPpid002', 0, function () { - for(var i = 0; i < 3; i++) + for(let i = 0; i < 3; i++) { - var result = process.ppid + let result = process.ppid if(result > 0) { var flag = true } @@ -1512,9 +1512,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPpid003', 0, function () { - for(var i = 0; i < 5; i++) + for(let i = 0; i < 5; i++) { - var result = process.ppid + let result = process.ppid if(result > 0) { var flag = true } @@ -1529,9 +1529,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPpid004', 0, function () { - for(var i = 0; i < 6; i++) + for(let i = 0; i < 6; i++) { - var result = process.ppid + let result = process.ppid if(result > 0) { var flag = true } @@ -1546,9 +1546,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testPpid005', 0, function () { - for(var i = 0; i < 8; i++) + for(let i = 0; i < 8; i++) { - var result = process.ppid + let result = process.ppid if(result > 0) { var flag = true } @@ -1563,7 +1563,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testCwd001', 0, function () { - var cwdir = process.cwd() + let cwdir = process.cwd() if(cwdir){ var flag = true } @@ -1577,9 +1577,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testCwd002', 0, function () { - for(var i = 0; i < 3; i++) + for(let i = 0; i < 3; i++) { - var cwdir = process.cwd() + let cwdir = process.cwd() if(cwdir){ var flag = true } @@ -1594,9 +1594,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testCwd003', 0, function () { - for(var i = 0; i < 5; i++) + for(let i = 0; i < 5; i++) { - var cwdir = process.cwd() + let cwdir = process.cwd() if(cwdir){ var flag = true } @@ -1611,9 +1611,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testCwd004', 0, function () { - for(var i = 0; i < 6; i++) + for(let i = 0; i < 6; i++) { - var cwdir = process.cwd() + let cwdir = process.cwd() if(cwdir){ var flag = true } @@ -1628,9 +1628,9 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testCwd005', 0, function () { - for(var i = 0; i < 8; i++) + for(let i = 0; i < 8; i++) { - var cwdir = process.cwd() + let cwdir = process.cwd() if(cwdir){ var flag = true } @@ -1646,9 +1646,9 @@ describe('ChildProcessTest', function () { */ it('testOn001', 0, function () { function add(){ - var value = 3 + 2 + let value = 3 + 2 } - var ontest = process.on(1, add) + let ontest = process.on(1, add) expect(ontest).assertEqual(false) }) @@ -1660,9 +1660,9 @@ describe('ChildProcessTest', function () { */ it('testOn002', 0, function () { function add1(num){ - var value = num + 3 + let value = num + 3 } - var on = process.on("add123", add1) + let on = process.on("add123", add1) }) /** @@ -1673,9 +1673,9 @@ describe('ChildProcessTest', function () { */ it('testOn003', 0, function () { function add2(num0, num1){ - var value = num0 + num1 + let value = num0 + num1 } - var ontest = process.on(879, add2) + let ontest = process.on(879, add2) expect(ontest).assertEqual(false) }) @@ -1687,9 +1687,9 @@ describe('ChildProcessTest', function () { */ it('testOn004', 0, function () { function add3(num0, num1){ - var value = num0 + num1 + let value = num0 + num1 } - var ontest = process.on(12345, add3) + let ontest = process.on(12345, add3) expect(ontest).assertEqual(false) }) @@ -1701,9 +1701,9 @@ describe('ChildProcessTest', function () { */ it('testOn005', 0, function () { function add4(num0, num1){ - var value = num0 + num1 + let value = num0 + num1 } - var ontest = process.on(1000, add4) + let ontest = process.on(1000, add4) expect(ontest).assertEqual(false) }) @@ -1715,10 +1715,10 @@ describe('ChildProcessTest', function () { */ it('testOff001', 0, function () { function add1(num){ - var value = num + 3 + let value = num + 3 } - var on = process.on("UnHandleRejection", add1) - var offtest = process.off("UnHandleRejection") + let on = process.on("UnHandleRejection", add1) + let offtest = process.off("UnHandleRejection") expect(offtest).assertEqual(true) }) @@ -1729,7 +1729,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testOff002', 0, function () { - var offtest = process.off("123") + let offtest = process.off("123") expect(offtest).assertEqual(false) }) @@ -1740,7 +1740,7 @@ describe('ChildProcessTest', function () { * @tc.author: wangben */ it('testOff003', 0, function () { - var offtest = process.off("456") + let offtest = process.off("456") expect(offtest).assertEqual(false) }) @@ -1752,10 +1752,10 @@ describe('ChildProcessTest', function () { */ it('testOff004', 0, function () { function add1(num){ - var value = num + 3 + let value = num + 3 } - var on = process.on("UnHandleRejection", add1) - var offtest = process.off("UnHandleRejection") + let on = process.on("UnHandleRejection", add1) + let offtest = process.off("UnHandleRejection") expect(offtest).assertEqual(true) }) @@ -1767,21 +1767,21 @@ describe('ChildProcessTest', function () { */ it('testOff005', 0, function () { function add1(num){ - var value = num + 3 + let value = num + 3 } - var on = process.on("UnHandleRejection", add1) - var offtest = process.off("UnHandleRejection") + let on = process.on("UnHandleRejection", add1) + let offtest = process.off("UnHandleRejection") expect(offtest).assertEqual(true) }) /** - * @tc.name: testTid001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-001 * @tc.desc: Returns the tid of the current thread. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testTid001', 0, function () { - var pres = process.tid + it('SUB_Runtime_JSAPI_SR000GGR3G-001', 0, function () { + let pres = process.tid if(pres > 0) { var flag = new Boolean(true) @@ -1790,15 +1790,15 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testTid002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-002 * @tc.desc: Returns the tid of the current thread. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testTid002', 0, function () { - for(var i=0; i < 5; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-002', 0, function () { + for(let i=0; i < 5; i++) { - var pres = process.tid + let pres = process.tid if(pres > 0) { var flag = new Boolean(true) @@ -1808,15 +1808,15 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testTid003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-003 * @tc.desc: Returns the tid of the current thread. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testTid003', 0, function () { - for(var i=0; i < 3; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-003', 0, function () { + for(let i=0; i < 3; i++) { - var pres = process.tid + let pres = process.tid if(pres > 0) { var flag = new Boolean(true) @@ -1827,64 +1827,64 @@ describe('ChildProcessTest', function () { /** - * @tc.name: testIsisolatedProcess001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-004 * @tc.desc: Returns a boolean whether the process is isolated. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testIsisolatedProcess001', 0, function () { - var pres = process.isIsolatedProcess() + it('SUB_Runtime_JSAPI_SR000GGR3G-004', 0, function () { + let pres = process.isIsolatedProcess() expect(pres).assertEqual(true) }) /** - * @tc.name: testIsisolatedProcess002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-005 * @tc.desc: Returns a boolean whether the process is isolated. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testIsisolatedProcess002', 0, function () { - for(var i=0; i < 3; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-005', 0, function () { + for(let i=0; i < 3; i++) { - var pres =process.isIsolatedProcess() + let pres =process.isIsolatedProcess() expect(pres).assertEqual(true) } }) /** - * @tc.name: testIsisolatedProcess003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-006 * @tc.desc: Returns a boolean whether the process is isolated. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testIsisolatedProcess003', 0, function () { - for(var i=0; i < 5; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-006', 0, function () { + for(let i=0; i < 5; i++) { - var pres =process.isIsolatedProcess() + let pres =process.isIsolatedProcess() expect(pres).assertEqual(true) } }) /** - * @tc.name: testIsappuid001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-007 * @tc.desc: Returns a boolean whether the specified uid belongs to a particular application. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testIsappuid001', 0, function () { - var isorno = process.isAppUid(167) + it('SUB_Runtime_JSAPI_SR000GGR3G-007', 0, function () { + let isorno = process.isAppUid(167) expect(isorno).assertEqual(false) }) /** - * @tc.name: testIsappuid002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-008 * @tc.desc: Returns a boolean whether the specified uid belongs to a particular application. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testIsappuid002', 0, function () { - var isorno = process.isAppUid(123) + it('SUB_Runtime_JSAPI_SR000GGR3G-008', 0, function () { + let isorno = process.isAppUid(123) expect(isorno).assertEqual(false) }) @@ -1895,7 +1895,7 @@ describe('ChildProcessTest', function () { * @tc.author: liwenqiang */ it('testIsappuid003', 0, function () { - var isorno = process.isAppUid(80000) + let isorno = process.isAppUid(80000) expect(isorno).assertEqual(false) }) @@ -1906,7 +1906,7 @@ describe('ChildProcessTest', function () { * @tc.author: liwenqiang */ it('testIsappuid004', 0, function () { - var isorno = process.isAppUid(789) + let isorno = process.isAppUid(789) expect(isorno).assertEqual(false) }) @@ -1917,159 +1917,159 @@ describe('ChildProcessTest', function () { * @tc.author: liwenqiang */ it('testIsappuid005', 0, function () { - var isorno = process.isAppUid(8569) + let isorno = process.isAppUid(8569) expect(isorno).assertEqual(false) }) /** - * @tc.name: testIs64Bit001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-009 * @tc.desc: Returns a boolean whether the process is running in a 64-bit environment. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testIs64Bit001', 0, function () { - var isorno = process.is64Bit() + it('SUB_Runtime_JSAPI_SR000GGR3G-009', 0, function () { + let isorno = process.is64Bit() expect(isorno).assertEqual(false) }) /** - * @tc.name: testIs64Bit002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-010 * @tc.desc: Returns a boolean whether the process is running in a 64-bit environment. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testIs64Bit002', 0, function () { - for(var i=0; i<3; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-010', 0, function () { + for(let i=0; i<3; i++) { - var isorno = process.is64Bit() + let isorno = process.is64Bit() expect(isorno).assertEqual(false) } }) /** - * @tc.name: testIs64Bit003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-011 * @tc.desc: Returns a boolean whether the process is running in a 64-bit environment. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testIs64Bit003', 0, function () { - for(var i=0; i<5; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-011', 0, function () { + for(let i=0; i<5; i++) { - var isorno = process.is64Bit() + let isorno = process.is64Bit() expect(isorno).assertEqual(false) } }) /** - * @tc.name: testGetuidforname001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-012 * @tc.desc: Returns the uid based on the specified user name. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetuidforname001',0, function () { - var pres = process.getUidForName("root") + it('SUB_Runtime_JSAPI_SR000GGR3G-012',0, function () { + let pres = process.getUidForName("root") if(pres != -1) { - var flag = new Boolean(true) + let flag = new Boolean(true) expect(Boolean(flag)).assertEqual(true) } }) /** - * @tc.name: testGetuidforname002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-013 * @tc.desc: Returns the uid based on the specified user name. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetuidforname002', 0, function () { - for(var i=0; i<3; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-013', 0, function () { + for(let i=0; i<3; i++) { - var pres = process.getUidForName("12356") + let pres = process.getUidForName("12356") expect(pres).assertEqual(-1) } }) /** - * @tc.name: testGetuidforname003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-014 * @tc.desc: Returns the uid based on the specified user name. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetuidforname003', 0, function () { - for(var i=0; i<5; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-014', 0, function () { + for(let i=0; i<5; i++) { - var pres = process.getUidForName("12356") + let pres = process.getUidForName("12356") expect(pres).assertEqual(-1) } }) /** - * @tc.name: testGetthreadpriority001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-015 * @tc.desc: Returns the thread priority based on the specified tid. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetthreadpriority001', 0, function () { - var pres = process.tid - var pri = process.getThreadPriority(pres) + it('SUB_Runtime_JSAPI_SR000GGR3G-015', 0, function () { + let pres = process.tid + let pri = process.getThreadPriority(pres) if(pri) { - var flag = new Boolean(true) + let flag = new Boolean(true) expect(Boolean(flag)).assertEqual(true) } }) /** - * @tc.name: testGetthreadpriority002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-016 * @tc.desc: Returns the thread priority based on the specified tid. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetthreadpriority002', 0, function () { - var pres = process.tid - for(var i=0; i<3; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-016', 0, function () { + let pres = process.tid + for(let i=0; i<3; i++) { - var pri = process.getThreadPriority(pres) + let pri = process.getThreadPriority(pres) if(pri > 0) { - var flag = new Boolean(true) + let flag = new Boolean(true) expect(Boolean(flag)).assertEqual(true) } } }) /** - * @tc.name: testGetthreadpriority003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-017 * @tc.desc: Returns the thread priority based on the specified tid. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetthreadpriority003', 0, function () { - var pres = process.tid - for(var i=0; i<5; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-017', 0, function () { + let pres = process.tid + for(let i=0; i<5; i++) { - var pri = process.getThreadPriority(pres) + let pri = process.getThreadPriority(pres) if(pri > 0) { - var flag = new Boolean(true) + let flag = new Boolean(true) expect(Boolean(flag)).assertEqual(true) } } }) /** - * @tc.name: testGetstartrealtime001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-019 * @tc.desc: Returns the elapsed real time (in milliseconds) taken from the start of - the system to the start of the process. + * @the system to the start of the process. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetstartrealtime001', 0, function () { - for(var i=0; i<3; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-019', 0, function () { + for(let i=0; i<3; i++) { - var pri = process.getStartRealtime() + let pri = process.getStartRealtime() if(pri !== null) { var flag = new Boolean(true) @@ -2079,14 +2079,14 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testGetstartrealtime002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-018 * @tc.desc: Returns the elapsed real time (in milliseconds) taken from the start of - the system to the start of the process. + * @the system to the start of the process. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetstartrealtime002', 0, function () { - var pri = process.getStartRealtime() + it('SUB_Runtime_JSAPI_SR000GGR3G-018', 0, function () { + let pri = process.getStartRealtime() if(pri !== null) { var flag = new Boolean(true) @@ -2095,16 +2095,16 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testGetstartrealtime003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-020 * @tc.desc: Returns the elapsed real time (in milliseconds) taken from the start of - the system to the start of the process. + * @the system to the start of the process. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetstartrealtime003', 0, function () { - for(var i=0; i<5; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-020', 0, function () { + for(let i=0; i<5; i++) { - var pri = process.getStartRealtime() + let pri = process.getStartRealtime() if(pri !== null) { var flag = new Boolean(true) @@ -2113,17 +2113,30 @@ describe('ChildProcessTest', function () { } }) + /** + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-021 + * @tc.desc: Returns the elapsed real time (in milliseconds) + * @taken from the start of the system to the start of the process. + * @tc.require: AR000GFB04 + * @tc.author: liwenqiang + */ + it('SUB_Runtime_JSAPI_SR000GGR3G-021', 0, function () { + let priOne = process.getStartRealtime() + let priTwo = process.getStartRealtime() + expect(priOne - priTwo).assertEqual(0) + }) + /** * @tc.name: testGetstartrealtime004 * @tc.desc: Returns the elapsed real time (in milliseconds) taken from the start of - the system to the start of the process. + * @the system to the start of the process. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ it('testGetstartrealtime004', 0, function () { - for(var i=0; i<6; i++) + for(let i=0; i<6; i++) { - var pri = process.getStartRealtime() + let pri = process.getStartRealtime() if(pri > 0) { var flag = new Boolean(true) @@ -2139,9 +2152,9 @@ describe('ChildProcessTest', function () { * @tc.author: liwenqiang */ it('testGetpastCpuTime001', 0, function () { - for(var i=0; i<3; i++) + for(let i=0; i<3; i++) { - var pri = process.getPastCpuTime() + let pri = process.getPastCpuTime() if(pri > 0) { var flag = new Boolean(true) @@ -2151,13 +2164,13 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testGetpastCpuTime002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-022 * @tc.desc: Returns the cpu time (in milliseconds) from the time when the process starts to the current time. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetpastCpuTime002', 0, function () { - var pri = process.getPastCpuTime() + it('SUB_Runtime_JSAPI_SR000GGR3G-022', 0, function () { + let pri = process.getPastCpuTime() if(pri > 0) { var flag = new Boolean(true) @@ -2166,15 +2179,15 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testGetpastCpuTime003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-023 * @tc.desc: Returns the cpu time (in milliseconds) from the time when the process starts to the current time. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetpastCpuTime003', 0, function () { - for(var i=0; i<5; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-023', 0, function () { + for(let i=0; i<5; i++) { - var pri = process.getPastCpuTime() + let pri = process.getPastCpuTime() if(pri > 0) { var flag = new Boolean(true) @@ -2184,15 +2197,15 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testGetpastCpuTime004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-024 * @tc.desc: Returns the cpu time (in milliseconds) from the time when the process starts to the current time. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetpastCpuTime004', 0, function () { - for(var i=0; i<8; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-024', 0, function () { + for(let i=0; i<8; i++) { - var pri = process.getPastCpuTime() + let pri = process.getPastCpuTime() if(pri > 0) { var flag = new Boolean(true) @@ -2202,14 +2215,14 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testGetSystemConfig001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-025 * @tc.desc: Returns the system configuration at runtime. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetSystemConfig001', 0, function () { - var _SC_ARG_MAX = 0 - var pri = process.getSystemConfig(_SC_ARG_MAX) + it('SUB_Runtime_JSAPI_SR000GGR3G-025', 0, function () { + let _SC_ARG_MAX = 0 + let pri = process.getSystemConfig(_SC_ARG_MAX) if(pri > 0) { var flag = new Boolean(true) @@ -2218,16 +2231,16 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testGetSystemConfig002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-026 * @tc.desc: Returns the system configuration at runtime. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetSystemConfig002', 0, function () { - var _SC_ARG_MAX = 0 - for(var i=0; i<3; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-026', 0, function () { + let _SC_ARG_MAX = 0 + for(let i=0; i<3; i++) { - var pri = process.getSystemConfig(_SC_ARG_MAX) + let pri = process.getSystemConfig(_SC_ARG_MAX) if(pri > 0) { var flag = new Boolean(true) @@ -2237,16 +2250,16 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testGetSystemConfig003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-027 * @tc.desc: Returns the system configuration at runtime. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetSystemConfig003', 0, function () { - var _SC_ARG_MAX = 0 - for(var i=0; i<5; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-027', 0, function () { + let _SC_ARG_MAX = 0 + for(let i=0; i<5; i++) { - var pri = process.getSystemConfig(_SC_ARG_MAX) + let pri = process.getSystemConfig(_SC_ARG_MAX) if(pri > 0) { var flag = new Boolean(true) @@ -2256,14 +2269,14 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testGetSystemConfig004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-028 * @tc.desc: Returns the system configuration at runtime. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetSystemConfig004', 0, function () { - var _SC_OPEN_MAX = 4 - var pri = process.getSystemConfig(_SC_OPEN_MAX) + it('SUB_Runtime_JSAPI_SR000GGR3G-028', 0, function () { + let _SC_OPEN_MAX = 4 + let pri = process.getSystemConfig(_SC_OPEN_MAX) if(pri > 0) { var flag = new Boolean(true) @@ -2272,14 +2285,14 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testGetSystemConfig005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-029 * @tc.desc: Returns the system configuration at runtime. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetSystemConfig005', 0, function () { - var _SC_PAGESIZE = 8 - var pri = process.getSystemConfig(_SC_PAGESIZE) + it('SUB_Runtime_JSAPI_SR000GGR3G-029', 0, function () { + let _SC_PAGESIZE = 8 + let pri = process.getSystemConfig(_SC_PAGESIZE) if(pri > 0) { var flag = new Boolean(true) @@ -2288,13 +2301,13 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testGetEnvironmentVar001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-033 * @tc.desc: Returns the system value for environment variables. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetEnvironmentVar001', 0, function () { - var pri = process.getEnvironmentVar("USER") + it('SUB_Runtime_JSAPI_SR000GGR3G-033', 0, function () { + let pri = process.getEnvironmentVar("USER") if(pri != null) { var flag = new Boolean(true) expect(Boolean(flag)).assertEqual(true) @@ -2302,15 +2315,15 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testGetEnvironmentVar002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-036 * @tc.desc: Returns the system value for environment variables. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetEnvironmentVar002', 0, function () { - for(var i=0; i<3; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-036', 0, function () { + for(let i=0; i<3; i++) { - var pri = process.getEnvironmentVar("PATH") + let pri = process.getEnvironmentVar("PATH") if(pri != null) { var flag = new Boolean(true) @@ -2326,9 +2339,9 @@ describe('ChildProcessTest', function () { * @tc.author: liwenqiang */ it('testGetEnvironmentVar003', 0, function () { - for(var i=0; i<5; i++) + for(let i=0; i<5; i++) { - var pri = process.getEnvironmentVar("PATH") + let pri = process.getEnvironmentVar("PATH") if(pri != null) { var flag = new Boolean(true) @@ -2338,15 +2351,15 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testGetEnvironmentVar004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-034 * @tc.desc: Returns the system value for environment variables. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetEnvironmentVar004', 0, function () { - for(var i=0; i<6; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-034', 0, function () { + for(let i=0; i<6; i++) { - var pri = process.getEnvironmentVar("USER") + let pri = process.getEnvironmentVar("USER") if(pri != null) { var flag = new Boolean(true) @@ -2356,15 +2369,15 @@ describe('ChildProcessTest', function () { }) /** - * @tc.name: testGetEnvironmentVar005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-035 * @tc.desc: Returns the system value for environment variables. * @tc.require: AR000GFB04 * @tc.author: liwenqiang */ - it('testGetEnvironmentVar005', 0, function () { - for(var i=0; i<8; i++) + it('SUB_Runtime_JSAPI_SR000GGR3G-035', 0, function () { + for(let i=0; i<8; i++) { - var pri = process.getEnvironmentVar("USER") + let pri = process.getEnvironmentVar("USER") if(pri != null) { var flag = new Boolean(true) @@ -2372,4 +2385,22 @@ describe('ChildProcessTest', function () { } } }) + + /** + * @tc.name: SUB_Runtime_JSAPI_SR000GGR3G-037 + * @tc.desc: Returns the system value for environment variables. + * @tc.require: AR000GFB04 + * @tc.author: liwenqiang + */ + it('SUB_Runtime_JSAPI_SR000GGR3G-037', 0, function () { + for(let i=0; i<100; i++) + { + let pri = process.getEnvironmentVar("i123") + if(pri == null) + { + var flag = new Boolean(true) + expect(flag).assertEqual(true) + } + } + }) }) \ No newline at end of file diff --git a/compileruntime/uri_lib_standard/src/main/js/default/pages/index/index.css b/compileruntime/uri_lib_standard/src/main/js/default/pages/index/index.css index 2b1965821483f4f8c8b97c86ef07fe87ea767d01..5bcfb2e8b6d4da7f7cdefb090c3eeaccd70009c9 100644 --- a/compileruntime/uri_lib_standard/src/main/js/default/pages/index/index.css +++ b/compileruntime/uri_lib_standard/src/main/js/default/pages/index/index.css @@ -1,3 +1,18 @@ +/* + * Copyright (C) 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + .container { flex-direction: column; justify-content: center; diff --git a/compileruntime/uri_lib_standard/src/main/js/default/pages/index/index.hml b/compileruntime/uri_lib_standard/src/main/js/default/pages/index/index.hml index abeadefb6faa934b6dc51d6bbcf66b765485e5ad..a9e4220170a2effe96285d0feda7d698e2035bf3 100644 --- a/compileruntime/uri_lib_standard/src/main/js/default/pages/index/index.hml +++ b/compileruntime/uri_lib_standard/src/main/js/default/pages/index/index.hml @@ -1,3 +1,18 @@ + +
{{ $t('strings.hello') }} {{ title }} diff --git a/compileruntime/uri_lib_standard/src/main/js/test/uri.test.js b/compileruntime/uri_lib_standard/src/main/js/test/uri.test.js index f8b022a04886bd08cd352a84f0da9b34d29a4687..501fd5074b611d4075759f75c5f37bee5b12c3b7 100644 --- a/compileruntime/uri_lib_standard/src/main/js/test/uri.test.js +++ b/compileruntime/uri_lib_standard/src/main/js/test/uri.test.js @@ -17,12 +17,12 @@ import URI from '@ohos.uri' describe('UriTest', function () { /** - * @tc.name: testConstructor001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_012 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_012', 0, function () { try { let that = new URI('#http://username:password@host:8080/directory/file?foo=1&bar=2'); } catch (err) { @@ -31,12 +31,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_010 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_010', 0, function () { try { let that = new URI({name: 'gaogao'}); } catch (err) { @@ -45,12 +45,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_032 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_032', 0, function () { try { let that = new URI('ht/tp://username:pas sword@host:8080/directory/file?foo=1&bar=2'); } catch (err) { @@ -59,12 +59,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_030 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_030', 0, function () { try { let that = new URI('http://username:password@[::]:8080/directory/file?Query#gaogao faofao'); } catch (err) { @@ -73,12 +73,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_028 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_028', 0, function () { try { let that = new URI('http://username:password@host:8080/directory/file?foo^=1&bar=2#gaogaofaofao'); } catch (err) { @@ -87,12 +87,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor006 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_013 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor006', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_013', 0, function () { try { let that = new URI('1http://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao'); } catch (err) { @@ -101,12 +101,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor007 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_014 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor007', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_014', 0, function () { try { let that = new URI('ht@tp://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao'); } catch (err) { @@ -115,12 +115,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor008 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_026 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor008', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_026', 0, function () { try { let that = new URI('http://username:password@[::]:80r80/directory/file?foo=1&bar=2#gaogaofaofao'); } catch (err) { @@ -129,12 +129,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor009 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_021 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor009', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_021', 0, function () { try { let that = new URI('http://username:password@[::12:55:8080/directory/file?foo=1&bar=2#gaogaofaofao'); } catch (err) { @@ -143,12 +143,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor010 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_018 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor010', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_018', 0, function () { try { let that = new URI('http://username:pa^ssword@[::12:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao'); } catch (err) { @@ -157,12 +157,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor011 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_020 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor011', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_020', 0, function () { try { let that = new URI('http://username:password@[::1你2:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao'); } catch (err) { @@ -171,12 +171,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor012 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_001 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor012', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_001', 0, function () { let gaogao = new URI('http://gg:gaogao@www.baidu.com:99/path/path?query#fagment'); expect(gaogao.scheme).assertEqual("http"); expect(gaogao.authority).assertEqual("gg:gaogao@www.baidu.com:99"); @@ -209,12 +209,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor014 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_002 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor014', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_002', 0, function () { let gaogao = new URI('http://gg:gaogao@[::]:88/path/path66?foooo#gaogao'); expect(gaogao.scheme).assertEqual("http"); expect(gaogao.authority).assertEqual("gg:gaogao@[::]:88"); @@ -247,12 +247,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor016 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_003 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor016', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_003', 0, function () { let gaogao = new URI('http://gg:gaogao@[::FFFF:129.144.52.38]:99/path/path?query#fagment'); expect(gaogao.scheme).assertEqual("http"); expect(gaogao.authority).assertEqual("gg:gaogao@[::FFFF:129.144.52.38]:99"); @@ -343,12 +343,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor021 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_004 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor021', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_004', 0, function () { let gaogao = new URI('http://gg:gaogao@199.98.55.44:99/path/path?query#fagment'); expect(gaogao.scheme).assertEqual("http"); expect(gaogao.authority).assertEqual("gg:gaogao@199.98.55.44:99"); @@ -362,12 +362,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor022 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_005 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor022', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_005', 0, function () { let gaogao = new URI('http://16.9.5.4:99/path/path?query#fagment'); expect(gaogao.scheme).assertEqual("http"); expect(gaogao.authority).assertEqual("16.9.5.4:99"); @@ -400,12 +400,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor024 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_006 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor024', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_006', 0, function () { let gaogao = new URI('http://user@49.10pe8.54.12:80/path/path23?query#qwer'); expect(gaogao.scheme).assertEqual("http"); expect(gaogao.authority).assertEqual("user@49.10pe8.54.12:80"); @@ -419,12 +419,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor025 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_007 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor025', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_007', 0, function () { let gaogao = new URI('http://user@www.baidu.com/path/path23?query#qwer'); expect(gaogao.scheme).assertEqual("http"); expect(gaogao.authority).assertEqual("user@www.baidu.com"); @@ -438,12 +438,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor026 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_008 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor026', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_008', 0, function () { let gaogao = new URI('http://user@www.hw.com:77/path/path23?query#qwer'); expect(gaogao.scheme).assertEqual("http"); expect(gaogao.authority).assertEqual("user@www.hw.com:77"); @@ -457,12 +457,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testConstructor027 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_009 * @tc.desc: Constructs a URI by parsing the given string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testConstructor027', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_009', 0, function () { let gaogao = new URI('ht2tp://user@www.h12343w.com:77/path/path23?query#qwer'); expect(gaogao.scheme).assertEqual("ht2tp"); expect(gaogao.authority).assertEqual("user@www.h12343w.com:77"); @@ -565,12 +565,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testEquals002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_034 * @tc.desc: Tests this URI for equality with another object. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testEquals002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_034', 0, function () { let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment'); let gaogao1 = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment'); let res = gaogao.equals(gaogao1); @@ -578,12 +578,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testEquals003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_035 * @tc.desc: Tests this URI for equality with another object. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testEquals003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_035', 0, function () { let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment'); let gaogao1 = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment123'); let res = gaogao.equals(gaogao1); @@ -617,12 +617,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testNormalize001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_036 * @tc.desc: Normalizes this URI's path. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testNormalize001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_036', 0, function () { let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66./../././mm/.././path1?query#fagment'); let res = gaogao.normalize(); expect(res.path).assertEqual("/path/path1"); @@ -630,12 +630,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testNormalize002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_037 * @tc.desc: Normalizes this URI's path. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testNormalize002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_037', 0, function () { let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path?query#fagment'); let res = gaogao.normalize(); expect(res.path).assertEqual("/../../path"); @@ -656,12 +656,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testNormalize004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_038 * @tc.desc: Normalizes this URI's path. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testNormalize004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_038', 0, function () { let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../path/.././../aa/bb/cc?query'); let res = gaogao.normalize(); expect(res.path).assertEqual("/../../aa/bb/cc"); @@ -669,12 +669,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testNormalize005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_039 * @tc.desc: Normalizes this URI's path. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testNormalize005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_039', 0, function () { let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/./path/./aa/bb/cc?query#fagment'); let res = gaogao.normalize(); expect(res.path).assertEqual("/path/aa/bb/cc"); @@ -682,12 +682,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testToString001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_042 * @tc.desc: Returns the content of this URI as a US-ASCII string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testToString001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_042', 0, function () { let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment'); let res = gaogao.toString(); expect(res).assertEqual('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment'); @@ -718,12 +718,12 @@ describe('UriTest', function () { }) /** - * @tc.name: testToString004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_043 * @tc.desc: Returns the content of this URI as a US-ASCII string. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testToString004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_043', 0, function () { let gaogao = new URI('http://gg:gao你好gao@199.98.55.44:99/path/p你好ath?qu你好ery#fag你好ment'); let res = gaogao.toString(); expect(res).assertEqual('http://gg:gao%E4%BD%A0%E5%A5%BDgao@199.98.55.44:99/path/' + @@ -743,24 +743,24 @@ describe('UriTest', function () { }) /** - * @tc.name: testCheckIsAbsolute001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_041 * @tc.desc: Tells whether or not this URI is absolute. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testCheckIsAbsolute001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_041', 0, function () { let gaogao = new URI('f/tp://username:password@www.baidu.com:88/path?query#fagment'); let res = gaogao.checkIsAbsolute(); expect(res).assertEqual(false); }) /** - * @tc.name: testCheckIsAbsolute002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR34_040 * @tc.desc: Tells whether or not this URI is absolute. * @tc.require: AR000GFB2S * @tc.author: zhaoduwei */ - it('testCheckIsAbsolute002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR34_040', 0, function () { let gaogao = new URI('ftp://username:password@www.baidu.com:88/path?query#fagment'); let res = gaogao.checkIsAbsolute(); expect(res).assertEqual(true); diff --git a/compileruntime/url_lib_standard/src/main/js/default/pages/index/index.css b/compileruntime/url_lib_standard/src/main/js/default/pages/index/index.css index 2b1965821483f4f8c8b97c86ef07fe87ea767d01..5bcfb2e8b6d4da7f7cdefb090c3eeaccd70009c9 100644 --- a/compileruntime/url_lib_standard/src/main/js/default/pages/index/index.css +++ b/compileruntime/url_lib_standard/src/main/js/default/pages/index/index.css @@ -1,3 +1,18 @@ +/* + * Copyright (C) 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + .container { flex-direction: column; justify-content: center; diff --git a/compileruntime/url_lib_standard/src/main/js/default/pages/index/index.hml b/compileruntime/url_lib_standard/src/main/js/default/pages/index/index.hml index f64b040a5ae394dbaa5e185e1ecd4f4556b92184..a2614561bc83cc43a7a01c1f8f2c20ec0af9418b 100644 --- a/compileruntime/url_lib_standard/src/main/js/default/pages/index/index.hml +++ b/compileruntime/url_lib_standard/src/main/js/default/pages/index/index.hml @@ -1,3 +1,18 @@ + +
{{ $t('strings.hello') }} {{ title }} diff --git a/compileruntime/util_lib_standard/src/main/js/default/pages/index/index.css b/compileruntime/util_lib_standard/src/main/js/default/pages/index/index.css index 2b1965821483f4f8c8b97c86ef07fe87ea767d01..5bcfb2e8b6d4da7f7cdefb090c3eeaccd70009c9 100644 --- a/compileruntime/util_lib_standard/src/main/js/default/pages/index/index.css +++ b/compileruntime/util_lib_standard/src/main/js/default/pages/index/index.css @@ -1,3 +1,18 @@ +/* + * Copyright (C) 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + .container { flex-direction: column; justify-content: center; diff --git a/compileruntime/util_lib_standard/src/main/js/default/pages/index/index.hml b/compileruntime/util_lib_standard/src/main/js/default/pages/index/index.hml index 20a4e40d9a4ee698bf8e485840457dd43233a376..81d7b7d182db5b6534a7acd9d76c081efd0d268c 100644 --- a/compileruntime/util_lib_standard/src/main/js/default/pages/index/index.hml +++ b/compileruntime/util_lib_standard/src/main/js/default/pages/index/index.hml @@ -1,3 +1,18 @@ + +
{{ $t('strings.hello') }} {{title}} diff --git a/compileruntime/util_lib_standard/src/main/js/test/util.test.js b/compileruntime/util_lib_standard/src/main/js/test/util.test.js index 31b13999874dc65561fe66c17d5beccde9d59e0e..8f20bd7db8c71af00ecff38f5b13efaf38882559 100644 --- a/compileruntime/util_lib_standard/src/main/js/test/util.test.js +++ b/compileruntime/util_lib_standard/src/main/js/test/util.test.js @@ -961,611 +961,611 @@ describe('TextEncoderTest', function () { describe('ScopeTest', function () { /** - * @tc.name: testGetLower001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-001 * @tc.desc: Obtains the lower bound of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testGetLower001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-001', 0, function () { var result = range.getLower() expect(result.toString()).assertEqual('30') }) /** - * @tc.name: testGetLower002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-002 * @tc.desc: Obtains the lower bound of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testGetLower002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-002', 0, function () { var result = rangeFir.getLower() expect(result.toString()).assertEqual('35') }) /** - * @tc.name: testGetLower003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-003 * @tc.desc: Obtains the lower bound of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testGetLower003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-003', 0, function () { var result = rangeSec.getLower() expect(result.toString()).assertEqual('20') }) /** - * @tc.name: testGetLower004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-004 * @tc.desc: Obtains the lower bound of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testGetLower004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-004', 0, function () { var result = rangeThi.getLower() expect(result.toString()).assertEqual('20') }) /** - * @tc.name: testGetLower005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-005 * @tc.desc: Obtains the lower bound of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testGetLower005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-005', 0, function () { var result = rangeFif.getLower() expect(result.toString()).assertEqual('35') }) /** - * @tc.name: testGetUpper001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-006 * @tc.desc: Obtains the upper bound of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testGetUpper001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-006', 0, function () { var result = range.getUpper() expect(result.toString()).assertEqual('40') }) /** - * @tc.name: testGetUpper002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-007 * @tc.desc: Obtains the upper bound of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testGetUpper002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-007', 0, function () { var result = rangeFir.getUpper() expect(result.toString()).assertEqual('39') }) /** - * @tc.name: testGetUpper003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-008 * @tc.desc: Obtains the upper bound of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testGetUpper003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-008', 0, function () { var result = rangeSec.getUpper() expect(result.toString()).assertEqual('45') }) /** - * @tc.name: testGetUpper004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-009 * @tc.desc: Obtains the upper bound of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testGetUpper004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-009', 0, function () { var result = rangeThi.getUpper() expect(result.toString()).assertEqual('35') }) /** - * @tc.name: testGetUpper005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-010 * @tc.desc: Obtains the upper bound of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testGetUpper005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-010', 0, function () { var result = rangeFif.getUpper() expect(result.toString()).assertEqual('45') }) /** - * @tc.name: testClamp001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-011 * @tc.desc: Clamps a given value to the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testClamp001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-011', 0, function () { var result =range.clamp(tempLess) expect(result.toString()).assertEqual('30') }) /** - * @tc.name: testClamp002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-012 * @tc.desc: Clamps a given value to the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testClamp002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-012', 0, function () { var result =range.clamp(tempMiDF) expect(result.toString()).assertEqual('35') }) /** - * @tc.name: testClamp003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-013 * @tc.desc: Clamps a given value to the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testClamp003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-013', 0, function () { var result =range.clamp(tempMore) expect(result.toString()).assertEqual('40') }) /** - * @tc.name: testClamp004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-014 * @tc.desc: Clamps a given value to the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testClamp004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-014', 0, function () { var result =range.clamp(tempLower) expect(result.toString()).assertEqual('30') }) /** - * @tc.name: testClamp005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-015 * @tc.desc: Clamps a given value to the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testClamp005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-015', 0, function () { var result =range.clamp(tempUpper) expect(result.toString()).assertEqual('40') }) /** - * @tc.name: testContains001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-016 * @tc.desc: Checks whether a given value is within the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testContains001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-016', 0, function () { var result = range.contains(tempLess) expect(result).assertEqual(false) }) /** - * @tc.name: testContains002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-017 * @tc.desc: Checks whether a given value is within the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testContains002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-017', 0, function () { var result = range.contains(tempMiDF) expect(result).assertEqual(true) }) /** - * @tc.name: testContains003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-018 * @tc.desc: Checks whether a given value is within the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testContains003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-018', 0, function () { var result = range.contains(tempMore) expect(result).assertEqual(false) }) /** - * @tc.name: testContains004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-019 * @tc.desc: Checks whether a given value is within the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testContains004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-019', 0, function () { var result = range.contains(tempLower) expect(result).assertEqual(true) }) /** - * @tc.name: testContains005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-020 * @tc.desc: Checks whether a given value is within the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testContains005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-020', 0, function () { var result = range.contains(tempUpper) expect(result).assertEqual(true) }) /** - * @tc.name: testContains001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-021 * @tc.desc: Checks whether a given range is within the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testContains001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-021', 0, function () { var result = range.contains(rangeFir) expect(result).assertEqual(true) }) /** - * @tc.name: testContains002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-022 * @tc.desc: Checks whether a given range is within the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testContains002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-022', 0, function () { var result = range.contains(rangeSec) expect(result).assertEqual(false) }) /** - * @tc.name: testContains003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-023 * @tc.desc: Checks whether a given range is within the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testContains003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-023', 0, function () { var result = range.contains(rangeThi) expect(result).assertEqual(false) }) /** - * @tc.name: testContains004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-024 * @tc.desc: Checks whether a given range is within the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testContains004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-024', 0, function () { var result = range.contains(rangeFif) expect(result).assertEqual(false) }) /** - * @tc.name: testContains005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-025 * @tc.desc: Checks whether a given range is within the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testContains005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-025', 0, function () { var result = range.contains(range) expect(result).assertEqual(true) }) /** - * @tc.name: testExpand001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-026 * @tc.desc: Creates the smallest range that includes the current range and the given lower and upper bounds. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-026', 0, function () { var result = range.expand(tempMiDF, tempMidS) expect(result.toString()).assertEqual('[30, 40]') }) /** - * @tc.name: testExpand002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-027 * @tc.desc: Creates the smallest range that includes the current range and the given lower and upper bounds. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-027', 0, function () { var result = range.expand(tempLess, tempMore) expect(result.toString()).assertEqual('[20, 45]') }) /** - * @tc.name: testExpand003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-028 * @tc.desc: Creates the smallest range that includes the current range and the given lower and upper bounds. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-028', 0, function () { var result = range.expand(tempLess, tempMiDF) expect(result.toString()).assertEqual('[20, 40]') }) /** - * @tc.name: testExpand004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-029 * @tc.desc: Creates the smallest range that includes the current range and the given lower and upper bounds. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-029', 0, function () { var result = range.expand(tempMiDF, tempMore) expect(result.toString()).assertEqual('[30, 45]') }) /** - * @tc.name: testExpand005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-030 * @tc.desc: Creates the smallest range that includes the current range and the given lower and upper bounds. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-030', 0, function () { var result = range.expand(tempLower, tempUpper) expect(result.toString()).assertEqual('[30, 40]') }) /** - * @tc.name: testExpand001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-031 * @tc.desc: Creates the smallest range that includes the current range and a given range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-031', 0, function () { var result = range.expand(rangeFir) expect(result.toString()).assertEqual('[30, 40]') }) /** - * @tc.name: testExpand002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-032 * @tc.desc: Creates the smallest range that includes the current range and a given range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-032', 0, function () { var result = range.expand(rangeSec) expect(result.toString()).assertEqual('[20, 45]') }) /** - * @tc.name: testExpand003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-033 * @tc.desc: Creates the smallest range that includes the current range and a given range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-033', 0, function () { var result = range.expand(rangeThi) expect(result.toString()).assertEqual('[20, 40]') }) /** - * @tc.name: testExpand004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-034 * @tc.desc: Creates the smallest range that includes the current range and a given range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-034', 0, function () { var result = range.expand(rangeFif) expect(result.toString()).assertEqual('[30, 45]') }) /** - * @tc.name: testExpand005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-035 * @tc.desc: Creates the smallest range that includes the current range and a given range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-035', 0, function () { var result = range.expand(range) expect(result.toString()).assertEqual('[30, 40]') }) /** - * @tc.name: testExpand001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-036 * @tc.desc: Creates the smallest range that includes the current range and a given value. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-036', 0, function () { var result = range.expand(tempMiDF) expect(result.toString()).assertEqual('[30, 40]') }) /** - * @tc.name: testExpand002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-037 * @tc.desc: Creates the smallest range that includes the current range and a given value. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-037', 0, function () { var result = range.expand(tempLess) expect(result.toString()).assertEqual('[20, 40]') }) /** - * @tc.name: testExpand003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-038 * @tc.desc: Creates the smallest range that includes the current range and a given value. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-038', 0, function () { var result = range.expand(tempMore) expect(result.toString()).assertEqual('[30, 45]') }) /** - * @tc.name: testExpand004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-039 * @tc.desc: Creates the smallest range that includes the current range and a given value. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-039', 0, function () { var result = range.expand(tempLower) expect(result.toString()).assertEqual('[30, 40]') }) /** - * @tc.name: testExpand005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-040 * @tc.desc: Creates the smallest range that includes the current range and a given value. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testExpand005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-040', 0, function () { var result = range.expand(tempUpper) expect(result.toString()).assertEqual('[30, 40]') }) /** - * @tc.name: testInstersect001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-041 * @tc.desc: Returns the intersection of a given range and the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testInstersect001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-041', 0, function () { var result = range.intersect(rangeFir) expect(result.toString()).assertEqual('[35, 39]') }) /** - * @tc.name: testInstersect002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-042 * @tc.desc: Returns the intersection of a given range and the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testInstersect002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-042', 0, function () { var result = range.intersect(rangeSec) expect(result.toString()).assertEqual('[30, 40]') }) /** - * @tc.name: testInstersect003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-043 * @tc.desc: Returns the intersection of a given range and the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testInstersect003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-043', 0, function () { var result = range.intersect(rangeThi) expect(result.toString()).assertEqual('[30, 35]') }) /** - * @tc.name: testInstersect004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-044 * @tc.desc: Returns the intersection of a given range and the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testInstersect004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-044', 0, function () { var result = range.intersect(rangeFif) expect(result.toString()).assertEqual('[35, 40]') }) /** - * @tc.name: testInstersect005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-045 * @tc.desc: Returns the intersection of a given range and the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testInstersect005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-045', 0, function () { var result = range.intersect(range) expect(result.toString()).assertEqual('[30, 40]') }) /** - * @tc.name: testInstersect001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-046 * @tc.desc: Returns the intersection of the current range and the range specified by the given lower and upper bounds. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testInstersect001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-046', 0, function () { var result = range.intersect(tempMiDF, tempMidS) expect(result.toString()).assertEqual('[35, 39]') }) /** - * @tc.name: testInstersect002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-047 * @tc.desc: Returns the intersection of the current range and the range specified by the given lower and upper bounds. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testInstersect002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-047', 0, function () { var result = range.intersect(tempLess, tempMore) expect(result.toString()).assertEqual('[30, 40]') }) /** - * @tc.name: testInstersect003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-048 * @tc.desc: Returns the intersection of the current range and the range specified by the given lower and upper bounds. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testInstersect003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-048', 0, function () { var result = range.intersect(tempLess, tempMiDF) expect(result.toString()).assertEqual('[30, 35]') }) /** - * @tc.name: testInstersect004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-049 * @tc.desc: Returns the intersection of the current range and the range specified by the given lower and upper bounds. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testInstersect004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-049', 0, function () { var result = range.intersect(tempMiDF, tempMore) expect(result.toString()).assertEqual('[35, 40]') }) /** - * @tc.name: testInstersect005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-050 * @tc.desc: Returns the intersection of the current range and the range specified by the given lower and upper bounds. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testInstersect005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-050', 0, function () { var result = range.intersect(tempLower, tempUpper) expect(result.toString()).assertEqual('[30, 40]') }) /** - * @tc.name: testToString001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-051 * @tc.desc: Obtains a string representation of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testToString001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-051', 0, function () { var result = range.toString() expect(result.toString()).assertEqual('[30, 40]') }) /** - * @tc.name: testToString002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-052 * @tc.desc: Obtains a string representation of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testToString002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-052', 0, function () { var result = rangeFir.toString() expect(result.toString()).assertEqual('[35, 39]') }) /** - * @tc.name: testToString003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-053 * @tc.desc: Obtains a string representation of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testToString003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-053', 0, function () { var result = rangeSec.toString() expect(result.toString()).assertEqual('[20, 45]') }) /** - * @tc.name: testToString004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-054 * @tc.desc: Obtains a string representation of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testToString004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-054', 0, function () { var result = rangeThi.toString() expect(result.toString()).assertEqual('[20, 35]') }) /** - * @tc.name: testToString005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR36-055 * @tc.desc: Obtains a string representation of the current range. * @tc.require: AR000GFB4U * @tc.author: jiangkai */ - it('testToString005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR36-055', 0, function () { var result = rangeFif.toString() expect(result.toString()).assertEqual('[35, 45]') }) @@ -1574,13 +1574,13 @@ describe('ScopeTest', function () { describe('Base64Test', function () { /** - * @tc.name: testEncodeSync001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_001 * @tc.desc: Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeSync001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_001', 0, function () { var that = new util.Base64() var array = new Uint8Array([115,49,51]); var rarray = new Uint8Array([99,122,69,122]); @@ -1591,13 +1591,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncodeSync002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_004 * @tc.desc: Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeSync002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_004', 0, function () { var that = new util.Base64() var array = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]); var rarray = new Uint8Array([81,109,70,122,90,84,89,48,73,69,53,118,90,71,85,117,97,110,77,61]); @@ -1608,13 +1608,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncodeSync003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_005 * @tc.desc: Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeSync003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_005', 0, function () { var that = new util.Base64() var array = new Uint8Array([66,97,115,101,54,52,32,69,110,99,111,100,105,110,103,32,105, 110,32,78,111,100,101,46,106,115]); @@ -1627,13 +1627,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncodeSync004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_002 * @tc.desc: Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeSync004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_002', 0, function () { var that = new util.Base64() var array = new Uint8Array([168, 174, 155, 255]); var rarray = new Uint8Array([113,75,54,98,47,119,61,61]); @@ -1644,13 +1644,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncodeSync005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_003 * @tc.desc: Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeSync005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_003', 0, function () { var that = new util.Base64() var array = new Uint8Array([66, 97, 115, 101, 54, 52]); var rarray = new Uint8Array([81, 109, 70, 122, 90, 84, 89, 48]); @@ -1661,12 +1661,12 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncodeToStringSync001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_006 * @tc.desc: Encodes the specified byte array into a String using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeToStringSync001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_006', 0, function () { var that = new util.Base64() var array = new Uint8Array([115,49,51]); var result = that.encodeToStringSync(array) @@ -1674,12 +1674,12 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncodeToStringSync002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_009 * @tc.desc: Encodes the specified byte array into a String using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeToStringSync002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_009', 0, function () { var that = new util.Base64() var array = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]); var result = that.encodeToStringSync(array); @@ -1687,12 +1687,12 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncodeToStringSync003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_010 * @tc.desc: Encodes the specified byte array into a String using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeToStringSync003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_010', 0, function () { var that = new util.Base64() var array = new Uint8Array([66,97,115,101,54,52,32,69,110,99,111,100,105,110,103,32,105,110, 32,78,111,100,101,46,106,115]); @@ -1701,12 +1701,12 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncodeToStringSync004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_007 * @tc.desc: Encodes the specified byte array into a String using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeToStringSync004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_007', 0, function () { var that = new util.Base64() var array = new Uint8Array([168, 174, 155, 255]); var result = that.encodeToStringSync(array); @@ -1714,12 +1714,12 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncodeToStringSync005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_008 * @tc.desc: Encodes the specified byte array into a String using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeToStringSync005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_008', 0, function () { var that = new util.Base64() var array = new Uint8Array([66, 97, 115, 101, 54, 52]); var result = that.encodeToStringSync(array); @@ -1727,13 +1727,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecodeSync001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_011 * @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecodeSync001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_011', 0, function () { var that = new util.Base64() var buff = 'czEz'; var rarray = new Uint8Array([115,49,51]); @@ -1744,13 +1744,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecodeSync002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_013 * @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecodeSync002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_013', 0, function () { var that = new util.Base64() var buff = 'QmFzZTY0IE5vZGUuanM='; var rarray = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]); @@ -1761,13 +1761,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecodeSync003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_014 * @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecodeSync003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_014', 0, function () { var that = new util.Base64() var buff = 'QmFzZTY0IEVuY29kaW5nIGluIE5vZGUuanM='; var rarray = new Uint8Array([66,97,115,101,54,52,32,69,110,99,111,100,105,110,103,32, @@ -1779,13 +1779,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecodeSync004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_012 * @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecodeSync004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_012', 0, function () { var that = new util.Base64() var buff = 'qK6b/w=='; var rarray = new Uint8Array([168, 174, 155, 255]); @@ -1813,13 +1813,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecodeSync001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_011 * @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecodeSync001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_011', 0, function () { var that = new util.Base64() var array = new Uint8Array([99,122,69,122]); var rarray = new Uint8Array([115,49,51]); @@ -1830,13 +1830,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecodeSync002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_013 * @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecodeSync002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_013', 0, function () { var that = new util.Base64() var array = new Uint8Array([81,109,70,122,90,84,89,48,73,69,53,118,90,71,85,117,97,110,77,61]); var rarray = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]); @@ -1847,13 +1847,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecodeSync003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_014 * @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecodeSync003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_014', 0, function () { var that = new util.Base64() var array = new Uint8Array([81,109,70,122,90,84,89,48,73,69,86,117,89,50,57,107,97,87, 53,110,73,71,108,117,73,69,53,118,90,71,85,117,97,110,77,61]); @@ -1866,13 +1866,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecodeSync004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_012 * @tc.desc: Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecodeSync004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR37_012', 0, function () { var that = new util.Base64() var array = new Uint8Array([113,75,54,98,47,119,61,61]); var rarray = new Uint8Array([168, 174, 155, 255]); @@ -1901,13 +1901,13 @@ describe('Base64Test', function () { //base64 EncodeAsync test /** - * @tc.name: testEncode001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_015 * @tc.desc: Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncode001', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_015', 0, async function () { var that = await new util.Base64(); var array = new Uint8Array([115,49,51]); var rarray = new Uint8Array([99,122,69,122]); @@ -1919,13 +1919,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncode002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_018 * @tc.desc: Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncode002', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_018', 0, async function () { var that = new util.Base64() var array = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]); var rarray = new Uint8Array([81,109,70,122,90,84,89,48,73,69,53,118,90,71,85,117,97,110,77,61]); @@ -1937,13 +1937,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncode003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_019 * @tc.desc: Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncode003', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_019', 0, async function () { var that = new util.Base64() var array = new Uint8Array([66,97,115,101,54,52,32,69,110,99,111,100,105,110,103,32,105,110,32, 78,111,100,101,46,106,115]); @@ -1957,13 +1957,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncode004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_016 * @tc.desc: Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncode004', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_016', 0, async function () { var that = new util.Base64() var array = new Uint8Array([168, 174, 155, 255]); var rarray = new Uint8Array([113,75,54,98,47,119,61,61]); @@ -1975,13 +1975,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncode005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_017 * @tc.desc: Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncode005', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_017', 0, async function () { var that = new util.Base64() var array = new Uint8Array([66, 97, 115, 101, 54, 52]); var rarray = new Uint8Array([81, 109, 70, 122, 90, 84, 89, 48]); @@ -1993,12 +1993,12 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncodeToString001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_020 * @tc.desc: Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeToString001', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_020', 0, async function () { var that = new util.Base64() var array = new Uint8Array([115,49,51]); that.encodeToString(array).then(val=>{ @@ -2007,12 +2007,12 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncodeToString002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_023 * @tc.desc: Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeToString002', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_023', 0, async function () { var that = new util.Base64() var array = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]); that.encodeToString(array).then(val=>{ @@ -2021,12 +2021,12 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncodeToString003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_024 * @tc.desc: Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeToString003', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_024', 0, async function () { var that = new util.Base64() var array = new Uint8Array([81,109,70,122,90,84,89,48,73,69,86,117,89,50,57,107,97,87,53,110,73,71,108, 117,73,69,53,118,90,71,85,117,97,110,77,61]); @@ -2036,12 +2036,12 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncodeToString004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_021 * @tc.desc: Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeToString004', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_021', 0, async function () { var that = new util.Base64() var array = new Uint8Array([168, 174, 155, 255]); that.encodeToString(array).then(val=>{ @@ -2050,12 +2050,12 @@ describe('Base64Test', function () { }) /** - * @tc.name: testEncodeToString005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_022 * @tc.desc: Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testEncodeToString005', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_022', 0, async function () { var that = new util.Base64() var array = new Uint8Array([66, 97, 115, 101, 54, 52]); that.encodeToString(array).then(val=>{ @@ -2064,13 +2064,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecode001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_025 * @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8 array into a newly allocated u8 array. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecode001', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_025', 0, async function () { var that = new util.Base64() var buff = 'czEz'; var array = new Uint8Array([115,49,51]); @@ -2082,13 +2082,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecode002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_027 * @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8 array into a newly allocated u8 array. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecode002', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_027', 0, async function () { var that = new util.Base64() var buff = 'QmFzZTY0IE5vZGUuanM='; var array = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]); @@ -2100,13 +2100,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecode003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_028 * @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8 array into a newly allocated u8 array. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecode003', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_028', 0, async function () { var that = new util.Base64() var buff = 'QmFzZTY0IEVuY29kaW5nIGluIE5vZGUuanM='; var array = new Uint8Array([66,97,115,101,54,52,32,69,110,99,111,100,105,110,103,32,105,110,32,78, @@ -2119,13 +2119,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecode004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_026 * @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8 array into a newly allocated u8 array. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecode004', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_026', 0, async function () { var that = new util.Base64() var buff = 'qK6b/w=='; var array = new Uint8Array([168, 174, 155, 255]); @@ -2155,13 +2155,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecode001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_025 * @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8 array into a newly allocated u8 array. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecode001', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_025', 0, async function () { var that = new util.Base64() var array = new Uint8Array([99,122,69,122]); var rarray = new Uint8Array([115,49,51]); @@ -2173,13 +2173,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecode002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_027 * @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8 array into a newly allocated u8 array. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecode002', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_027', 0, async function () { var that = new util.Base64() var array = new Uint8Array([81,109,70,122,90,84,89,48,73,69,53,118,90,71,85,117,97,110,77,61]); var rarray = new Uint8Array([66, 97, 115, 101, 54, 52, 32, 78, 111, 100, 101, 46, 106, 115]); @@ -2191,13 +2191,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecode003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_028 * @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8 array into a newly allocated u8 array. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecode003', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_028', 0, async function () { var that = new util.Base64() var array = new Uint8Array([81,109,70,122,90,84,89,48,73,69,86,117,89,50,57,107,97,87,53,110,73,71,108, 117,73,69,53,118,90,71,85,117,97,110,77,61]); @@ -2211,13 +2211,13 @@ describe('Base64Test', function () { }) /** - * @tc.name: testDecode004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR37_026 * @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8 array into a newly allocated u8 array. * @tc.require: AR000GFB2Q * @tc.author: bihu */ - it('testDecode004', 0, async function () { + it('SUB_Runtime_JSAPI_SR000GGR37_026', 0, async function () { var that = new util.Base64() var array = new Uint8Array([113,75,54,98,47,119,61,61]); var rarray = new Uint8Array([168, 174, 155, 255]); @@ -2250,12 +2250,12 @@ describe('Base64Test', function () { describe('RationalNumberFunTest', function () { /** - * @tc.name: testRationalNumberCreateRationalFromString001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_001 * @tc.desc: Creates a RationalNumber object based on a given string. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberCreateRationalFromString001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_001', 0, function () { var pro = new util.RationalNumber(1, 2) var res = pro.createRationalFromString('-1:2') var result1 = res.valueOf() @@ -2263,12 +2263,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberCreateRationalFromString002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_002 * @tc.desc: Creates a RationalNumber object based on a given string. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberCreateRationalFromString002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_002', 0, function () { var pro = new util.RationalNumber(1, 2) var res = pro.createRationalFromString('+3/4') var result1 = res.valueOf() @@ -2276,12 +2276,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberCreateRationalFromString003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_003 * @tc.desc: Creates a RationalNumber object based on a given string. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberCreateRationalFromString003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_003', 0, function () { var pro = new util.RationalNumber(1, 2) var res = pro.createRationalFromString('+3:-4') var result1 = res.valueOf() @@ -2289,12 +2289,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberCreateRationalFromString004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_004 * @tc.desc: Creates a RationalNumber object based on a given string. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberCreateRationalFromString004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_004', 0, function () { var pro = new util.RationalNumber(1, 2) var res = pro.createRationalFromString('+2:4') var result1 = res.valueOf() @@ -2315,12 +2315,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberCompare001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_010 * @tc.desc: Compares the current RationalNumber object with a given object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberCompare001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_010', 0, function () { var pro = new util.RationalNumber(2, 1) var proc = new util.RationalNumber(3, 4) var res = pro.compareTo(proc) @@ -2328,12 +2328,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberCompare002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_007 * @tc.desc: Compares the current RationalNumber object with a given object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberCompare002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_007', 0, function () { var pro = new util.RationalNumber(2, 1) var proc = new util.RationalNumber(0, 0) var res = pro.compareTo(proc) @@ -2341,12 +2341,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberCompare003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_011 * @tc.desc: Compares the current RationalNumber object with a given object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberCompare003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_011', 0, function () { var pro = new util.RationalNumber(2, 1) var proc = new util.RationalNumber(8, 3) var res = pro.compareTo(proc) @@ -2354,12 +2354,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberCompare004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_005 * @tc.desc: Compares the current RationalNumber object with a given object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberCompare004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_005', 0, function () { var pro = new util.RationalNumber(2, 1) var proc = new util.RationalNumber(2, 1) var res = pro.compareTo(proc) @@ -2367,12 +2367,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberCompare005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_006 * @tc.desc: Compares the current RationalNumber object with a given object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberCompare005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_006', 0, function () { var pro = new util.RationalNumber(0, 0) var proc = new util.RationalNumber(2, 1) var res = pro.compareTo(proc) @@ -2380,12 +2380,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberEquals001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_016 * @tc.desc: Checks whether a given object is the same as the current RationalNumber object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberEquals001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_016', 0, function () { var pro = new util.RationalNumber(2, 1) var proc = new util.RationalNumber(3, 4) var res = pro.equals(proc) @@ -2393,12 +2393,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberEquals002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_014 * @tc.desc: Checks whether a given object is the same as the current RationalNumber object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberEquals002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_014', 0, function () { var pro = new util.RationalNumber(2, 1) var proc = new util.RationalNumber(4, 2) var res = pro.equals(proc) @@ -2432,12 +2432,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberEquals005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_015 * @tc.desc: Checks whether a given object is the same as the current RationalNumber object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberEquals005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_015', 0, function () { var pro = new util.RationalNumber(-2, 0) var proc = new util.RationalNumber(2, 0) var res = pro.equals(proc) @@ -2457,12 +2457,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberValueOf002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_012 * @tc.desc: Obtains the value of the current RationalNumber object as a number. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberValueOf002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_012', 0, function () { var pro = new util.RationalNumber(2, 10) var res = pro.valueOf() expect(res).assertEqual(0.2) @@ -2481,12 +2481,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberValueOf004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_013 * @tc.desc: Obtains the value of the current RationalNumber object as a number. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberValueOf004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_013', 0, function () { var pro = new util.RationalNumber(4, 2) var res = pro.valueOf() expect(res).assertEqual(2) @@ -2505,24 +2505,24 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberGetCommonDivisor001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_017 * @tc.desc: Obtains the greatest common divisor of two specified numbers. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberGetCommonDivisor001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_017', 0, function () { var pro = new util.RationalNumber(0, 0) var res = pro.getCommonDivisor(4, 8) expect(res).assertEqual(4) }) /** - * @tc.name: testRationalNumberGetCommonDivisor002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_018 * @tc.desc: Obtains the greatest common divisor of two specified numbers. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberGetCommonDivisor002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_018', 0, function () { var pro = new util.RationalNumber(0, 0) var res = pro.getCommonDivisor(10, 15) expect(res).assertEqual(5) @@ -2541,12 +2541,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberGetCommonDivisor004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_019 * @tc.desc: Obtains the greatest common divisor of two specified numbers. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberGetCommonDivisor004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_019', 0, function () { var pro = new util.RationalNumber(0, 0) var res = pro.getCommonDivisor(8, 16) expect(res).assertEqual(8) @@ -2565,12 +2565,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberGetDenominator001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_023 * @tc.desc: Obtains the denominator of the current RationalNumber object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberGetDenominator001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_023', 0, function () { var pro = new util.RationalNumber(2, 1) var res = pro.getDenominator() expect(res).assertEqual(1) @@ -2589,12 +2589,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberGetDenominator003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_025 * @tc.desc: Obtains the denominator of the current RationalNumber object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberGetDenominator003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_025', 0, function () { var pro = new util.RationalNumber(2, 0) var res = pro.getDenominator() expect(res).assertEqual(0) @@ -2625,36 +2625,48 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberGetNumerator001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_024 + * @tc.desc: Obtains the denominator of the current RationalNumber object. + * @tc.require: AR000GFB5A + * @tc.author: liuqiang + */ + it('SUB_Runtime_JSAPI_SR000GGR38_024', 0, function () { + var pro = new util.RationalNumber(6, -3) + var res = pro.getDenominator() + expect(res).assertEqual(1) + }) + + /** + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_021 * @tc.desc: Obtains the numerator of the current RationalNumber object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberGetNumerator001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_021', 0, function () { var pro = new util.RationalNumber(-2, 1) var res = pro.getNumerator() expect(res).assertEqual(-2) }) /** - * @tc.name: testRationalNumberGetNumerator002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_022 * @tc.desc: Obtains the numerator of the current RationalNumber object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberGetNumerator002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_022', 0, function () { var pro = new util.RationalNumber(0, 3) var res = pro.getNumerator() expect(res).assertEqual(0) }) /** - * @tc.name: testRationalNumberGetNumerator003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_020 * @tc.desc: Obtains the numerator of the current RationalNumber object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberGetNumerator003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_020', 0, function () { var pro = new util.RationalNumber(2, 4) var res = pro.getNumerator() expect(res).assertEqual(1) @@ -2685,12 +2697,12 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberIsFinite001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_028 * @tc.desc: Checks whether the current RationalNumber object represents a finite value. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberIsFinite001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_028', 0, function () { var pro = new util.RationalNumber(-2, 1) var res = pro.isFinite() expect(res).assertEqual(true) @@ -2709,24 +2721,24 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberIsFinite003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_026 * @tc.desc: Checks whether the current RationalNumber object represents a finite value. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberIsFinite003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_026', 0, function () { var pro = new util.RationalNumber(2, 0) var res = pro.isFinite() expect(res).assertEqual(false) }) /** - * @tc.name: testRationalNumberIsFinite004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_027 * @tc.desc: Checks whether the current RationalNumber object represents a finite value. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberIsFinite004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_027', 0, function () { var pro = new util.RationalNumber(1, 3) var res = pro.isFinite() expect(res).assertEqual(true) @@ -2745,48 +2757,48 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberIsNaN001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_030 * @tc.desc: Checks whether the current RationalNumber object represents a finite value. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberIsNaN001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_030', 0, function () { var pro = new util.RationalNumber(-2, 1) var res = pro.isNaN() expect(res).assertEqual(false) }) /** - * @tc.name: testRationalNumberIsNaN002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_031 * @tc.desc: Checks whether the current RationalNumber object represents a Not-a-Number (NaN) value. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberIsNaN002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_031', 0, function () { var pro = new util.RationalNumber(0, 3) var res = pro.isNaN() expect(res).assertEqual(false) }) /** - * @tc.name: testRationalNumberIsNaN003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_029 * @tc.desc: Checks whether the current RationalNumber object represents a Not-a-Number (NaN) value. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberIsNaN003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_029', 0, function () { var pro = new util.RationalNumber(0, 0) var res = pro.isNaN() expect(res).assertEqual(true) }) /** - * @tc.name: testRationalNumberIsNaN004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_032 * @tc.desc: Checks whether the current RationalNumber object represents a Not-a-Number (NaN) value. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberIsNaN004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_032', 0, function () { var pro = new util.RationalNumber(10, 0) var res = pro.isNaN() expect(res).assertEqual(false) @@ -2805,48 +2817,48 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberIsZero001 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_034 * @tc.desc: Checks whether the current RationalNumber object represents the value 0. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberIsZero001', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_034', 0, function () { var pro = new util.RationalNumber(-2, 1) var res = pro.isZero() expect(res).assertEqual(false) }) /** - * @tc.name: testRationalNumberIsZero002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_033 * @tc.desc: Checks whether the current RationalNumber object represents the value 0. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberIsZero002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_033', 0, function () { var pro = new util.RationalNumber(0, 3) var res = pro.isZero() expect(res).assertEqual(true) }) /** - * @tc.name: testRationalNumberIsZero003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_035 * @tc.desc: Checks whether the current RationalNumber object represents the value 0. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberIsZero003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_035', 0, function () { var pro = new util.RationalNumber(0, 0) var res = pro.isZero() expect(res).assertEqual(false) }) /** - * @tc.name: testRationalNumberIsZero004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_036 * @tc.desc: Checks whether the current RationalNumber object represents the value 0. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberIsZero004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_036', 0, function () { var pro = new util.RationalNumber(10, 2) var res = pro.isZero() expect(res).assertEqual(false) @@ -2877,48 +2889,48 @@ describe('RationalNumberFunTest', function () { }) /** - * @tc.name: testRationalNumberToString002 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_037 * @tc.desc: Obtains a string representation of the current RationalNumber object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberToString002', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_037', 0, function () { var pro = new util.RationalNumber(0, 0) var res = pro.toString() expect(res).assertEqual("NaN") }) /** - * @tc.name: testRationalNumberToString003 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_038 * @tc.desc: Obtains a string representation of the current RationalNumber object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberToString003', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_038', 0, function () { var pro = new util.RationalNumber(3, 0) var res = pro.toString() expect(res).assertEqual("Infinity") }) /** - * @tc.name: testRationalNumberToString004 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_039 * @tc.desc: Obtains a string representation of the current RationalNumber object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberToString004', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_039', 0, function () { var pro = new util.RationalNumber(-3, 0) var res = pro.toString() expect(res).assertEqual("-Infinity") }) /** - * @tc.name: testRationalNumberToString005 + * @tc.name: SUB_Runtime_JSAPI_SR000GGR38_040 * @tc.desc: Obtains a string representation of the current RationalNumber object. * @tc.require: AR000GFB5A * @tc.author: liuqiang */ - it('testRationalNumberToString005', 0, function () { + it('SUB_Runtime_JSAPI_SR000GGR38_040', 0, function () { var pro = new util.RationalNumber(2, 3) var res = pro.toString() expect(res).assertEqual('2/3') diff --git a/compileruntime/worker_lib_standard/src/main/js/default/pages/index/index.css b/compileruntime/worker_lib_standard/src/main/js/default/pages/index/index.css index 31a367638424feefb8cc68f60cb809bef8443197..db2b048d654812f46761f4af2caad2818e70d505 100644 --- a/compileruntime/worker_lib_standard/src/main/js/default/pages/index/index.css +++ b/compileruntime/worker_lib_standard/src/main/js/default/pages/index/index.css @@ -1,3 +1,18 @@ +/* + * Copyright (C) 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + .container { display: flex; flex-direction: column; diff --git a/compileruntime/worker_lib_standard/src/main/js/default/pages/index/index.hml b/compileruntime/worker_lib_standard/src/main/js/default/pages/index/index.hml index 7a8ab4865b6e43d10ce484292f95f591070abfc1..8590b3287297d0dd5968fd47d2324c3e4151c498 100644 --- a/compileruntime/worker_lib_standard/src/main/js/default/pages/index/index.hml +++ b/compileruntime/worker_lib_standard/src/main/js/default/pages/index/index.hml @@ -1,3 +1,18 @@ + +
{{ $t('strings.hello') }} {{ title }} diff --git a/compileruntime/worker_lib_standard/src/main/js/default/pages/second/second.css b/compileruntime/worker_lib_standard/src/main/js/default/pages/second/second.css index 31a367638424feefb8cc68f60cb809bef8443197..db2b048d654812f46761f4af2caad2818e70d505 100644 --- a/compileruntime/worker_lib_standard/src/main/js/default/pages/second/second.css +++ b/compileruntime/worker_lib_standard/src/main/js/default/pages/second/second.css @@ -1,3 +1,18 @@ +/* + * Copyright (C) 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + .container { display: flex; flex-direction: column; diff --git a/compileruntime/worker_lib_standard/src/main/js/default/pages/second/second.hml b/compileruntime/worker_lib_standard/src/main/js/default/pages/second/second.hml index d75ce9375e151799d8f0a9ad4cb56138751561d3..4f0c7498ba0906d3f7f2def8628329db6c7ca192 100644 --- a/compileruntime/worker_lib_standard/src/main/js/default/pages/second/second.hml +++ b/compileruntime/worker_lib_standard/src/main/js/default/pages/second/second.hml @@ -1,3 +1,18 @@ + +
{{ $t('strings.page') }} diff --git a/compileruntime/worker_lib_standard/src/main/js/test/Worker.test.js b/compileruntime/worker_lib_standard/src/main/js/test/Worker.test.js index f10a4b553a53301072f1048cac4542b689d6162e..b3424fdef4d5fe2bf65abb7a94f00127e30dd85d 100644 --- a/compileruntime/worker_lib_standard/src/main/js/test/Worker.test.js +++ b/compileruntime/worker_lib_standard/src/main/js/test/Worker.test.js @@ -36,32 +36,32 @@ describe('workerTest', function () { // check worker constructor is ok it('worker_constructor_test_001', 0, function () { - var ss = new worker.Worker("workers/worker.js") + let ss = new worker.Worker("workers/worker.js") expect(ss != null).assertTrue() }) it('worker_constructor_test_002', 0, function () { - var ss = new worker.Worker("workers/worker.js",{name:"second worker",shared:"False"}) + let ss = new worker.Worker("workers/worker.js",{name:"second worker",shared:"False"}) expect(ss != null).assertTrue() }) it('worker_constructor_test_003', 0, function () { - var ss = new worker.Worker("workers/worker.js",{type:"classic",name:"second worker",shared:"false"}) + let ss = new worker.Worker("workers/worker.js",{type:"classic",name:"second worker",shared:"false"}) expect(ss != null).assertTrue() }) it('worker_constructor_test_004', 0, function () { - var ss = new worker.Worker("workers/worker.js",{type:"classic",name:"third worker",shared:"true"}) + let ss = new worker.Worker("workers/worker.js",{type:"classic",name:"third worker",shared:"true"}) expect(ss != null).assertTrue() }) // check postMessage is ok // main post "hello world", will receive "hello world worker" it('worker_postMessage_test_001', 0, async function (done) { - var ss = new worker.Worker("workers/worker_002.js"); + let ss = new worker.Worker("workers/worker_002.js"); - var res = undefined - var flag = false + let res = undefined + let flag = false ss.onmessage = function (e) { res = e.data; @@ -79,10 +79,10 @@ describe('workerTest', function () { // check postMessage is ok // main post 12 , will receive 12 * 2 + 1 it('worker_postMessage_test_002', 0, async function (done) { - var ss = new worker.Worker("workers/worker_003.js"); + let ss = new worker.Worker("workers/worker_003.js"); - var res = undefined - var flag = false + let res = undefined + let flag = false ss.onmessage = function (e) { res = e.data; @@ -100,10 +100,10 @@ describe('workerTest', function () { // check postMessage is ok // main post {message:"hello world"} , will receive {message:"hello world worker"} it('worker_postMessage_test_003', 0, async function (done) { - var ss = new worker.Worker("workers/worker_004.js"); + let ss = new worker.Worker("workers/worker_004.js"); - var res = undefined - var flag = false + let res = undefined + let flag = false ss.onmessage = function (e) { res = e.data.message; @@ -120,10 +120,10 @@ describe('workerTest', function () { // check worker name is ok it('worker_postMessage_test_004', 0, async function (done) { - var ss = new worker.Worker("workers/worker_005.js", {name: "zhangsan"}); + let ss = new worker.Worker("workers/worker_005.js", {name: "zhangsan"}); - var res = undefined - var flag = false + let res = undefined + let flag = false ss.onmessage = function (e) { res = e.data; @@ -140,13 +140,13 @@ describe('workerTest', function () { // check worker transfer buffer is ok it('worker_postMessage_test_005', 0, function () { - var ss = new worker.Worker("workers/worker_006.js"); + let ss = new worker.Worker("workers/worker_006.js"); const buffer = new ArrayBuffer(8) expect(buffer.byteLength).assertEqual(8) ss.postMessage(buffer, [buffer]) - var length = undefined; - var exception = undefined; + let length = undefined; + let exception = undefined; try { length = buffer.byteLength; } catch (e) { @@ -165,10 +165,10 @@ describe('workerTest', function () { // check worker handle error is ok it('worker_postMessage_test_006', 0, async function (done) { - var ss = new worker.Worker("workers/worker_007.js"); + let ss = new worker.Worker("workers/worker_007.js"); - var res = undefined - var flag = false + let res = undefined + let flag = false ss.onerror = function (e) { res = e.message; @@ -185,9 +185,9 @@ describe('workerTest', function () { // check worker terminate is ok it('worker_terminate_test_001', 0, async function (done) { - var ss = new worker.Worker("workers/worker.js"); - var res = 0 - var flag = false + let ss = new worker.Worker("workers/worker.js"); + let res = 0 + let flag = false ss.onexit = function () { flag = true @@ -203,9 +203,9 @@ describe('workerTest', function () { // check worker terminate is ok it('worker_terminate_test_002', 0, async function (done) { - var ss = new worker.Worker("workers/worker.js"); - var res = 0 - var flag = false + let ss = new worker.Worker("workers/worker.js"); + let res = 0 + let flag = false ss.onexit = function () { flag = true @@ -225,9 +225,9 @@ describe('workerTest', function () { // check worker terminate is ok it('worker_terminate_test_003', 0, async function (done) { - var ss = new worker.Worker("workers/worker.js"); - var res = 0 - var flag = false + let ss = new worker.Worker("workers/worker.js"); + let res = 0 + let flag = false ss.onexit = function () { flag = true @@ -252,9 +252,9 @@ describe('workerTest', function () { // check worker on function is ok it('worker_on_test_001', 0, function () { - var ss = new worker.Worker("workers/worker.js"); + let ss = new worker.Worker("workers/worker.js"); - var times = 0; + let times = 0; ss.on("zhangsan", ()=>{ times++; }) @@ -266,9 +266,9 @@ describe('workerTest', function () { // check worker on function is ok it('worker_on_test_002', 0, function () { - var ss = new worker.Worker("workers/worker.js"); + let ss = new worker.Worker("workers/worker.js"); - var times = 0; + let times = 0; ss.on("zhangsan", ()=>{ times--; }) @@ -285,14 +285,14 @@ describe('workerTest', function () { // check worker on function is ok it('worker_on_test_003', 0, function () { - var ss = new worker.Worker("workers/worker.js"); + let ss = new worker.Worker("workers/worker.js"); - var times = 0; + let times = 0; ss.on("zhangsan", ()=>{ times++; }) - for (var i=0;i<10;i++) + for (let i=0;i<10;i++) { ss.dispatchEvent({type: "zhangsan"}) } @@ -302,9 +302,9 @@ describe('workerTest', function () { // check worker once function is ok it('worker_once_test_001', 0, function () { - var ss = new worker.Worker("workers/worker.js"); + let ss = new worker.Worker("workers/worker.js"); - var times = 0; + let times = 0; ss.once("zhangsan", ()=>{ times++; }) @@ -314,14 +314,14 @@ describe('workerTest', function () { // check worker once function is ok it('worker_once_test_002', 0, function () { - var ss = new worker.Worker("workers/worker.js"); + let ss = new worker.Worker("workers/worker.js"); - var times = 0; + let times = 0; ss.once("zhangsan", ()=>{ times++; }) - for (var i=0;i<10;i++) + for (let i=0;i<10;i++) { ss.dispatchEvent({type: "zhangsan"}) } @@ -330,9 +330,9 @@ describe('workerTest', function () { }) it('worker_once_test_003', 0, function () { - var ss = new worker.Worker("workers/worker.js"); + let ss = new worker.Worker("workers/worker.js"); - var times = 0; + let times = 0; ss.once("zhangsan", ()=>{ times--; }) @@ -349,9 +349,9 @@ describe('workerTest', function () { // check worker addEventListener function is ok it('worker_addEventListener_test_001', 0, function () { - var ss = new worker.Worker("workers/worker.js"); + let ss = new worker.Worker("workers/worker.js"); - var times = 0; + let times = 0; ss.addEventListener("zhangsan", ()=>{ times++; }) @@ -364,9 +364,9 @@ describe('workerTest', function () { // check worker addEventListener function is ok it('worker_addEventListener_test_002', 0, function () { - var ss = new worker.Worker("workers/worker.js"); + let ss = new worker.Worker("workers/worker.js"); - var times = 0; + let times = 0; ss.addEventListener("zhangsan", ()=>{ times++; }) @@ -383,14 +383,14 @@ describe('workerTest', function () { // check worker addEventListener function is ok it('worker_addEventListener_test_003', 0, function () { - var ss = new worker.Worker("workers/worker.js"); + let ss = new worker.Worker("workers/worker.js"); - var times = 0; + let times = 0; ss.addEventListener("zhangsan", ()=>{ times++; }) - for (var i=0;i<10;i++) + for (let i=0;i<10;i++) { ss.dispatchEvent({type: "zhangsan"}) } @@ -400,9 +400,9 @@ describe('workerTest', function () { // check worker off function is ok it('worker_off_test_001', 0, function () { - var ss = new worker.Worker("workers/worker.js"); + let ss = new worker.Worker("workers/worker.js"); - var zhangsan_times = 0; + let zhangsan_times = 0; ss.on("zhangsan", ()=>{ zhangsan_times++; }) @@ -419,9 +419,9 @@ describe('workerTest', function () { // check worker off function is ok it('worker_off_test_002', 0, function () { - var ss = new worker.Worker("workers/worker.js"); + let ss = new worker.Worker("workers/worker.js"); - var zhangsan_times = 0; + let zhangsan_times = 0; ss.on("zhangsan", ()=>{ zhangsan_times++; }) @@ -430,7 +430,7 @@ describe('workerTest', function () { ss.dispatchEvent({type: "zhangsan"}) expect(zhangsan_times).assertEqual(2) - for (var i=0;i<3;i++) + for (let i=0;i<3;i++) { ss.off("zhangsan") } @@ -441,9 +441,9 @@ describe('workerTest', function () { // check worker removeEventListener function is ok it('worker_removeListener_test_001', 0, function () { - var ss = new worker.Worker("workers/worker.js"); + let ss = new worker.Worker("workers/worker.js"); - var zhangsan_times = 0; + let zhangsan_times = 0; ss.addEventListener("zhangsan", ()=>{ zhangsan_times++; }) @@ -460,9 +460,9 @@ describe('workerTest', function () { // check worker removeEventListener function is ok it('worker_removeListener_test_002', 0, function () { - var ss = new worker.Worker("workers/worker.js"); + let ss = new worker.Worker("workers/worker.js"); - var zhangsan_times = 0; + let zhangsan_times = 0; ss.addEventListener("zhangsan", ()=>{ zhangsan_times++; }) @@ -471,7 +471,7 @@ describe('workerTest', function () { ss.dispatchEvent({type: "zhangsan"}) expect(zhangsan_times).assertEqual(2) - for (var i=0;i<3;i++) + for (let i=0;i<3;i++) { ss.removeEventListener("zhangsan") } @@ -483,14 +483,14 @@ describe('workerTest', function () { // check worker removeAllListener function is ok it('worker_removeListener_test_003', 0, function () { - var ss = new worker.Worker("workers/worker.js"); + let ss = new worker.Worker("workers/worker.js"); - var zhangsan_times = 0; + let zhangsan_times = 0; ss.addEventListener("zhangsan", ()=>{ zhangsan_times++; }) - var lisi_times = 0; + let lisi_times = 0; ss.addEventListener("lisi", ()=>{ lisi_times++; }) @@ -515,9 +515,9 @@ describe('workerTest', function () { // check parentPort.close is ok it('worker_parentPortClose_test_001', 0, async function (done) { - var ss = new worker.Worker("workers/worker_008.js"); - var res = 0 - var flag = false; + let ss = new worker.Worker("workers/worker_008.js"); + let res = 0 + let flag = false; ss.onexit = function (e) { res++; @@ -534,9 +534,9 @@ describe('workerTest', function () { // check parentPort.close is ok it('worker_parentPortClose_test_002', 0, async function (done) { - var ss = new worker.Worker("workers/worker_008.js"); - var res = 0 - var flag = false; + let ss = new worker.Worker("workers/worker_008.js"); + let res = 0 + let flag = false; ss.onexit = function () { flag = true @@ -559,9 +559,9 @@ describe('workerTest', function () { // check onmessageerror is ok it('worker_onmessageerror_test_001', 0, async function (done) { - var ss = new worker.Worker("workers/worker_008.js"); - var res = 0 - var flag = false; + let ss = new worker.Worker("workers/worker_008.js"); + let res = 0 + let flag = false; ss.onexit = function () { flag = true @@ -581,9 +581,9 @@ describe('workerTest', function () { // check onmessageerror is ok it('worker_onmessageerror_test_002', 0, async function (done) { - var ss = new worker.Worker("workers/worker_008.js"); - var res = 0 - var flag = false; + let ss = new worker.Worker("workers/worker_008.js"); + let res = 0 + let flag = false; ss.onmessageerror = function (e) { flag = true; @@ -601,9 +601,9 @@ describe('workerTest', function () { // check new second worker is ok it('worker_new_second_worker_test_001', 0, async function (done) { - var ss = new worker.Worker("workers/worker_009.js"); - var flag = false; - var res = undefined; + let ss = new worker.Worker("workers/worker_009.js"); + let flag = false; + let res = undefined; ss.onmessage = function (e) { flag = true; @@ -622,9 +622,9 @@ describe('workerTest', function () { // check new third worker is ok it('worker_new_second_worker_test_002', 0, async function (done) { - var ss = new worker.Worker("workers/worker_012.js"); - var flag = false; - var res = undefined; + let ss = new worker.Worker("workers/worker_012.js"); + let flag = false; + let res = undefined; ss.onmessage = function (e) { flag = true; @@ -647,9 +647,9 @@ describe('workerTest', function () { // check second worker postMessage number is ok it('worker_second_worker_postMessage_test_001', 0, async function (done) { - var ss = new worker.Worker("workers/worker_010.js"); - var flag = false; - var res = undefined; + let ss = new worker.Worker("workers/worker_010.js"); + let flag = false; + let res = undefined; ss.onmessage = function (e) { flag = true; @@ -672,9 +672,9 @@ describe('workerTest', function () { // check second worker postMessage string is ok it('worker_second_worker_postMessage_test_002', 0, async function (done) { - var ss = new worker.Worker("workers/worker_013.js"); - var flag = false; - var res = undefined; + let ss = new worker.Worker("workers/worker_013.js"); + let flag = false; + let res = undefined; ss.onmessage = function (e) { flag = true; @@ -697,9 +697,9 @@ describe('workerTest', function () { // check second worker postMessage array is ok it('worker_second_worker_postMessage_test_003', 0, async function (done) { - var ss = new worker.Worker("workers/worker_014.js"); - var flag = false; - var res = undefined; + let ss = new worker.Worker("workers/worker_014.js"); + let flag = false; + let res = undefined; ss.onmessage = function (e) { flag = true; @@ -723,9 +723,9 @@ describe('workerTest', function () { // check third worker postMessage is ok it('worker_second_worker_postMessage_test_004', 0, async function (done) { - var ss = new worker.Worker("workers/worker_015.js"); - var flag = false; - var res = undefined; + let ss = new worker.Worker("workers/worker_015.js"); + let flag = false; + let res = undefined; ss.onmessage = function (e) { flag = true; @@ -748,9 +748,9 @@ describe('workerTest', function () { // check second worker terminate is ok it('worker_second_worker_terminate_test_001', 0, async function (done) { - var ss = new worker.Worker("workers/worker_011.js"); - var flag = false; - var res = undefined; + let ss = new worker.Worker("workers/worker_011.js"); + let flag = false; + let res = undefined; ss.onmessage = function (e) { flag = true; diff --git a/compileruntime/xml_lib_standard/src/main/js/default/pages/index/index.css b/compileruntime/xml_lib_standard/src/main/js/default/pages/index/index.css index 2b1965821483f4f8c8b97c86ef07fe87ea767d01..5bcfb2e8b6d4da7f7cdefb090c3eeaccd70009c9 100644 --- a/compileruntime/xml_lib_standard/src/main/js/default/pages/index/index.css +++ b/compileruntime/xml_lib_standard/src/main/js/default/pages/index/index.css @@ -1,3 +1,18 @@ +/* + * Copyright (C) 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + .container { flex-direction: column; justify-content: center; diff --git a/compileruntime/xml_lib_standard/src/main/js/default/pages/index/index.hml b/compileruntime/xml_lib_standard/src/main/js/default/pages/index/index.hml index abeadefb6faa934b6dc51d6bbcf66b765485e5ad..5067cf544c3dc561a924378117736511fa2935d6 100644 --- a/compileruntime/xml_lib_standard/src/main/js/default/pages/index/index.hml +++ b/compileruntime/xml_lib_standard/src/main/js/default/pages/index/index.hml @@ -1,3 +1,17 @@ +
{{ $t('strings.hello') }} {{ title }}