From c0a18edec6210d47f4b971aaf3b228c402a55e7e Mon Sep 17 00:00:00 2001 From: LVB8189 Date: Fri, 2 Sep 2022 19:28:58 +0800 Subject: [PATCH 1/3] Signed-off-by: LVB8189 Changes to be committed: --- .../extend/systemplugin/napi/ohos_pasteboard.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/runtime/main/extend/systemplugin/napi/ohos_pasteboard.js b/runtime/main/extend/systemplugin/napi/ohos_pasteboard.js index f5fd5f25..01354e86 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_pasteboard.js +++ b/runtime/main/extend/systemplugin/napi/ohos_pasteboard.js @@ -124,6 +124,7 @@ export function mockPasteBoard() { plainText: '[PC preview] unknow plainText', uri: '[PC preview] unknow uri', pixelMap: PixelMapMock, + data: new ArrayBuffer('[PC preview] unknow data'), 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.") From cbae781c0b723faf188a1b1c99a8782793049cf0 Mon Sep 17 00:00:00 2001 From: LVB8189 Date: Mon, 5 Sep 2022 20:37:44 +0800 Subject: [PATCH 2/3] Mod Signed-off-by: LVB8189 --- runtime/main/extend/systemplugin/napi/ohos_pasteboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/main/extend/systemplugin/napi/ohos_pasteboard.js b/runtime/main/extend/systemplugin/napi/ohos_pasteboard.js index 01354e86..645e81c8 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_pasteboard.js +++ b/runtime/main/extend/systemplugin/napi/ohos_pasteboard.js @@ -124,7 +124,7 @@ export function mockPasteBoard() { plainText: '[PC preview] unknow plainText', uri: '[PC preview] unknow uri', pixelMap: PixelMapMock, - data: new ArrayBuffer('[PC preview] unknow data'), + data: {"mimeType": 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.") From 11494aa4150f34e4662b487459065394afeef2d5 Mon Sep 17 00:00:00 2001 From: LVB8189 Date: Tue, 6 Sep 2022 14:07:54 +0800 Subject: [PATCH 3/3] mod Signed-off-by: LVB8189 --- runtime/main/extend/systemplugin/napi/ohos_pasteboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/main/extend/systemplugin/napi/ohos_pasteboard.js b/runtime/main/extend/systemplugin/napi/ohos_pasteboard.js index 645e81c8..abc91dff 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_pasteboard.js +++ b/runtime/main/extend/systemplugin/napi/ohos_pasteboard.js @@ -124,7 +124,7 @@ export function mockPasteBoard() { plainText: '[PC preview] unknow plainText', uri: '[PC preview] unknow uri', pixelMap: PixelMapMock, - data: {"mimeType": new ArrayBuffer()}, + 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.")