mirror of
https://github.com/openharmony/third_party_jsframework.git
synced 2026-07-19 14:33:33 -04:00
@@ -161,13 +161,13 @@ import { mockDefaultAppManager } from './ohos_bundle_defaultAppManager'
|
||||
import { mockKeyEvent } from './ohos_multimodalInput_keyEvent'
|
||||
import { mockMouseEvent } from './ohos_multimodalInput_mouseEvent'
|
||||
import { mockTouchEvent } from './ohos_multimodalInput_touchEvent'
|
||||
import { mockUiAppearance } from './ohos_uiappearance'
|
||||
import { mockUiAppearance } from './ohos_uiAppearance'
|
||||
export function mockRequireNapiFun() {
|
||||
global.requireNapi = function (...args) {
|
||||
switch (args[0]) {
|
||||
case "file":
|
||||
return mockFile();
|
||||
case "uiappearance":
|
||||
case "uiAppearance":
|
||||
return mockUiAppearance();
|
||||
case "resourceManager":
|
||||
return mockResourceManager();
|
||||
|
||||
+5
-5
@@ -19,11 +19,11 @@ export function mockUiAppearance() {
|
||||
const DarkMode = {
|
||||
ALWAYS_DARK: 0,
|
||||
ALWAYS_LIGHT: 1
|
||||
};
|
||||
const uiappearance = {
|
||||
}
|
||||
const uiAppearance = {
|
||||
DarkMode,
|
||||
setDarkMode: function (...args) {
|
||||
console.warn("uiappearance.setDarkMode interface mocked in the Previewer." +
|
||||
console.warn("uiAppearance.setDarkMode interface mocked in the Previewer." +
|
||||
" How this interface works on the Previewer may be different from that on a real device.")
|
||||
const len = args.length;
|
||||
if (len > 0 && typeof args[len - 1] === 'function') {
|
||||
@@ -35,10 +35,10 @@ export function mockUiAppearance() {
|
||||
}
|
||||
},
|
||||
getDarkMode: function () {
|
||||
console.warn("uiappearance.getDarkMode interface mocked in the Previewer." +
|
||||
console.warn("uiAppearance.getDarkMode interface mocked in the Previewer." +
|
||||
" How this interface works on the Previewer may be different from that on a real device.")
|
||||
return DarkMode;
|
||||
}
|
||||
}
|
||||
return uiappearance;
|
||||
return uiAppearance;
|
||||
}
|
||||
Reference in New Issue
Block a user