From 9093fc62754ccf088e4e2d619079b51eeac20f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E6=9B=A6?= Date: Fri, 18 Mar 2022 10:15:23 +0800 Subject: [PATCH] =?UTF-8?q?MISC=E7=94=A8=E4=BE=8B=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 高曦 --- .../signature/openharmony_sx.p7b | Bin 3437 -> 3443 bytes .../signature/openharmony_sx.p7b | Bin 3437 -> 3443 bytes .../js/default/test/PasteBoardJsunit.test.js | 1943 +++++++++++++---- .../signature/openharmony_sx.p7b | Bin 3437 -> 3443 bytes .../TimeTest_js/signature/openharmony_sx.p7b | Bin 3437 -> 3443 bytes .../js/default/test/SystemTimeJsunit.test.js | 87 +- .../TimerTest_js/signature/openharmony_sx.p7b | Bin 3437 -> 3443 bytes 7 files changed, 1503 insertions(+), 527 deletions(-) diff --git a/miscservices/InputMethodTest_ets/signature/openharmony_sx.p7b b/miscservices/InputMethodTest_ets/signature/openharmony_sx.p7b index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..66b4457a8a81fb8d3356cf46d67226c850944858 100755 GIT binary patch delta 988 zcmZ9L&2QUu9LDQ3ZE4qTNQ_A#Ic>& zsohklC_)unCaN%LC)NW3X&N9v z{JMO9`2dWUoZ0#34%x%smyo&G@p$QSgz7N_L6^X(+4;+dETT`xV+a_}ocT{gj>j`o z@p1gG{lu<5@Y;^Ora4VL@jSYE0&KMxfdrZaNsw4g42SJz^x^>9Y-F?g8s3V|(T($G z{5|(yZ=hSc>gkE2&c&nK=P%&dbY=s`@XTt$cKkK9~r9waIB@<&@~^ zHmeSLj=eW|0eR`1Fd|9V&)O(9>m<#obpbWKz1p}P&c8!|Gi5=Nm+ zKu@OWY*4GK>UMMP~9j0#cfza|;vsB6gI%9D_t|~RV&@%+ob9RRfUFt)5;!dAk zFbKI}4zzaNo?MyE9OR0AI2f8%-PX1V$>W=WR_o`7S*K7c8>#>Uh9vvUj*!k0P@o72 zQYwT&P2xhx`zk0(n46}!VaoODc3x=aNy?D$5{p`ZNEaECumq#o#zw7--OYNgI-(^m z1*(O>ZTT4qa%8~n3?Ww0t#Ui%)a?tDa}#ZxcS_=7)>eq1@$e|YPi zTfI-OPCfC{Z;$^HDeqQ4!M}+eeEm_7{`}1ZRwPNG(;tKX)y;R+NO5CnoJtweQnovT03zP=fldOw&TQ!9XoaG zI5tC-a;T6%NL4Oq2R05voM2*HkdV;0Ax$7n)8K}XKyZOc?64COZqbT3zQ6zTd-NWj z|C7sqTs}f)iT={c>&Nu*(?n!BdTW*tLsXAOBG?OPVrk{zn2x9mv1nxR0y^i4{kOQm;GnH?;@iI|qNC3PLu4y{}^o64afetQ#f{L$%tTQyW^tRnMxWIbVN z*0`fiRKpsn_IxLDZM8(;IFM64;4u*N7_wF=i$XAeFY@sbHz2XL$r4P!)r53IQ#dvt zy^sdyYye%BAA308BI-O(kzSFg4ah1B0R=FD#35U3n_{}I$-|B=r?MtnAw9x7o2E%m z3nZ%Uszc3?2PDse%)ge#(p8~ywA-OVu}1RYC!R&qv*=kOu#h=Zz?9vW)6kHInx+h~ ziEQd#qXufQryOefpwu?YJOg2`clIjtEQB7115g2bf$G*UlH|!r&ZD$c*Ofgw@C!{> zbUeN0Hkkq4M78X+ZK|BwlNBC^9l`Fj2yEKIn<5Sa($-shX5Qi%#^gF~YTplbEsXI5 z0(4=ItJ77MqzKSxn>|>QHCyS=XAAkGwz-Q3g=v=#nyBG7b(*VSYAGXjt?dnY!~&1P z@k6T0W(p9n1mpoBdcYF_y3maApPpA02-Y89(s0CCi@IjU{CB^q!U%jlzxs?<7!Wt#473tCqp@*8?Z zA$(3S_MB4Pw9~Y{A2jpDLMJ=6l|nGSI=>!Ey`)a1;mA;vLqEJ&qpwJ($9nfsOkBQ* zqqE4hupFp9mloCe&G_>3|1Zh>^LX+ILvvUbO{Mecyohd}cV;DqA+dGu;i~cpcCYm~ z`o-;ygDY#z8`p)OKYb|wb@I(;Kjhze7rnUjT-e9&uErLkF$yK4>voBFHNN)ew@!LE zdGn^t;gj#hzl$HrhsB>BzaM|?jp!>EzRW1zqXqWI8%W~P+KYFrUw`}P;NC&`_6K+F MkH7x?LGzb?0ItqZ1poj5 diff --git a/miscservices/PasteBoardTest_js/signature/openharmony_sx.p7b b/miscservices/PasteBoardTest_js/signature/openharmony_sx.p7b index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..66b4457a8a81fb8d3356cf46d67226c850944858 100644 GIT binary patch delta 988 zcmZ9L&2QUu9LDQ3ZE4qTNQ_A#Ic>& zsohklC_)unCaN%LC)NW3X&N9v z{JMO9`2dWUoZ0#34%x%smyo&G@p$QSgz7N_L6^X(+4;+dETT`xV+a_}ocT{gj>j`o z@p1gG{lu<5@Y;^Ora4VL@jSYE0&KMxfdrZaNsw4g42SJz^x^>9Y-F?g8s3V|(T($G z{5|(yZ=hSc>gkE2&c&nK=P%&dbY=s`@XTt$cKkK9~r9waIB@<&@~^ zHmeSLj=eW|0eR`1Fd|9V&)O(9>m<#obpbWKz1p}P&c8!|Gi5=Nm+ zKu@OWY*4GK>UMMP~9j0#cfza|;vsB6gI%9D_t|~RV&@%+ob9RRfUFt)5;!dAk zFbKI}4zzaNo?MyE9OR0AI2f8%-PX1V$>W=WR_o`7S*K7c8>#>Uh9vvUj*!k0P@o72 zQYwT&P2xhx`zk0(n46}!VaoODc3x=aNy?D$5{p`ZNEaECumq#o#zw7--OYNgI-(^m z1*(O>ZTT4qa%8~n3?Ww0t#Ui%)a?tDa}#ZxcS_=7)>eq1@$e|YPi zTfI-OPCfC{Z;$^HDeqQ4!M}+eeEm_7{`}1ZRwPNG(;tKX)y;R+NO5CnoJtweQnovT03zP=fldOw&TQ!9XoaG zI5tC-a;T6%NL4Oq2R05voM2*HkdV;0Ax$7n)8K}XKyZOc?64COZqbT3zQ6zTd-NWj z|C7sqTs}f)iT={c>&Nu*(?n!BdTW*tLsXAOBG?OPVrk{zn2x9mv1nxR0y^i4{kOQm;GnH?;@iI|qNC3PLu4y{}^o64afetQ#f{L$%tTQyW^tRnMxWIbVN z*0`fiRKpsn_IxLDZM8(;IFM64;4u*N7_wF=i$XAeFY@sbHz2XL$r4P!)r53IQ#dvt zy^sdyYye%BAA308BI-O(kzSFg4ah1B0R=FD#35U3n_{}I$-|B=r?MtnAw9x7o2E%m z3nZ%Uszc3?2PDse%)ge#(p8~ywA-OVu}1RYC!R&qv*=kOu#h=Zz?9vW)6kHInx+h~ ziEQd#qXufQryOefpwu?YJOg2`clIjtEQB7115g2bf$G*UlH|!r&ZD$c*Ofgw@C!{> zbUeN0Hkkq4M78X+ZK|BwlNBC^9l`Fj2yEKIn<5Sa($-shX5Qi%#^gF~YTplbEsXI5 z0(4=ItJ77MqzKSxn>|>QHCyS=XAAkGwz-Q3g=v=#nyBG7b(*VSYAGXjt?dnY!~&1P z@k6T0W(p9n1mpoBdcYF_y3maApPpA02-Y89(s0CCi@IjU{CB^q!U%jlzxs?<7!Wt#473tCqp@*8?Z zA$(3S_MB4Pw9~Y{A2jpDLMJ=6l|nGSI=>!Ey`)a1;mA;vLqEJ&qpwJ($9nfsOkBQ* zqqE4hupFp9mloCe&G_>3|1Zh>^LX+ILvvUbO{Mecyohd}cV;DqA+dGu;i~cpcCYm~ z`o-;ygDY#z8`p)OKYb|wb@I(;Kjhze7rnUjT-e9&uErLkF$yK4>voBFHNN)ew@!LE zdGn^t;gj#hzl$HrhsB>BzaM|?jp!>EzRW1zqXqWI8%W~P+KYFrUw`}P;NC&`_6K+F MkH7x?LGzb?0ItqZ1poj5 diff --git a/miscservices/PasteBoardTest_js/src/main/js/default/test/PasteBoardJsunit.test.js b/miscservices/PasteBoardTest_js/src/main/js/default/test/PasteBoardJsunit.test.js index a8d949fbb..308375c1d 100644 --- a/miscservices/PasteBoardTest_js/src/main/js/default/test/PasteBoardJsunit.test.js +++ b/miscservices/PasteBoardTest_js/src/main/js/default/test/PasteBoardJsunit.test.js @@ -475,7 +475,7 @@ describe('PasteBoardTest', function() { assert.equal(pasteData.getRecordCount(), 1) console.log('Checks the pasteboard content') - assert.equal(pasteData.getPrimaryWant(), want) + assert.deepEqual(pasteData.getPrimaryWant(), want) console.log('Checks there is a MIMETYPE_TEXT_WANT MIME type of data') assert.equal(pasteData.hasMimeType(MIMETYPE_TEXT_WANT), true) @@ -736,7 +736,7 @@ describe('PasteBoardTest', function() { assert.equal(pasteData.getRecordAt(0).plainText, textData) assert.equal(pasteData.getRecordAt(1).htmlText, htmlText) assert.equal(pasteData.getRecordAt(2).uri, uriText) - assert.equal(pasteData.getRecordAt(3).want, wantText) + assert.deepEqual(pasteData.getRecordAt(3).want, wantText) console.log('SUB_pasteBoard_function_JS_API_1800 end'); }) @@ -1015,13 +1015,13 @@ describe('PasteBoardTest', function() { console.log('Checks there is no content in the pasteboard') assert.equal(systemPasteboard.hasPasteData(), false) - + console.log('SUB_pasteBoard_function_JS_API_2400 end'); }) - - /** + + /** * @tc.number SUB_pasteBoard_function_JS_API_2500 - * @tc.name Delete one record of Muti records + * @tc.name Deletes replaced record * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1034,54 +1034,49 @@ describe('PasteBoardTest', function() { systemPasteboard.on(contentChanges) systemPasteboard.clear() - var textData = 'Hello World!' - console.log('createPlainTextData = ' + textData) - var pasteData = pasteboard.createPlainTextData(textData) - - var htmlText = 'Hello World!' - console.log('addHtmlRecord = ' + htmlText) - pasteData.addHtmlRecord(htmlText) + var textData0 = 'Hello World0' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) - var wantText = new Want() - console.log('addWantRecord = ' + wantText) - pasteData.addWantRecord(wantText) + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) - var uriText = 'https://www.baidu.com/' - console.log('addUriRecord = ' + uriText) - pasteData.addUriRecord(uriText) + var textData1 = 'Hello World1' + console.log('Replaces the Record = ' + textData1) + var pasteDataRecord = pasteboard.createPlainTextRecord(textData1) + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) - console.log('Checks there is content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), true) - console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 4) + assert.equal(pasteData.getRecordCount(), 1) - console.log('Removes the third Record') - assert.equal(pasteData.removeRecordAt(2), true) + console.log('Checks the pasteboard content') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordAt(0).plainText, textData1) + + console.log('Removes the Record') + assert.equal(pasteData.removeRecordAt(0), true) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 3) + assert.equal(pasteData.getRecordCount(), 0) - console.log('Checks the pasteboard content') - pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordAt(0).plainText, textData) - assert.equal(pasteData.getRecordAt(1).htmlText, htmlText) - assert.equal(pasteData.getRecordAt(2).uri, uriText) + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) console.log('SUB_pasteBoard_function_JS_API_2500 end'); }) - + /** * @tc.number SUB_pasteBoard_function_JS_API_2600 - * @tc.name Replace one record or a null record + * @tc.name Deletes 文本、uri、html、want records * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1094,34 +1089,34 @@ describe('PasteBoardTest', function() { systemPasteboard.on(contentChanges) systemPasteboard.clear() - var textData0 = 'Hello World0' + var textData0 = 'Hello World!' console.log('createPlainTextData = ' + textData0) var pasteData = pasteboard.createPlainTextData(textData0) - console.log('Writes PasteData to the pasteboard') - systemPasteboard.setPasteData(pasteData) + var htmlText0 = 'Hello World!' + console.log('addHtmlRecord = ' + htmlText0) + pasteData.addHtmlRecord(htmlText0) - var textData1 = 'Hello World1' - console.log('Replaces the Record = ' + textData1) - var pasteDataRecord = pasteboard.createPlainTextRecord(textData1) - pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) + var wantText0 = new Want() + console.log('addWantRecord = ' + wantText0) + pasteData.addWantRecord(wantText0) + + var uriText0 = 'https://www.baidu.com/' + console.log('addUriRecord = ' + uriText0) + pasteData.addUriRecord(uriText0) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 1) - - console.log('Checks the pasteboard content') - pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordAt(0).plainText, textData1) + assert.equal(pasteData.getRecordCount(), 4) - var textData2 = '' - console.log('Replaces the Record = ' + textData2) - pasteDataRecord = pasteboard.createPlainTextRecord(textData2) - assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) + console.log('Removes the Record') + assert.equal(pasteData.removeRecordAt(0), true) + assert.equal(pasteData.removeRecordAt(1), true) + assert.equal(pasteData.removeRecordAt(2), true) + assert.equal(pasteData.removeRecordAt(3), true) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) @@ -1130,12 +1125,15 @@ describe('PasteBoardTest', function() { pasteData = systemPasteboard.getPasteData() assert.equal(pasteData.getRecordCount(), 0) + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + console.log('SUB_pasteBoard_function_JS_API_2600 end'); }) - + /** * @tc.number SUB_pasteBoard_function_JS_API_2700 - * @tc.name Replace Muti records + * @tc.name Replaces 文本 record * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1152,64 +1150,34 @@ describe('PasteBoardTest', function() { console.log('createPlainTextData = ' + textData0) var pasteData = pasteboard.createPlainTextData(textData0) - var htmlText0 = 'Hello World!' - console.log('addHtmlRecord = ' + htmlText0) - pasteData.addHtmlRecord(htmlText0) - - var wantText0 = new Want() - console.log('addWantRecord = ' + wantText0) - pasteData.addWantRecord(wantText0) - - var uriText0 = 'https://www.baidu.com/' - console.log('addUriRecord = ' + uriText0) - pasteData.addUriRecord(uriText0) - console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 4) + assert.equal(pasteData.getRecordCount(), 1) var textData1 = 'Hello World1' console.log('Replaces the PlainText = ' + textData1) var pasteDataRecord = pasteboard.createPlainTextRecord(textData1) assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) - var htmlText1 = 'Hello World 1' - console.log('Replaces the htmlText = ' + htmlText1) - pasteDataRecord = pasteboard.createHtmlTextRecord(htmlText1) - assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) - - var wantText1 = new Want() - console.log('Replaces the wantText = ' + wantText1) - pasteDataRecord = pasteboard.createWantRecord(wantText1) - assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) - - var uriText1 = 'https://www.baidu.com/' - console.log('Replaces the uriText = ' + uriText1) - pasteDataRecord = pasteboard.createWantRecord(uriText1) - assert.equal(pasteData.createUriRecord(0, pasteDataRecord), true) - console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 4) + assert.equal(pasteData.getRecordCount(), 1) console.log('Checks the pasteboard content') assert.equal(pasteData.getRecordAt(0).plainText, textData1) - assert.equal(pasteData.getRecordAt(1).htmlText, htmlText1) - assert.equal(pasteData.getRecordAt(2).want, wantText1) - assert.equal(pasteData.getRecordAt(3).uri, uriText1) console.log('SUB_pasteBoard_function_JS_API_2700 end'); }) - + /** * @tc.number SUB_pasteBoard_function_JS_API_2800 - * @tc.name Set and Query Property + * @tc.name Replaces htmlText record * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1222,44 +1190,42 @@ describe('PasteBoardTest', function() { systemPasteboard.on(contentChanges) systemPasteboard.clear() - var textData = 'Hello World!' - console.log('createPlainTextData = ' + textData) - var pasteData = pasteboard.createPlainTextData(textData) + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + var htmlText0 = 'Hello World!' + console.log('addHtmlRecord = ' + htmlText0) + pasteData.addHtmlRecord(htmlText0) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) - console.log('Checks there is content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), true) - console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 1) + assert.equal(pasteData.getRecordCount(), 2) - console.log('Sets the Property') - var pasteDataProperty = pasteData.getProperty() - console.log('timestamp = ' + pasteDataProperty.timestamp) - pasteDataProperty.additions["one"] = "Hello" - pasteDataProperty.tag = "Test" + var htmlText1 = 'Hello World 1' + console.log('Replaces the htmlText = ' + htmlText1) + pasteDataRecord = pasteboard.createHtmlTextRecord(htmlText1) + assert.equal(pasteData.replaceRecordAt(1, pasteDataRecord), true) - console.log('Checks there is content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), true) + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) - console.log('Checks the Property') + console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - pasteDataProperty = pasteData.getProperty() - console.log('timestamp = ' + pasteDataProperty.timestamp) - assert.equal(pasteDataProperty.additions["one"], "Hello") - assert.equal(pasteDataProperty.tag, "Test") - assert.equal(pasteDataProperty.tag, pasteData.getTag()) - assert.equal(pasteDataProperty.mimeTypes[0], MIMETYPE_TEXT_PLAIN) + assert.equal(pasteData.getRecordCount(), 2) + + console.log('Checks the pasteboard content') + assert.equal(pasteData.getRecordAt(1).htmlText, htmlText1) console.log('SUB_pasteBoard_function_JS_API_2800 end'); }) - + /** * @tc.number SUB_pasteBoard_function_JS_API_2900 - * @tc.name systemPasteboard.off:Set two PlainText records + * @tc.name Replaces uri record * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1269,24 +1235,28 @@ describe('PasteBoardTest', function() { console.log('SUB_pasteBoard_function_JS_API_2900 start') var systemPasteboard = pasteboard.getSystemPasteboard() - systemPasteboard.off(contentChanges) + systemPasteboard.on(contentChanges) systemPasteboard.clear() - var textData = 'Hello World!' - console.log('createPlainTextData = ' + textData) - var pasteData = pasteboard.createPlainTextData(textData) + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + var uriText0 = 'https://www.baidu.com/' + console.log('addUriRecord = ' + uriText0) + pasteData.addUriRecord(uriText0) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 1) + assert.equal(pasteData.getRecordCount(), 2) - var uriText = 'https://www.baidu.com/' - console.log('Adds the uriText = ' + uriText) - var pasteDataRecord = pasteboard.createWantRecord(uriText) - pasteData.addRecord(pasteDataRecord) + var uriText1 = 'https://www.baidu.com/1' + console.log('Replaces the uriText = ' + uriText1) + pasteDataRecord = pasteboard.createUriRecord(uriText1) + assert.equal(pasteData.replaceRecordAt(1, pasteDataRecord), true) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) @@ -1295,12 +1265,15 @@ describe('PasteBoardTest', function() { pasteData = systemPasteboard.getPasteData() assert.equal(pasteData.getRecordCount(), 2) + console.log('Checks the pasteboard content') + assert.equal(pasteData.getRecordAt(1).uri, uriText1) + console.log('SUB_pasteBoard_function_JS_API_2900 end'); }) - + /** * @tc.number SUB_pasteBoard_function_JS_API_3000 - * @tc.name systemPasteboard.off:Delete one record of Muti records + * @tc.name Replaces want record * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1310,51 +1283,45 @@ describe('PasteBoardTest', function() { console.log('SUB_pasteBoard_function_JS_API_3000 start') var systemPasteboard = pasteboard.getSystemPasteboard() - systemPasteboard.off(contentChanges) + systemPasteboard.on(contentChanges) systemPasteboard.clear() - var textData = 'Hello World!' - console.log('createPlainTextData = ' + textData) - var pasteData = pasteboard.createPlainTextData(textData) - - var htmlText = 'Hello World!' - console.log('addHtmlRecord = ' + htmlText) - pasteData.addHtmlRecord(htmlText) - - var wantText = new Want() - console.log('addWantRecord = ' + wantText) - pasteData.addWantRecord(wantText) + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) - var uriText = 'https://www.baidu.com/' - console.log('addUriRecord = ' + uriText) - pasteData.addUriRecord(uriText) + var wantText0 = new Want() + console.log('addWantRecord = ' + wantText0) + pasteData.addWantRecord(wantText0) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) - console.log('Checks there is content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), true) - console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 4) + assert.equal(pasteData.getRecordCount(), 2) - console.log('Removes the third Record') - assert.equal(pasteData.removeRecordAt(2), true) + var wantText1 = new Want() + console.log('Replaces the wantText = ' + wantText1) + pasteDataRecord = pasteboard.createWantRecord(wantText1) + assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 3) + assert.equal(pasteData.getRecordCount(), 2) + + console.log('Checks the pasteboard content') + assert.deepEqual(pasteData.getRecordAt(1).want, wantText1) console.log('SUB_pasteBoard_function_JS_API_3000 end'); }) - + /** * @tc.number SUB_pasteBoard_function_JS_API_3100 - * @tc.name systemPasteboard.off:Replace Muti records + * @tc.name Replaces 300k文本 record * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1364,65 +1331,45 @@ describe('PasteBoardTest', function() { console.log('SUB_pasteBoard_function_JS_API_3100 start') var systemPasteboard = pasteboard.getSystemPasteboard() - systemPasteboard.off(contentChanges) + systemPasteboard.on(contentChanges) systemPasteboard.clear() - var textData0 = 'Hello World!' + var textData0 = '' + for (var i = 0; i < (300 * 1024); i++) + { + textData0 = textData0 + "A"; + } console.log('createPlainTextData = ' + textData0) var pasteData = pasteboard.createPlainTextData(textData0) - var htmlText0 = 'Hello World!' - console.log('addHtmlRecord = ' + htmlText0) - pasteData.addHtmlRecord(htmlText0) - - var wantText0 = new Want() - console.log('addWantRecord = ' + wantText0) - pasteData.addWantRecord(wantText0) - - var uriText0 = 'https://www.baidu.com/' - console.log('addUriRecord = ' + uriText0) - pasteData.addUriRecord(uriText0) - console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 4) + assert.equal(pasteData.getRecordCount(), 1) var textData1 = 'Hello World1' console.log('Replaces the PlainText = ' + textData1) var pasteDataRecord = pasteboard.createPlainTextRecord(textData1) assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) - var htmlText1 = 'Hello World 1' - console.log('Replaces the htmlText = ' + htmlText1) - pasteDataRecord = pasteboard.createHtmlTextRecord(htmlText1) - assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) - - var wantText1 = new Want() - console.log('Replaces the wantText = ' + wantText1) - pasteDataRecord = pasteboard.createWantRecord(wantText1) - assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) - - var uriText1 = 'https://www.baidu.com/' - console.log('Replaces the uriText = ' + uriText1) - pasteDataRecord = pasteboard.createWantRecord(uriText1) - assert.equal(pasteData.createUriRecord(0, pasteDataRecord), true) - console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 4) + assert.equal(pasteData.getRecordCount(), 1) + + console.log('Checks the pasteboard content') + assert.equal(pasteData.getRecordAt(0).plainText, textData1) console.log('SUB_pasteBoard_function_JS_API_3100 end'); }) - + /** * @tc.number SUB_pasteBoard_function_JS_API_3200 - * @tc.name systemPasteboard.clear:Set two PlainText records + * @tc.name Adds one record(s), gets record count * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1439,9 +1386,6 @@ describe('PasteBoardTest', function() { console.log('createPlainTextData = ' + textData) var pasteData = pasteboard.createPlainTextData(textData) - console.log('Checks there is no content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), false) - console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) @@ -1449,34 +1393,12 @@ describe('PasteBoardTest', function() { pasteData = systemPasteboard.getPasteData() assert.equal(pasteData.getRecordCount(), 1) - var uriText = 'https://www.baidu.com/' - console.log('Adds the uriText = ' + uriText) - var pasteDataRecord = pasteboard.createWantRecord(uriText) - pasteData.addRecord(pasteDataRecord) - - console.log('Writes PasteData to the pasteboard') - systemPasteboard.setPasteData(pasteData) - - console.log('Checks the number of records') - pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 2) - - console.log('Clears the pasteboard content') - systemPasteboard.clear() - - console.log('Checks the number of records') - pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 0) - - console.log('Checks there is no content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), false) - console.log('SUB_pasteBoard_function_JS_API_3200 end'); }) /** * @tc.number SUB_pasteBoard_function_JS_API_3300 - * @tc.name Convert the PlainTextData = 'Hello World!' to text + * @tc.name Adds 2 record(s), gets record count * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1489,30 +1411,27 @@ describe('PasteBoardTest', function() { systemPasteboard.on(contentChanges) systemPasteboard.clear() - var textData = 'Hello World!' - console.log('createPlainTextData = ' + textData) - var pasteData = pasteboard.createPlainTextData(textData) + var textData0 = 'Hello World0' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + var textData1 = 'Hello World1' + console.log('addTextRecord = ' + textData1) + pasteData.addTextRecord(textData1) + console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) - console.log('Checks there is content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), true) - console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 1) - - console.log('Converts the PlainTextData to text') - var pasteDataRecord = pasteData.getRecordAt(0) - assert.equal(pasteDataRecord.convertToText(), textData) + assert.equal(pasteData.getRecordCount(), 2) console.log('SUB_pasteBoard_function_JS_API_3300 end'); }) - - /** + + /** * @tc.number SUB_pasteBoard_function_JS_API_3400 - * @tc.name Convert the PlainTextData = 'Hello 中国!@#$%^&*()_+{}\?.' to text + * @tc.name Adds 15 record(s), gets record count * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1525,30 +1444,32 @@ describe('PasteBoardTest', function() { systemPasteboard.on(contentChanges) systemPasteboard.clear() - var textData = 'Hello 中国!@#$%^&*()_+{}\?.' - console.log('createPlainTextData = ' + textData) - var pasteData = pasteboard.createPlainTextData(textData) + var textData0 = 'Hello World0' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + var textData = '' + for(var i = 1; i < 15; i++) + { + textData = 'Hello World' + textData = textData + i + console.log('addTextRecord = ' + textData) + pasteData.addTextRecord(textData) + } + console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) - console.log('Checks there is content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), true) - console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 1) - - console.log('Converts the PlainTextData to text') - var pasteDataRecord = pasteData.getRecordAt(0) - assert.equal(pasteDataRecord.convertToText(), textData) - + assert.equal(pasteData.getRecordCount(), 15) + console.log('SUB_pasteBoard_function_JS_API_3400 end'); }) /** * @tc.number SUB_pasteBoard_function_JS_API_3500 - * @tc.name Converts the uri = 'https://www.baidu.com/' to text + * @tc.name Adds 30 record(s), gets record count * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1561,30 +1482,32 @@ describe('PasteBoardTest', function() { systemPasteboard.on(contentChanges) systemPasteboard.clear() - var uriText = 'https://www.baidu.com/' - console.log('createUriData = ' + uriText) - var pasteData = pasteboard.createUriData(uriText) + var textData0 = 'Hello World0' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + var textData = '' + for(var i = 1; i < 30; i++) + { + textData = 'Hello World' + textData = textData + i + console.log('addTextRecord = ' + textData) + pasteData.addTextRecord(textData) + } + console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) - console.log('Checks there is content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), true) - console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 1) - - console.log('Converts the uri to text') - var pasteDataRecord = pasteData.getRecordAt(0) - assert.equal(pasteDataRecord.convertToText(), uriText) - + assert.equal(pasteData.getRecordCount(), 30) + console.log('SUB_pasteBoard_function_JS_API_3500 end'); }) - - /** + + /** * @tc.number SUB_pasteBoard_function_JS_API_3600 - * @tc.name Converts the uri = 'Hello 中国!@#$%^&*()_+{}\?.' to text + * @tc.name Adds 31 record(s), gets record count * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1597,30 +1520,32 @@ describe('PasteBoardTest', function() { systemPasteboard.on(contentChanges) systemPasteboard.clear() - var uriText = 'Hello 中国!@#$%^&*()_+{}\?.' - console.log('createUriData = ' + uriText) - var pasteData = pasteboard.createUriData(uriText) + var textData0 = 'Hello World0' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + var textData = '' + for(var i = 1; i < 31; i++) + { + textData = 'Hello World' + textData = textData + i + console.log('addTextRecord = ' + textData) + pasteData.addTextRecord(textData) + } + console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) - console.log('Checks there is content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), true) - console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 1) - - console.log('Converts the uri to text') - var pasteDataRecord = pasteData.getRecordAt(0) - assert.equal(pasteDataRecord.convertToText(), uriText) - + assert.equal(pasteData.getRecordCount(), 30) + console.log('SUB_pasteBoard_function_JS_API_3600 end'); }) - + /** * @tc.number SUB_pasteBoard_function_JS_API_3700 - * @tc.name Convert the PlainTextData = 'Hello World!' to text + * @tc.name Replaces one record, gets record count * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1633,32 +1558,35 @@ describe('PasteBoardTest', function() { systemPasteboard.on(contentChanges) systemPasteboard.clear() - var textData = 'Hello World!' - console.log('createPlainTextRecord = ' + textData) - var pasteDataRecord = pasteboard.createPlainTextRecord(textData) - var pasteData = systemPasteboard.getPasteData() - pasteData.addRecord(pasteDataRecord) + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) - console.log('Writes PasteData to the pasteboard') + console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) - console.log('Checks there is content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), true) - console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() assert.equal(pasteData.getRecordCount(), 1) - console.log('Converts the PlainTextData to text') - pasteDataRecord = pasteData.getRecordAt(0) - assert.equal(pasteDataRecord.convertToText(), textData) + var textData1 = 'Hello World1' + console.log('Replaces the PlainText = ' + textData1) + var pasteDataRecord = pasteboard.createPlainTextRecord(textData1) + assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 1) console.log('SUB_pasteBoard_function_JS_API_3700 end'); }) - + /** * @tc.number SUB_pasteBoard_function_JS_API_3800 - * @tc.name Converts the uri = 'https://www.baidu.com/' to text + * @tc.name Clears pasteBoard, gets record count * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1671,32 +1599,30 @@ describe('PasteBoardTest', function() { systemPasteboard.on(contentChanges) systemPasteboard.clear() - var uriText = 'https://www.baidu.com/' - console.log('createUriRecord = ' + uriText) - var pasteDataRecord = pasteboard.createUriRecord(uriText) - var pasteData = systemPasteboard.getPasteData() - pasteData.addRecord(pasteDataRecord) + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) - console.log('Checks there is content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), true) - console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() assert.equal(pasteData.getRecordCount(), 1) - console.log('Converts the uri to text') - pasteDataRecord = pasteData.getRecordAt(0) - assert.equal(pasteDataRecord.convertToText(), uriText) + console.log('Clears the pasteboard') + systemPasteboard.clear() + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) console.log('SUB_pasteBoard_function_JS_API_3800 end'); }) - + /** * @tc.number SUB_pasteBoard_function_JS_API_3900 - * @tc.name Converts the text,uri from Muti records + * @tc.name Adds Property * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1713,18 +1639,6 @@ describe('PasteBoardTest', function() { console.log('createPlainTextData = ' + textData) var pasteData = pasteboard.createPlainTextData(textData) - var htmlText = 'Hello World!' - console.log('addHtmlRecord = ' + htmlText) - pasteData.addHtmlRecord(htmlText) - - var wantText = new Want() - console.log('addWantRecord = ' + wantText) - pasteData.addWantRecord(wantText) - - var uriText = 'https://www.baidu.com/' - console.log('addUriRecord = ' + uriText) - pasteData.addUriRecord(uriText) - console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) @@ -1733,22 +1647,29 @@ describe('PasteBoardTest', function() { console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 4) + assert.equal(pasteData.getRecordCount(), 1) - console.log('Converts the PlainTextData to text') - pasteDataRecord = pasteData.getRecordAt(0) - assert.equal(pasteDataRecord.convertToText(), textData) + console.log('Sets the Property') + var pasteDataProperty = pasteData.getProperty() + console.log('timestamp = ' + pasteDataProperty.timestamp) + pasteDataProperty.additions["one"] = "Hello" - console.log('Converts the uri to text') - pasteDataRecord = pasteData.getRecordAt(3) - assert.equal(pasteDataRecord.convertToText(), uriText) + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + + console.log('Checks the Property') + pasteData = systemPasteboard.getPasteData() + pasteDataProperty = pasteData.getProperty() + console.log('timestamp = ' + pasteDataProperty.timestamp) + assert.equal(pasteDataProperty.additions["one"], "Hello") + assert.equal(pasteDataProperty.mimeTypes[0], MIMETYPE_TEXT_PLAIN) console.log('SUB_pasteBoard_function_JS_API_3900 end'); }) - + /** * @tc.number SUB_pasteBoard_function_JS_API_4000 - * @tc.name Delete one and then add another PlainTextData + * @tc.name Set Property's tags * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1762,8 +1683,8 @@ describe('PasteBoardTest', function() { systemPasteboard.clear() var textData = 'Hello World!' - console.log('createUriData = ' + textData) - var pasteData = pasteboard.createUriData(textData) + console.log('createPlainTextData = ' + textData) + var pasteData = pasteboard.createPlainTextData(textData) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) @@ -1775,42 +1696,28 @@ describe('PasteBoardTest', function() { pasteData = systemPasteboard.getPasteData() assert.equal(pasteData.getRecordCount(), 1) - console.log('Removes the Record') - assert.equal(pasteData.removeRecordAt(0), true) - - console.log('Writes PasteData to the pasteboard') - systemPasteboard.setPasteData(pasteData) - - console.log('Checks the number of records') - pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 0) - - console.log('Checks there is no content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), false) - - var textDataNew = 'Hello World!-New' - console.log('createUriData = ' + textDataNew) - var pasteData = pasteboard.createUriData(textDataNew) - - console.log('Writes PasteData to the pasteboard') - systemPasteboard.setPasteData(pasteData) + console.log('Sets the Property') + var pasteDataProperty = pasteData.getProperty() + console.log('timestamp = ' + pasteDataProperty.timestamp) + pasteDataProperty.tag = "Test" console.log('Checks there is content in the pasteboard') assert.equal(systemPasteboard.hasPasteData(), true) - console.log('Checks the number of records') + console.log('Checks the Property') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 1) - - console.log('Checks the pasteboard content') - assert.equal(pasteData.getRecordAt(0).plainText, textDataNew) + pasteDataProperty = pasteData.getProperty() + console.log('timestamp = ' + pasteDataProperty.timestamp) + assert.equal(pasteDataProperty.tag, "Test") + assert.equal(pasteDataProperty.tag, pasteData.getTag()) + assert.equal(pasteDataProperty.mimeTypes[0], MIMETYPE_TEXT_PLAIN) console.log('SUB_pasteBoard_function_JS_API_4000 end'); }) - + /** * @tc.number SUB_pasteBoard_function_JS_API_4100 - * @tc.name Delete the replaced record + * @tc.name Clears pasteBoard and check property * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1823,46 +1730,36 @@ describe('PasteBoardTest', function() { systemPasteboard.on(contentChanges) systemPasteboard.clear() - var textData0 = 'Hello World0' - console.log('createUriData = ' + textData0) - var pasteData = pasteboard.createUriData(textData0) - - console.log('Writes PasteData to the pasteboard') - systemPasteboard.setPasteData(pasteData) - - var textData1 = 'Hello World1' - console.log('Replaces the Record = ' + textData1) - var pasteDataRecord = pasteboard.createPlainTextRecord(textData1) - pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) + var textData = 'Hello World!' + console.log('createPlainTextData = ' + textData) + var pasteData = pasteboard.createPlainTextData(textData) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() assert.equal(pasteData.getRecordCount(), 1) + + console.log('Clears the pasteBoard') + systemPasteboard.clear() - console.log('Checks the pasteboard content') - pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordAt(0).plainText, textData1) - - console.log('Removes the the replaced record') - assert.equal(pasteData.removeRecordAt(0), true) - - console.log('Writes PasteData to the pasteboard') - systemPasteboard.setPasteData(pasteData) - - console.log('Checks the number of records') + console.log('Checks the Property') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 0) + pasteDataProperty = pasteData.getProperty() + console.log('timestamp = ' + pasteDataProperty.timestamp) + assert.equal(pasteDataProperty.tag, "") + assert.equal(pasteDataProperty.mimeTypes.length, 0) console.log('SUB_pasteBoard_function_JS_API_4100 end'); }) /** * @tc.number SUB_pasteBoard_function_JS_API_4200 - * @tc.name Delete one and then add another PlainTextData and then clear + * @tc.name 打开内容变化通知功能:向剪贴板数据增加、更新、删除文本数据项 * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1872,55 +1769,42 @@ describe('PasteBoardTest', function() { console.log('SUB_pasteBoard_function_JS_API_4200 start') var systemPasteboard = pasteboard.getSystemPasteboard() - systemPasteboard.on(contentChanges) systemPasteboard.clear() + + console.log('Open the infor for pasteboard content changes') + systemPasteboard.on(contentChanges) - var textData = 'Hello World!' - console.log('createUriData = ' + textData) - var pasteData = pasteboard.createUriData(textData) + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) - console.log('Checks there is content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), true) - console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() assert.equal(pasteData.getRecordCount(), 1) - console.log('Removes the Record') - assert.equal(pasteData.removeRecordAt(0), true) - - console.log('Writes PasteData to the pasteboard') - systemPasteboard.setPasteData(pasteData) - - console.log('Checks the number of records') - pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 0) - - console.log('Checks there is no content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), false) - - var textDataNew = 'Hello World!-New' - console.log('createUriData = ' + textDataNew) - var pasteData = pasteboard.createUriData(textDataNew) + var textData1 = 'Hello World1' + console.log('Replaces the PlainText = ' + textData1) + var pasteDataRecord = pasteboard.createPlainTextRecord(textData1) + assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) - console.log('Checks there is content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), true) - console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() assert.equal(pasteData.getRecordCount(), 1) console.log('Checks the pasteboard content') - assert.equal(pasteData.getRecordAt(0).plainText, textDataNew) + assert.equal(pasteData.getRecordAt(0).plainText, textData1) + + console.log('Removes the Record') + assert.equal(pasteData.removeRecordAt(0), true) - console.log('Clears the pasteboard content') - systemPasteboard.clear() + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() @@ -1931,10 +1815,10 @@ describe('PasteBoardTest', function() { console.log('SUB_pasteBoard_function_JS_API_4200 end'); }) - - /** + + /** * @tc.number SUB_pasteBoard_function_JS_API_4300 - * @tc.name First off the changes Event and then make it on + * @tc.name 打开内容变化通知功能:向剪贴板数据增加、更新、删除html数据项 * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -1943,44 +1827,968 @@ describe('PasteBoardTest', function() { it('pasteboard_function_test43',0, async () => { console.log('SUB_pasteBoard_function_JS_API_4300 start') - console.log('Off the content changes') var systemPasteboard = pasteboard.getSystemPasteboard() - systemPasteboard.off(contentChanges) systemPasteboard.clear() + + console.log('Open the infor for pasteboard content changes') + systemPasteboard.on(contentChanges) - var textData = 'Hello World!' - console.log('createUriData = ' + textData) - var pasteData = pasteboard.createUriData(textData) + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + var htmlText0 = 'Hello World!' + console.log('addHtmlRecord = ' + htmlText0) + pasteData.addHtmlRecord(htmlText0) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) - console.log('Checks there is content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), true) - console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 1) - - console.log('On the content changes') - systemPasteboard.on(contentChanges) + assert.equal(pasteData.getRecordCount(), 2) - console.log('Removes the Record') - assert.equal(pasteData.removeRecordAt(0), true) + var htmlText1 = 'Hello World 1' + console.log('Replaces the htmlText = ' + htmlText1) + pasteDataRecord = pasteboard.createHtmlTextRecord(htmlText1) + assert.equal(pasteData.replaceRecordAt(1, pasteDataRecord), true) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 0) + assert.equal(pasteData.getRecordCount(), 2) + + console.log('Checks the pasteboard content') + assert.equal(pasteData.getRecordAt(1).htmlText, htmlText1) + + console.log('Removes the Record') + assert.equal(pasteData.removeRecordAt(0), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('SUB_pasteBoard_function_JS_API_4300 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_4400 + * @tc.name 打开内容变化通知功能:向剪贴板数据增加、更新、删除uri数据项 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test44',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_4400 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.clear() + + console.log('Open the infor for pasteboard content changes') + systemPasteboard.on(contentChanges) + + + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + var uriText0 = 'https://www.baidu.com/' + console.log('addUriRecord = ' + uriText0) + pasteData.addUriRecord(uriText0) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 2) + + var uriText1 = 'https://www.baidu.com/1' + console.log('Replaces the uriText = ' + uriText1) + pasteDataRecord = pasteboard.createUriRecord(uriText1) + assert.equal(pasteData.replaceRecordAt(1, pasteDataRecord), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 2) + + console.log('Checks the pasteboard content') + assert.equal(pasteData.getRecordAt(1).uri, uriText1) + + console.log('Removes the Record') + assert.equal(pasteData.removeRecordAt(0), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('SUB_pasteBoard_function_JS_API_4400 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_4500 + * @tc.name 打开内容变化通知功能:向剪贴板数据增加、更新、删除want数据项 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test45',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_4500 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.clear() + + console.log('Open the infor for pasteboard content changes') + systemPasteboard.on(contentChanges) + + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + var wantText0 = new Want() + console.log('addWantRecord = ' + wantText0) + pasteData.addWantRecord(wantText0) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 2) + + var wantText1 = new Want() + console.log('Replaces the wantText = ' + wantText1) + pasteDataRecord = pasteboard.createWantRecord(wantText1) + assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 2) + + console.log('Checks the pasteboard content') + assert.deepEqual(pasteData.getRecordAt(1).want, wantText1) + + console.log('Removes the Record') + assert.equal(pasteData.removeRecordAt(0), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('SUB_pasteBoard_function_JS_API_4500 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_4600 + * @tc.name 打开内容变化通知功能:清除剪切板内容 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test46',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_4600 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.clear() + + console.log('Open the infor for pasteboard content changes') + systemPasteboard.on(contentChanges) + + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 1) + + var textData1 = 'Hello World1' + console.log('Replaces the PlainText = ' + textData1) + var pasteDataRecord = pasteboard.createPlainTextRecord(textData1) + assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 1) + + console.log('Checks the pasteboard content') + assert.equal(pasteData.getRecordAt(0).plainText, textData1) + + console.log('Removes the Record') + assert.equal(pasteData.removeRecordAt(0), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('Clears the pasteBoard') + systemPasteboard.clear() + + console.log('SUB_pasteBoard_function_JS_API_4600 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_4700 + * @tc.name 关闭内容变化通知功能:向剪贴板数据增加、更新、删除文本数据项 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test47',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_4700 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.clear() + + console.log('Closes the infor for pasteboard content changes') + systemPasteboard.off(contentChanges) + + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 1) + + var textData1 = 'Hello World1' + console.log('Replaces the PlainText = ' + textData1) + var pasteDataRecord = pasteboard.createPlainTextRecord(textData1) + assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 1) + + console.log('Checks the pasteboard content') + assert.equal(pasteData.getRecordAt(0).plainText, textData1) + + console.log('Removes the Record') + assert.equal(pasteData.removeRecordAt(0), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('SUB_pasteBoard_function_JS_API_4700 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_4800 + * @tc.name 关闭内容变化通知功能:向剪贴板数据增加、更新、删除html数据项 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test48',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_4800 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.clear() + + console.log('Closes the infor for pasteboard content changes') + systemPasteboard.off(contentChanges) + + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + var htmlText0 = 'Hello World!' + console.log('addHtmlRecord = ' + htmlText0) + pasteData.addHtmlRecord(htmlText0) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 2) + + var htmlText1 = 'Hello World 1' + console.log('Replaces the htmlText = ' + htmlText1) + pasteDataRecord = pasteboard.createHtmlTextRecord(htmlText1) + assert.equal(pasteData.replaceRecordAt(1, pasteDataRecord), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 2) + + console.log('Checks the pasteboard content') + assert.equal(pasteData.getRecordAt(1).htmlText, htmlText1) + + console.log('Removes the Record') + assert.equal(pasteData.removeRecordAt(0), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('SUB_pasteBoard_function_JS_API_4800 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_4900 + * @tc.name 关闭内容变化通知功能:向剪贴板数据增加、更新、删除uri数据项 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test49',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_4900 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.clear() + + console.log('Closes the infor for pasteboard content changes') + systemPasteboard.off(contentChanges) + + + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + var uriText0 = 'https://www.baidu.com/' + console.log('addUriRecord = ' + uriText0) + pasteData.addUriRecord(uriText0) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 2) + + var uriText1 = 'https://www.baidu.com/1' + console.log('Replaces the uriText = ' + uriText1) + pasteDataRecord = pasteboard.createUriRecord(uriText1) + assert.equal(pasteData.replaceRecordAt(1, pasteDataRecord), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 2) + + console.log('Checks the pasteboard content') + assert.equal(pasteData.getRecordAt(1).uri, uriText1) + + console.log('Removes the Record') + assert.equal(pasteData.removeRecordAt(0), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('SUB_pasteBoard_function_JS_API_4900 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_5000 + * @tc.name 关闭内容变化通知功能:向剪贴板数据增加、更新、删除want数据项 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test50',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_5000 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.clear() + + console.log('Closes the infor for pasteboard content changes') + systemPasteboard.off(contentChanges) + + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + var wantText0 = new Want() + console.log('addWantRecord = ' + wantText0) + pasteData.addWantRecord(wantText0) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 2) + + var wantText1 = new Want() + console.log('Replaces the wantText = ' + wantText1) + pasteDataRecord = pasteboard.createWantRecord(wantText1) + assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 2) + + console.log('Checks the pasteboard content') + assert.deepEqual(pasteData.getRecordAt(1).want, wantText1) + + console.log('Removes the Record') + assert.equal(pasteData.removeRecordAt(0), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('SUB_pasteBoard_function_JS_API_5000 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_5100 + * @tc.name 关闭内容变化通知功能:清除剪切板内容 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test51',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_5100 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.clear() + + console.log('Closes the infor for pasteboard content changes') + systemPasteboard.off(contentChanges) + + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 1) + + var textData1 = 'Hello World1' + console.log('Replaces the PlainText = ' + textData1) + var pasteDataRecord = pasteboard.createPlainTextRecord(textData1) + assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 1) + + console.log('Checks the pasteboard content') + assert.equal(pasteData.getRecordAt(0).plainText, textData1) + + console.log('Removes the Record') + assert.equal(pasteData.removeRecordAt(0), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('Clears the pasteBoard') + systemPasteboard.clear() + + console.log('SUB_pasteBoard_function_JS_API_5100 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_5200 + * @tc.name 清除剪切板内的文本数据项 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test52',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_5200 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.clear() + + var textData = 'Hello World!' + console.log('createPlainTextData = ' + textData) + var pasteData = pasteboard.createPlainTextData(textData) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 1) + + console.log('Checks the pasteboard content') + assert.equal(pasteData.getPrimaryText(), textData) + + console.log('Clears the pasteBoard') + systemPasteboard.clear() + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('SUB_pasteBoard_function_JS_API_5200 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_5300 + * @tc.name 清除剪切板内的uri数据项 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test53',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_5300 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) + systemPasteboard.clear() + + var uriText = 'https://www.baidu.com/' + console.log('createUriData = ' + uriText) + var pasteData = pasteboard.createUriData(uriText) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 1) + + console.log('Checks the pasteboard content') + assert.equal(pasteData.getPrimaryUri(), uriText) + + console.log('Clears the pasteBoard') + systemPasteboard.clear() + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('SUB_pasteBoard_function_JS_API_5300 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_5400 + * @tc.name 清除剪切板内的html数据项 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test54',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_5400 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) + systemPasteboard.clear() + + var htmlText = 'Hello World!' + console.log('createHtmlData = ' + htmlText) + var pasteData = pasteboard.createHtmlData(htmlText) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 1) + + console.log('Checks the pasteboard content') + assert.equal(pasteData.getPrimaryHtml(), htmlText) + + console.log('Clears the pasteBoard') + systemPasteboard.clear() + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('SUB_pasteBoard_function_JS_API_5400 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_5500 + * @tc.name 清除剪切板内的want数据项 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test55',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_5500 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) + systemPasteboard.clear() + + var want = new Want() + console.log('createWantData = ' + want) + var pasteData = pasteboard.createWantData(want) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 1) + + console.log('Checks the pasteboard content') + assert.equal(pasteData.getPrimaryWant(), want) + + console.log('Clears the pasteBoard') + systemPasteboard.clear() + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('SUB_pasteBoard_function_JS_API_5500 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_5600 + * @tc.name 向剪切板内增加30条数据项,然后清除 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test56',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_5600 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) + systemPasteboard.clear() + + var textData0 = 'Hello World0' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + var textData = '' + for(var i = 1; i < 30; i++) + { + textData = 'Hello World' + textData = textData + i + console.log('addTextRecord = ' + textData) + pasteData.addTextRecord(textData) + } + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 30) + + console.log('Checks the pasteboard content') + for(var i = 0; i < 30; i++) + { + textData = 'Hello World' + textData = textData + i + assert.equal(pasteData.getRecordAt(i).plainText, textData) + } + + console.log('Clears the pasteBoard') + systemPasteboard.clear() + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('SUB_pasteBoard_function_JS_API_5600 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_5700 + * @tc.name 向剪贴板数据各增加5条文本、uri、html、want数据,然后清除 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test57',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_5700 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) + systemPasteboard.clear() + + var textData0 = 'Hello World0' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + var textData = '' + for(var i = 1; i < 5; i++) + { + textData = 'Hello World' + textData = textData + i + console.log('addTextRecord = ' + textData) + pasteData.addTextRecord(textData) + } + + var htmlText = '' + for(var i = 0; i < 5; i++) + { + htmlText = 'Hello World!' + htmlText = htmlText + i + console.log('addHtmlRecord = ' + htmlText) + pasteData.addHtmlRecord(htmlText) + } + + var uriText = '' + for(var i = 0; i < 5; i++) + { + uriText = 'https://www.baidu.com/' + uriText = uriText + i + console.log('addUriRecord = ' + uriText) + pasteData.addUriRecord(uriText) + } + + var wantText = new Want() + for(var i = 0; i < 5; i++) + { + wantText = new Want() + console.log('addWantRecord = ' + wantText) + pasteData.addWantRecord(wantText) + } + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 20) + + console.log('Clears the pasteBoard') + systemPasteboard.clear() + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 0) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('SUB_pasteBoard_function_JS_API_5700 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_5800 + * @tc.name 向剪贴板数据增加文本数据项,查询剪贴板存在剪贴板数据 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test58',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_5800 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.clear() + + var textData = 'Hello World!' + console.log('createPlainTextData = ' + textData) + var pasteData = pasteboard.createPlainTextData(textData) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + + console.log('SUB_pasteBoard_function_JS_API_5800 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_5900 + * @tc.name 向剪贴板数据增加uri数据项,查询剪贴板存在剪贴板数据 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test59',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_5900 start') - console.log('Checks there is no content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), false) + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) + systemPasteboard.clear() + + var uriText = 'https://www.baidu.com/' + console.log('createUriData = ' + uriText) + var pasteData = pasteboard.createUriData(uriText) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + + console.log('SUB_pasteBoard_function_JS_API_5900 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_6000 + * @tc.name 向剪贴板数据增加html数据项,查询剪贴板存在剪贴板数据 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test60',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_6000 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) + systemPasteboard.clear() - var textDataNew = 'Hello World!-New' - console.log('createUriData = ' + textDataNew) - var pasteData = pasteboard.createUriData(textDataNew) + var htmlText = 'Hello World!' + console.log('createHtmlData = ' + htmlText) + var pasteData = pasteboard.createHtmlData(htmlText) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + + console.log('SUB_pasteBoard_function_JS_API_6000 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_6100 + * @tc.name 向剪贴板数据增加want数据项,查询剪贴板存在剪贴板数据 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test61',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_6100 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) + systemPasteboard.clear() + + var want = new Want() + console.log('createWantData = ' + want) + var pasteData = pasteboard.createWantData(want) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) @@ -1988,34 +2796,128 @@ describe('PasteBoardTest', function() { console.log('Checks there is content in the pasteboard') assert.equal(systemPasteboard.hasPasteData(), true) + console.log('SUB_pasteBoard_function_JS_API_6100 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_6200 + * @tc.name 向剪贴板数据各增加5条文本、uri、html、want数据,查询剪贴板存在剪贴板数据 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test62',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_6200 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) + systemPasteboard.clear() + + var textData0 = 'Hello World0' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + var textData = '' + for(var i = 1; i < 5; i++) + { + textData = 'Hello World' + textData = textData + i + console.log('addTextRecord = ' + textData) + pasteData.addTextRecord(textData) + } + + var htmlText = '' + for(var i = 0; i < 5; i++) + { + htmlText = 'Hello World!' + htmlText = htmlText + i + console.log('addHtmlRecord = ' + htmlText) + pasteData.addHtmlRecord(htmlText) + } + + var uriText = '' + for(var i = 0; i < 5; i++) + { + uriText = 'https://www.baidu.com/' + uriText = uriText + i + console.log('addUriRecord = ' + uriText) + pasteData.addUriRecord(uriText) + } + + var wantText = new Want() + for(var i = 0; i < 5; i++) + { + wantText = new Want() + console.log('addWantRecord = ' + wantText) + pasteData.addWantRecord(wantText) + } + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + + console.log('SUB_pasteBoard_function_JS_API_6200 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_6300 + * @tc.name 更新剪贴板数据,查询剪贴板存在剪贴板数据 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test63',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_6300 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) + systemPasteboard.clear() + + var textData0 = 'Hello World!' + console.log('createPlainTextData = ' + textData0) + var pasteData = pasteboard.createPlainTextData(textData0) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() assert.equal(pasteData.getRecordCount(), 1) - console.log('Checks the pasteboard content') - assert.equal(pasteData.getRecordAt(0).plainText, textDataNew) + var textData1 = 'Hello World1' + console.log('Replaces the PlainText = ' + textData1) + var pasteDataRecord = pasteboard.createPlainTextRecord(textData1) + assert.equal(pasteData.replaceRecordAt(0, pasteDataRecord), true) - console.log('SUB_pasteBoard_function_JS_API_4300 end'); + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + + console.log('SUB_pasteBoard_function_JS_API_6300 end'); }) - - /** - * @tc.number SUB_pasteBoard_function_JS_API_4400 - * @tc.name Clears 300K PlainTextData + + /** + * @tc.number SUB_pasteBoard_function_JS_API_6400 + * @tc.name 删除所有的剪贴板数据,查询剪贴板不存在剪贴板数据 * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('pasteboard_function_test44',0, async () => { - console.log('SUB_pasteBoard_function_JS_API_4400 start') + it('pasteboard_function_test64',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_6400 start') var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) systemPasteboard.clear() - var textData = '' - for (var i = 0; i < (300 * 1024); i++){ - textData=textData + "A"; - } + var textData = 'Hello World!' console.log('createPlainTextData = ' + textData) var pasteData = pasteboard.createPlainTextData(textData) @@ -2029,65 +2931,210 @@ describe('PasteBoardTest', function() { pasteData = systemPasteboard.getPasteData() assert.equal(pasteData.getRecordCount(), 1) - console.log('Clears the pasteboard content') + console.log('Removes the Record') + assert.equal(pasteData.removeRecordAt(0), true) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks there is no content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), false) + + console.log('SUB_pasteBoard_function_JS_API_6400 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_6500 + * @tc.name 清除剪贴板数据,查询剪贴板不存在剪贴板数据 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test65',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_6500 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) systemPasteboard.clear() + var textData = 'Hello World!' + console.log('createPlainTextData = ' + textData) + var pasteData = pasteboard.createPlainTextData(textData) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 1) + + console.log('Clears the pasteBoard') + systemPasteboard.clear() + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() assert.equal(pasteData.getRecordCount(), 0) - console.log('Checks there is no content in the pasteboard') + console.log('Checks there is no content in the pasteboard') assert.equal(systemPasteboard.hasPasteData(), false) - console.log('SUB_pasteBoard_function_JS_API_4400 end'); + console.log('SUB_pasteBoard_function_JS_API_6500 end'); }) /** - * @tc.number SUB_pasteBoard_function_JS_API_4500 - * @tc.name Deletes 30 record(s) + * @tc.number SUB_pasteBoard_function_JS_API_6600 + * @tc.name 将文本数据强制转换为文本 * @tc.desc Test pasteBoard API functionality. * @tc.size : MEDIUM * @tc.type : Function * @tc.level : Level 0 */ - it('pasteboard_function_test45',0, async () => { - console.log('SUB_pasteBoard_function_JS_API_4500 start') + it('pasteboard_function_test66',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_6600 start') var systemPasteboard = pasteboard.getSystemPasteboard() systemPasteboard.on(contentChanges) systemPasteboard.clear() - var textData0 = 'Hello World0' - console.log('createPlainTextData = ' + textData0) - var pasteData = pasteboard.createPlainTextData(textData0) + var textData = 'Hello World!' + console.log('createPlainTextData = ' + textData) + var pasteData = pasteboard.createPlainTextData(textData) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 1) + + console.log('Converts the PlainTextData to text') + var pasteDataRecord = pasteData.getRecordAt(0) + assert.equal(pasteDataRecord.convertToText(), textData) + + console.log('SUB_pasteBoard_function_JS_API_6600 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_6700 + * @tc.name 将一条含有特殊字符、中英混杂的文本数据强制转换为文本 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test67',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_6700 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) + systemPasteboard.clear() + + var textData = 'Hello 中国!@#$%^&*()_+{}\?.' + console.log('createPlainTextData = ' + textData) + var pasteData = pasteboard.createPlainTextData(textData) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + + console.log('Checks the number of records') + pasteData = systemPasteboard.getPasteData() + assert.equal(pasteData.getRecordCount(), 1) + + console.log('Converts the PlainTextData to text') + var pasteDataRecord = pasteData.getRecordAt(0) + assert.equal(pasteDataRecord.convertToText(), textData) + + console.log('SUB_pasteBoard_function_JS_API_6700 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_6800 + * @tc.name 将一条超长文本数据 (大小为301K)强制转换为文本 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test68',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_6800 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) + systemPasteboard.clear() var textData = '' - for(var i = 1; i < 30; i++) - { - textData = 'Hello World' - textData = textData + i - console.log('addTextRecord = ' + textData) - pasteData.addTextRecord(textData) - } + var textData300 = '' + for (var i = 0; i < (301 * 1024); i++){ + textData = textData + "A"; + if(299 == i ) + { + textData300 = textData + } + } + console.log('createPlainTextData = ' + textData) + var pasteData = pasteboard.createPlainTextData(textData) console.log('Writes PasteData to the pasteboard') systemPasteboard.setPasteData(pasteData) + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 30) + assert.equal(pasteData.getRecordCount(), 1) - console.log('Clears the pasteboard content') + console.log('Converts the PlainTextData to text') + var pasteDataRecord = pasteData.getRecordAt(0) + assert.equal(pasteDataRecord.convertToText(), textData300) + + console.log('SUB_pasteBoard_function_JS_API_6800 end'); + }) + + /** + * @tc.number SUB_pasteBoard_function_JS_API_6900 + * @tc.name 将uri数据强制转换为文本 + * @tc.desc Test pasteBoard API functionality. + * @tc.size : MEDIUM + * @tc.type : Function + * @tc.level : Level 0 + */ + it('pasteboard_function_test69',0, async () => { + console.log('SUB_pasteBoard_function_JS_API_6900 start') + + var systemPasteboard = pasteboard.getSystemPasteboard() + systemPasteboard.on(contentChanges) systemPasteboard.clear() + var uriText = 'https://www.baidu.com/' + console.log('createUriData = ' + uriText) + var pasteData = pasteboard.createUriData(uriText) + + console.log('Writes PasteData to the pasteboard') + systemPasteboard.setPasteData(pasteData) + + console.log('Checks there is content in the pasteboard') + assert.equal(systemPasteboard.hasPasteData(), true) + console.log('Checks the number of records') pasteData = systemPasteboard.getPasteData() - assert.equal(pasteData.getRecordCount(), 0) + assert.equal(pasteData.getRecordCount(), 1) - console.log('Checks there is no content in the pasteboard') - assert.equal(systemPasteboard.hasPasteData(), false) + console.log('Converts the uri to text') + var pasteDataRecord = pasteData.getRecordAt(0) + assert.equal(pasteDataRecord.convertToText(), uriText) - console.log('SUB_pasteBoard_function_JS_API_4500 end'); + console.log('SUB_pasteBoard_function_JS_API_6900 end'); }) /** diff --git a/miscservices/RequestTest_js/signature/openharmony_sx.p7b b/miscservices/RequestTest_js/signature/openharmony_sx.p7b index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..66b4457a8a81fb8d3356cf46d67226c850944858 100644 GIT binary patch delta 988 zcmZ9L&2QUu9LDQ3ZE4qTNQ_A#Ic>& zsohklC_)unCaN%LC)NW3X&N9v z{JMO9`2dWUoZ0#34%x%smyo&G@p$QSgz7N_L6^X(+4;+dETT`xV+a_}ocT{gj>j`o z@p1gG{lu<5@Y;^Ora4VL@jSYE0&KMxfdrZaNsw4g42SJz^x^>9Y-F?g8s3V|(T($G z{5|(yZ=hSc>gkE2&c&nK=P%&dbY=s`@XTt$cKkK9~r9waIB@<&@~^ zHmeSLj=eW|0eR`1Fd|9V&)O(9>m<#obpbWKz1p}P&c8!|Gi5=Nm+ zKu@OWY*4GK>UMMP~9j0#cfza|;vsB6gI%9D_t|~RV&@%+ob9RRfUFt)5;!dAk zFbKI}4zzaNo?MyE9OR0AI2f8%-PX1V$>W=WR_o`7S*K7c8>#>Uh9vvUj*!k0P@o72 zQYwT&P2xhx`zk0(n46}!VaoODc3x=aNy?D$5{p`ZNEaECumq#o#zw7--OYNgI-(^m z1*(O>ZTT4qa%8~n3?Ww0t#Ui%)a?tDa}#ZxcS_=7)>eq1@$e|YPi zTfI-OPCfC{Z;$^HDeqQ4!M}+eeEm_7{`}1ZRwPNG(;tKX)y;R+NO5CnoJtweQnovT03zP=fldOw&TQ!9XoaG zI5tC-a;T6%NL4Oq2R05voM2*HkdV;0Ax$7n)8K}XKyZOc?64COZqbT3zQ6zTd-NWj z|C7sqTs}f)iT={c>&Nu*(?n!BdTW*tLsXAOBG?OPVrk{zn2x9mv1nxR0y^i4{kOQm;GnH?;@iI|qNC3PLu4y{}^o64afetQ#f{L$%tTQyW^tRnMxWIbVN z*0`fiRKpsn_IxLDZM8(;IFM64;4u*N7_wF=i$XAeFY@sbHz2XL$r4P!)r53IQ#dvt zy^sdyYye%BAA308BI-O(kzSFg4ah1B0R=FD#35U3n_{}I$-|B=r?MtnAw9x7o2E%m z3nZ%Uszc3?2PDse%)ge#(p8~ywA-OVu}1RYC!R&qv*=kOu#h=Zz?9vW)6kHInx+h~ ziEQd#qXufQryOefpwu?YJOg2`clIjtEQB7115g2bf$G*UlH|!r&ZD$c*Ofgw@C!{> zbUeN0Hkkq4M78X+ZK|BwlNBC^9l`Fj2yEKIn<5Sa($-shX5Qi%#^gF~YTplbEsXI5 z0(4=ItJ77MqzKSxn>|>QHCyS=XAAkGwz-Q3g=v=#nyBG7b(*VSYAGXjt?dnY!~&1P z@k6T0W(p9n1mpoBdcYF_y3maApPpA02-Y89(s0CCi@IjU{CB^q!U%jlzxs?<7!Wt#473tCqp@*8?Z zA$(3S_MB4Pw9~Y{A2jpDLMJ=6l|nGSI=>!Ey`)a1;mA;vLqEJ&qpwJ($9nfsOkBQ* zqqE4hupFp9mloCe&G_>3|1Zh>^LX+ILvvUbO{Mecyohd}cV;DqA+dGu;i~cpcCYm~ z`o-;ygDY#z8`p)OKYb|wb@I(;Kjhze7rnUjT-e9&uErLkF$yK4>voBFHNN)ew@!LE zdGn^t;gj#hzl$HrhsB>BzaM|?jp!>EzRW1zqXqWI8%W~P+KYFrUw`}P;NC&`_6K+F MkH7x?LGzb?0ItqZ1poj5 diff --git a/miscservices/TimeTest_js/signature/openharmony_sx.p7b b/miscservices/TimeTest_js/signature/openharmony_sx.p7b index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..66b4457a8a81fb8d3356cf46d67226c850944858 100755 GIT binary patch delta 988 zcmZ9L&2QUu9LDQ3ZE4qTNQ_A#Ic>& zsohklC_)unCaN%LC)NW3X&N9v z{JMO9`2dWUoZ0#34%x%smyo&G@p$QSgz7N_L6^X(+4;+dETT`xV+a_}ocT{gj>j`o z@p1gG{lu<5@Y;^Ora4VL@jSYE0&KMxfdrZaNsw4g42SJz^x^>9Y-F?g8s3V|(T($G z{5|(yZ=hSc>gkE2&c&nK=P%&dbY=s`@XTt$cKkK9~r9waIB@<&@~^ zHmeSLj=eW|0eR`1Fd|9V&)O(9>m<#obpbWKz1p}P&c8!|Gi5=Nm+ zKu@OWY*4GK>UMMP~9j0#cfza|;vsB6gI%9D_t|~RV&@%+ob9RRfUFt)5;!dAk zFbKI}4zzaNo?MyE9OR0AI2f8%-PX1V$>W=WR_o`7S*K7c8>#>Uh9vvUj*!k0P@o72 zQYwT&P2xhx`zk0(n46}!VaoODc3x=aNy?D$5{p`ZNEaECumq#o#zw7--OYNgI-(^m z1*(O>ZTT4qa%8~n3?Ww0t#Ui%)a?tDa}#ZxcS_=7)>eq1@$e|YPi zTfI-OPCfC{Z;$^HDeqQ4!M}+eeEm_7{`}1ZRwPNG(;tKX)y;R+NO5CnoJtweQnovT03zP=fldOw&TQ!9XoaG zI5tC-a;T6%NL4Oq2R05voM2*HkdV;0Ax$7n)8K}XKyZOc?64COZqbT3zQ6zTd-NWj z|C7sqTs}f)iT={c>&Nu*(?n!BdTW*tLsXAOBG?OPVrk{zn2x9mv1nxR0y^i4{kOQm;GnH?;@iI|qNC3PLu4y{}^o64afetQ#f{L$%tTQyW^tRnMxWIbVN z*0`fiRKpsn_IxLDZM8(;IFM64;4u*N7_wF=i$XAeFY@sbHz2XL$r4P!)r53IQ#dvt zy^sdyYye%BAA308BI-O(kzSFg4ah1B0R=FD#35U3n_{}I$-|B=r?MtnAw9x7o2E%m z3nZ%Uszc3?2PDse%)ge#(p8~ywA-OVu}1RYC!R&qv*=kOu#h=Zz?9vW)6kHInx+h~ ziEQd#qXufQryOefpwu?YJOg2`clIjtEQB7115g2bf$G*UlH|!r&ZD$c*Ofgw@C!{> zbUeN0Hkkq4M78X+ZK|BwlNBC^9l`Fj2yEKIn<5Sa($-shX5Qi%#^gF~YTplbEsXI5 z0(4=ItJ77MqzKSxn>|>QHCyS=XAAkGwz-Q3g=v=#nyBG7b(*VSYAGXjt?dnY!~&1P z@k6T0W(p9n1mpoBdcYF_y3maApPpA02-Y89(s0CCi@IjU{CB^q!U%jlzxs?<7!Wt#473tCqp@*8?Z zA$(3S_MB4Pw9~Y{A2jpDLMJ=6l|nGSI=>!Ey`)a1;mA;vLqEJ&qpwJ($9nfsOkBQ* zqqE4hupFp9mloCe&G_>3|1Zh>^LX+ILvvUbO{Mecyohd}cV;DqA+dGu;i~cpcCYm~ z`o-;ygDY#z8`p)OKYb|wb@I(;Kjhze7rnUjT-e9&uErLkF$yK4>voBFHNN)ew@!LE zdGn^t;gj#hzl$HrhsB>BzaM|?jp!>EzRW1zqXqWI8%W~P+KYFrUw`}P;NC&`_6K+F MkH7x?LGzb?0ItqZ1poj5 diff --git a/miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.test.js b/miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.test.js index 93ad6fbe9..0fe58e304 100644 --- a/miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.test.js +++ b/miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.test.js @@ -613,12 +613,12 @@ describe('TimeTest', function() { console.log('setTime = ' + time) systemTime.setTime(time) - var resGetTime = systemTime.getCurrentTime() + var resGetTime = systemTime.getCurrentTime(true) console.log('GetTime = ' + resGetTime) assert.equal(resGetTime,time) sleep(5000).then(() => { - resGetTime = systemTime.getCurrentTime(); + resGetTime = systemTime.getCurrentTime(true); console.log('GetTime = ' + resGetTime); assert.equal(resGetTime <= (time + 6000) && resGetTime >= (time + 5000)); @@ -641,12 +641,12 @@ describe('TimeTest', function() { console.log('setTime = ' + time) systemTime.setTime(time) - var resGetTime = systemTime.getCurrentTime() + var resGetTime = systemTime.getCurrentTime(true) console.log('GetTime = ' + resGetTime) assert.equal(resGetTime,time) sleep(5000).then(() => { - resGetTime = systemTime.getCurrentTime(); + resGetTime = systemTime.getCurrentTime(true); console.log('GetTime = ' + resGetTime); assert.equal(resGetTime <= (time + 6000) && resGetTime >= (time + 5000)); @@ -669,12 +669,12 @@ describe('TimeTest', function() { console.log('setTime = ' + time) systemTime.setTime(time) - var resGetTime = systemTime.getCurrentTime() + var resGetTime = systemTime.getCurrentTime(true) console.log('GetTime = ' + resGetTime) assert.equal(resGetTime,time) sleep(5000).then(() => { - resGetTime = systemTime.getCurrentTime(); + resGetTime = systemTime.getCurrentTime(true); console.log('GetTime = ' + resGetTime); assert.equal(resGetTime <= (time + 6000) && resGetTime >= (time + 5000)); @@ -684,7 +684,7 @@ describe('TimeTest', function() { /** * @tc.number SUB_systemTime_setTime_JS_API_0400 - * @tc.name Test systemTime.setTime time = Number.MAX_VALUE/2, getCurrentTimeNs + * @tc.name Test systemTime.setTime time = -1 * @tc.desc Test systemTime_setTime API functionality. * @tc.size : MEDIUM * @tc.type : Function @@ -692,37 +692,12 @@ describe('TimeTest', function() { */ it('systemTime_setTime_test4',0, async () => { console.log('SUB_systemTime_setTime_JS_API_0400 start') - var time = Number.MAX_VALUE/2 - - console.log('setTime = ' + time) - systemTime.setTime(time) - - sleep(5000).then(() => { - var resGetTime = systemTime.getCurrentTimeNs(); - console.log('GetTime = ' + resGetTime); - assert.equal(resGetTime <= ((time + 6000) * 1000000) && resGetTime >= ((time + 5000) * 1000000)); - - console.log('SUB_systemTime_setTime_JS_API_0400 end'); - }) - }) - - - /** - * @tc.number SUB_systemTime_setTime_JS_API_0500 - * @tc.name Test systemTime.setTime time = -1 - * @tc.desc Test systemTime_setTime API functionality. - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('systemTime_setTime_test5',0, async () => { - console.log('SUB_systemTime_setTime_JS_API_0500 start') var time = -1 console.log('setTime = ' + time) systemTime.setTime(time) - console.log('SUB_systemTime_setTime_JS_API_0500 end'); + console.log('SUB_systemTime_setTime_JS_API_0400 end'); }) /** @@ -1047,29 +1022,6 @@ describe('TimeTest', function() { }) }) - /** - * @tc.number SUB_systemTime_getRealActiveTimeNs_JS_API_0100 - * @tc.name Test systemTime.getRealActiveTimeNs - * @tc.desc Test systemTime_getRealActiveTimeNs API functionality. - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('systemTime_getRealActiveTimeNs_test1',0, async () => { - console.log('SUB_systemTime_getRealActiveTimeNs_JS_API_0100 start') - - var resGetTime0 = systemTime.getRealActiveTimeNs() - console.log('GetTime0 = ' + resGetTime0) - - sleep(5000).then(() => { - var resGetTime1 = systemTime.getRealActiveTimeNs(); - console.log('GetTime1 = ' + resGetTime1); - assert.equal(resGetTime1 <= (resGetTime0 + 6000 * 1000000) && resGetTime1 >= (resGetTime0 + 5000 * 1000000)); - - console.log('SUB_systemTime_getRealActiveTimeNs_JS_API_0100 end'); - }) - }) - /** * @tc.number SUB_systemTime_getRealTime_JS_API_0100 * @tc.name Test systemTime.getRealTime @@ -1093,29 +1045,6 @@ describe('TimeTest', function() { }) }) - /** - * @tc.number SUB_systemTime_getRealTimeNs_JS_API_0100 - * @tc.name Test systemTime.getRealTimeNs - * @tc.desc Test systemTime_getRealTimeNs API functionality. - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('systemTime_getRealTimeNs_test1',0, async () => { - console.log('SUB_systemTime_getRealTimeNs_JS_API_0100 start') - - var resGetTime0 = systemTime.getRealTimeNs() - console.log('GetTime0 = ' + resGetTime0) - - sleep(5000).then(() => { - var resGetTime1 = systemTime.getRealTimeNs(); - console.log('GetTime1 = ' + resGetTime1); - assert.equal(resGetTime1 <= (resGetTime0 + 6000 * 1000000) && resGetTime1 >= (resGetTime0 + 5000 * 1000000)); - - console.log('SUB_systemTime_getRealTimeNs_JS_API_0100 end'); - }) - }) - function sleep (time) { return new Promise((resolve) => setTimeout(resolve, time)); } diff --git a/miscservices/TimerTest_js/signature/openharmony_sx.p7b b/miscservices/TimerTest_js/signature/openharmony_sx.p7b index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..66b4457a8a81fb8d3356cf46d67226c850944858 100644 GIT binary patch delta 988 zcmZ9L&2QUu9LDQ3ZE4qTNQ_A#Ic>& zsohklC_)unCaN%LC)NW3X&N9v z{JMO9`2dWUoZ0#34%x%smyo&G@p$QSgz7N_L6^X(+4;+dETT`xV+a_}ocT{gj>j`o z@p1gG{lu<5@Y;^Ora4VL@jSYE0&KMxfdrZaNsw4g42SJz^x^>9Y-F?g8s3V|(T($G z{5|(yZ=hSc>gkE2&c&nK=P%&dbY=s`@XTt$cKkK9~r9waIB@<&@~^ zHmeSLj=eW|0eR`1Fd|9V&)O(9>m<#obpbWKz1p}P&c8!|Gi5=Nm+ zKu@OWY*4GK>UMMP~9j0#cfza|;vsB6gI%9D_t|~RV&@%+ob9RRfUFt)5;!dAk zFbKI}4zzaNo?MyE9OR0AI2f8%-PX1V$>W=WR_o`7S*K7c8>#>Uh9vvUj*!k0P@o72 zQYwT&P2xhx`zk0(n46}!VaoODc3x=aNy?D$5{p`ZNEaECumq#o#zw7--OYNgI-(^m z1*(O>ZTT4qa%8~n3?Ww0t#Ui%)a?tDa}#ZxcS_=7)>eq1@$e|YPi zTfI-OPCfC{Z;$^HDeqQ4!M}+eeEm_7{`}1ZRwPNG(;tKX)y;R+NO5CnoJtweQnovT03zP=fldOw&TQ!9XoaG zI5tC-a;T6%NL4Oq2R05voM2*HkdV;0Ax$7n)8K}XKyZOc?64COZqbT3zQ6zTd-NWj z|C7sqTs}f)iT={c>&Nu*(?n!BdTW*tLsXAOBG?OPVrk{zn2x9mv1nxR0y^i4{kOQm;GnH?;@iI|qNC3PLu4y{}^o64afetQ#f{L$%tTQyW^tRnMxWIbVN z*0`fiRKpsn_IxLDZM8(;IFM64;4u*N7_wF=i$XAeFY@sbHz2XL$r4P!)r53IQ#dvt zy^sdyYye%BAA308BI-O(kzSFg4ah1B0R=FD#35U3n_{}I$-|B=r?MtnAw9x7o2E%m z3nZ%Uszc3?2PDse%)ge#(p8~ywA-OVu}1RYC!R&qv*=kOu#h=Zz?9vW)6kHInx+h~ ziEQd#qXufQryOefpwu?YJOg2`clIjtEQB7115g2bf$G*UlH|!r&ZD$c*Ofgw@C!{> zbUeN0Hkkq4M78X+ZK|BwlNBC^9l`Fj2yEKIn<5Sa($-shX5Qi%#^gF~YTplbEsXI5 z0(4=ItJ77MqzKSxn>|>QHCyS=XAAkGwz-Q3g=v=#nyBG7b(*VSYAGXjt?dnY!~&1P z@k6T0W(p9n1mpoBdcYF_y3maApPpA02-Y89(s0CCi@IjU{CB^q!U%jlzxs?<7!Wt#473tCqp@*8?Z zA$(3S_MB4Pw9~Y{A2jpDLMJ=6l|nGSI=>!Ey`)a1;mA;vLqEJ&qpwJ($9nfsOkBQ* zqqE4hupFp9mloCe&G_>3|1Zh>^LX+ILvvUbO{Mecyohd}cV;DqA+dGu;i~cpcCYm~ z`o-;ygDY#z8`p)OKYb|wb@I(;Kjhze7rnUjT-e9&uErLkF$yK4>voBFHNN)ew@!LE zdGn^t;gj#hzl$HrhsB>BzaM|?jp!>EzRW1zqXqWI8%W~P+KYFrUw`}P;NC&`_6K+F MkH7x?LGzb?0ItqZ1poj5 -- GitLab