未验证 提交 4901cdb1 编写于 作者: O openharmony_ci 提交者: Gitee

!7606 api9发布前终审修改接口

Merge pull request !7606 from zzs110/master
...@@ -56,7 +56,7 @@ export default function pasteBoardTest(){ ...@@ -56,7 +56,7 @@ export default function pasteBoardTest(){
var systemPasteBoard = pasteboard.getSystemPasteboard(); var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => { await systemPasteBoard.clear().then(async () => {
let prop = pasteData.getProperty(); let prop = pasteData.getProperty();
prop.shareOption = pasteboard.ShareOption.InApp; prop.shareOption = pasteboard.ShareOption.INAPP;
pasteData.setProperty(prop); pasteData.setProperty(prop);
var property = pasteData.getProperty(); var property = pasteData.getProperty();
expect(0).assertEqual(property.shareOption) expect(0).assertEqual(property.shareOption)
...@@ -78,7 +78,7 @@ export default function pasteBoardTest(){ ...@@ -78,7 +78,7 @@ export default function pasteBoardTest(){
var systemPasteBoard = pasteboard.getSystemPasteboard(); var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => { await systemPasteBoard.clear().then(async () => {
let prop = pasteData.getProperty(); let prop = pasteData.getProperty();
prop.shareOption = pasteboard.ShareOption.LocalDevice; prop.shareOption = pasteboard.ShareOption.LOCALDEVICE;
pasteData.setProperty(prop); pasteData.setProperty(prop);
var property = pasteData.getProperty(); var property = pasteData.getProperty();
expect(1).assertEqual(property.shareOption) expect(1).assertEqual(property.shareOption)
...@@ -100,7 +100,7 @@ export default function pasteBoardTest(){ ...@@ -100,7 +100,7 @@ export default function pasteBoardTest(){
var systemPasteBoard = pasteboard.getSystemPasteboard(); var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => { await systemPasteBoard.clear().then(async () => {
let prop = pasteData.getProperty(); let prop = pasteData.getProperty();
prop.shareOption = pasteboard.ShareOption.CrossDevice; prop.shareOption = pasteboard.ShareOption.CROSSDEVICE;
pasteData.setProperty(prop); pasteData.setProperty(prop);
var property = pasteData.getProperty(); var property = pasteData.getProperty();
expect(2).assertEqual(property.shareOption) expect(2).assertEqual(property.shareOption)
...@@ -206,17 +206,17 @@ export default function pasteBoardTest(){ ...@@ -206,17 +206,17 @@ export default function pasteBoardTest(){
}) })
/** /**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0100 * @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0100
* @tc.name convertToTextV9 * @tc.name coerceToText
* @tc.desc Successfully cast string record to text * @tc.desc Successfully cast string record to text
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 2 * @tc.level : Level 2
*/ */
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0100', 0, async function (done) { it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0100', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0100 start") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0100 start")
let pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_PLAIN,"valueType") let pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_PLAIN,"valueType")
await pasteDataRecord.convertToTextV9((err, data) => { await pasteDataRecord.coerceToText((err, data) => {
if(err != null){ if(err != null){
console.info("Cast string record to text error, error message is: " + err) console.info("Cast string record to text error, error message is: " + err)
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -225,25 +225,25 @@ export default function pasteBoardTest(){ ...@@ -225,25 +225,25 @@ export default function pasteBoardTest(){
expect(data).assertEqual("valueType") expect(data).assertEqual("valueType")
} }
}) })
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0100 end") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0100 end")
done(); done();
}) })
/** /**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0200 * @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0200
* @tc.name convertToTextV9 * @tc.name coerceToText
* @tc.desc Successfully cast pixelMap record to text * @tc.desc Successfully cast pixelMap record to text
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 2 * @tc.level : Level 2
*/ */
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0200', 0, async function (done) { it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0200', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0200 start") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0200 start")
let pasteDataRecord =undefined; let pasteDataRecord =undefined;
await image.createPixelMap(color, opt).then((pixelMap) => { await image.createPixelMap(color, opt).then((pixelMap) => {
pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_PIXELMAP,pixelMap); pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_PIXELMAP,pixelMap);
}) })
await pasteDataRecord.convertToTextV9((err, data) => { await pasteDataRecord.coerceToText((err, data) => {
if(err != null){ if(err != null){
console.info("Cast pixelMap record to text error, error message is: " + err) console.info("Cast pixelMap record to text error, error message is: " + err)
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -252,22 +252,22 @@ export default function pasteBoardTest(){ ...@@ -252,22 +252,22 @@ export default function pasteBoardTest(){
expect(data).assertEqual("") expect(data).assertEqual("")
} }
}) })
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0200 end") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0200 end")
done(); done();
}) })
/** /**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0300 * @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0300
* @tc.name convertToTextV9 * @tc.name coerceToText
* @tc.desc Successfully cast want record to text * @tc.desc Successfully cast want record to text
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 2 * @tc.level : Level 2
*/ */
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0300', 0, async function (done) { it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0300', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0300 start") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0300 start")
let pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_WANT,WANT) let pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_WANT,WANT)
await pasteDataRecord.convertToTextV9((err, data) => { await pasteDataRecord.coerceToText((err, data) => {
if(err != null){ if(err != null){
console.info("Cast want record to text error, error message is: " + err) console.info("Cast want record to text error, error message is: " + err)
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -276,22 +276,22 @@ export default function pasteBoardTest(){ ...@@ -276,22 +276,22 @@ export default function pasteBoardTest(){
expect(data).assertEqual("") expect(data).assertEqual("")
} }
}) })
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0300 end") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0300 end")
done(); done();
}) })
/** /**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0400 * @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0400
* @tc.name convertToTextV9 * @tc.name coerceToText
* @tc.desc Successfully cast arrayBuffer record to text * @tc.desc Successfully cast arrayBuffer record to text
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 2 * @tc.level : Level 2
*/ */
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0400', 0, async function (done) { it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0400', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0400 start") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0400 start")
let pasteDataRecord = pasteboard.createRecord("ArrayBuffer",ARRAY_BUFFER) let pasteDataRecord = pasteboard.createRecord("ArrayBuffer",ARRAY_BUFFER)
await pasteDataRecord.convertToTextV9((err, data) => { await pasteDataRecord.coerceToText((err, data) => {
if(err != null){ if(err != null){
console.info("Cast arrayBuffer record to text error, error message is: " + err) console.info("Cast arrayBuffer record to text error, error message is: " + err)
expect(false).assertTrue(); expect(false).assertTrue();
...@@ -300,23 +300,23 @@ export default function pasteBoardTest(){ ...@@ -300,23 +300,23 @@ export default function pasteBoardTest(){
expect(data).assertEqual("") expect(data).assertEqual("")
} }
}) })
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0400 end") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0400 end")
done(); done();
}) })
/** /**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0500 * @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0500
* @tc.name convertToTextV9 * @tc.name coerceToText
* @tc.desc Cast arrayBuffer record to text failed, * @tc.desc Cast arrayBuffer record to text failed,
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 2 * @tc.level : Level 2
*/ */
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0500', 0, async function (done) { it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0500', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0500 start") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0500 start")
let pasteDataRecord = pasteboard.createRecord("string",ARRAY_BUFFER) let pasteDataRecord = pasteboard.createRecord("string",ARRAY_BUFFER)
function convert(callBack){ function convert(callBack){
pasteDataRecord.convertToTextV9(callBack) pasteDataRecord.coerceToText(callBack)
} }
try{ try{
convert("callback") convert("callback")
...@@ -326,98 +326,98 @@ export default function pasteBoardTest(){ ...@@ -326,98 +326,98 @@ export default function pasteBoardTest(){
expect(err.code).assertEqual("401") expect(err.code).assertEqual("401")
} }
expect(error != undefined).assertTrue(); expect(error != undefined).assertTrue();
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0500 end") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0500 end")
done(); done();
}) })
/** /**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0100 * @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0100
* @tc.name convertToTextV9 * @tc.name coerceToText
* @tc.desc Successfully cast string record to text * @tc.desc Successfully cast string record to text
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 2 * @tc.level : Level 2
*/ */
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0100', 0, async function (done) { it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0100', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0100 start") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0100 start")
let pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_PLAIN,"valueType") let pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_PLAIN,"valueType")
await pasteDataRecord.convertToTextV9().then((data) => { await pasteDataRecord.coerceToText().then((data) => {
console.info("Cast string record to text success,result is: " + data) console.info("Cast string record to text success,result is: " + data)
expect(data).assertEqual("valueType") expect(data).assertEqual("valueType")
}).catch((err) => { }).catch((err) => {
console.info("Cast string record to text error, error message is: " + err) console.info("Cast string record to text error, error message is: " + err)
expect(false).assertTrue(); expect(false).assertTrue();
}) })
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0100 end") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0100 end")
done(); done();
}) })
/** /**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0200 * @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0200
* @tc.name convertToTextV9 * @tc.name coerceToText
* @tc.desc Successfully cast pixelMap record to text * @tc.desc Successfully cast pixelMap record to text
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 2 * @tc.level : Level 2
*/ */
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0200', 0, async function (done) { it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0200', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0200 start") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0200 start")
let pasteDataRecord =undefined; let pasteDataRecord =undefined;
await image.createPixelMap(color, opt).then((pixelMap) => { await image.createPixelMap(color, opt).then((pixelMap) => {
pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_PIXELMAP,pixelMap); pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_PIXELMAP,pixelMap);
}) })
await pasteDataRecord.convertToTextV9().then((data) => { await pasteDataRecord.coerceToText().then((data) => {
console.info("Cast pixelMap record to text success,result is: " + data) console.info("Cast pixelMap record to text success,result is: " + data)
expect(data).assertEqual("") expect(data).assertEqual("")
}).catch((err) => { }).catch((err) => {
console.info("Cast pixelMap record to text error, error message is: " + err) console.info("Cast pixelMap record to text error, error message is: " + err)
expect(false).assertTrue(); expect(false).assertTrue();
}) })
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0200 end") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0200 end")
done(); done();
}) })
/** /**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0300 * @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0300
* @tc.name convertToTextV9 * @tc.name coerceToText
* @tc.desc Successfully cast want record to text * @tc.desc Successfully cast want record to text
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 2 * @tc.level : Level 2
*/ */
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0300', 0, async function (done) { it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0300', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0300 start") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0300 start")
let pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_WANT,WANT) let pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_WANT,WANT)
await pasteDataRecord.convertToTextV9().then((data) => { await pasteDataRecord.coerceToText().then((data) => {
console.info("Cast want record to text success,result is: " + data) console.info("Cast want record to text success,result is: " + data)
expect(data).assertEqual("") expect(data).assertEqual("")
}).catch(err => { }).catch(err => {
console.info("Cast want record to text error, error message is: " + err) console.info("Cast want record to text error, error message is: " + err)
expect(false).assertTrue(); expect(false).assertTrue();
}) })
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0300 end") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0300 end")
done(); done();
}) })
/** /**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0400 * @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0400
* @tc.name convertToTextV9 * @tc.name coerceToText
* @tc.desc Successfully cast arrayBuffer record to text * @tc.desc Successfully cast arrayBuffer record to text
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 2 * @tc.level : Level 2
*/ */
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0400', 0, async function (done) { it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0400', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0400 start") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0400 start")
let pasteDataRecord = pasteboard.createRecord("ArrayBuffer",ARRAY_BUFFER) let pasteDataRecord = pasteboard.createRecord("ArrayBuffer",ARRAY_BUFFER)
await pasteDataRecord.convertToTextV9().then((data) => { await pasteDataRecord.coerceToText().then((data) => {
console.info("Cast arrayBuffer record to text success,result is: " + data) console.info("Cast arrayBuffer record to text success,result is: " + data)
expect(data).assertEqual("") expect(data).assertEqual("")
}).catch(err => { }).catch(err => {
console.info("Cast arrayBuffer record to text error, error message is: " + err) console.info("Cast arrayBuffer record to text error, error message is: " + err)
expect(false).assertTrue(); expect(false).assertTrue();
}) })
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0400 end") console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0400 end")
done(); done();
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册