!664 pasteboard add api {data} mock

Merge pull request !664 from LVB8189/master
This commit is contained in:
openharmony_ci
2022-09-06 07:07:38 +00:00
committed by Gitee
@@ -124,6 +124,7 @@ export function mockPasteBoard() {
plainText: '[PC preview] unknow plainText',
uri: '[PC preview] unknow uri',
pixelMap: PixelMapMock,
data: {'mock_xml': new ArrayBuffer()},
convertToText: function (...args) {
console.warn("PasteDataRecord.convertToText interface mocked in the Previewer. How this interface works on the" +
" Previewer may be different from that on a real device.")
@@ -140,7 +141,8 @@ export function mockPasteBoard() {
const pasteboard = {
ShareOption: {
InApp: "[PC Preview] unknown InApp",
LocalDevice: "[PC Preview] unknown LocalDevice"
LocalDevice: "[PC Preview] unknown LocalDevice",
CrossDevice: "[PC Preview] unknown CrossDevice"
},
MAX_RECORD_NUM: '[PC preview] unknow MAX_RECORD_NUM',
MIMETYPE_TEXT_HTML: '[PC preview] unknow MIMETYPE_TEXT_HTML11111',
@@ -168,6 +170,11 @@ export function mockPasteBoard() {
" the Previewer may be different from that on a real device.")
return PasteDataMock;
},
createData: function (...args) {
console.warn("pasteboard.createData interface mocked in the Previewer. How this interface works on" +
" the Previewer may be different from that on a real device.")
return PasteDataMock;
},
createWantData: function (...args) {
console.warn("pasteboard.createWantData interface mocked in the Previewer. How this interface works on" +
" the Previewer may be different from that on a real device.")
@@ -193,6 +200,11 @@ export function mockPasteBoard() {
" the Previewer may be different from that on a real device.")
return PasteDataRecordMock;
},
createRecord: function (...args) {
console.warn("pasteboard.createRecord interface mocked in the Previewer. How this interface works on" +
" the Previewer may be different from that on a real device.")
return PasteDataRecordMock;
},
createPlainTextRecord: function (...args) {
console.warn("pasteboard.createPlainTextRecord interface mocked in the Previewer. How this interface works on" +
" the Previewer may be different from that on a real device.")