@flighthq/host-web 0.5.1-next.903.f434bc2 → 0.5.1-next.905.5fbf787
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +35 -35
- package/src/webAccessibility.test.ts +14 -5
- package/src/webApp.test.ts +58 -1
- package/src/webAudio.test.ts +6 -1
- package/src/webBitmapEncode.test.ts +10 -1
- package/src/webBitmapReadback.test.ts +10 -1
- package/src/webCanvasRenderSurface.test.ts +10 -1
- package/src/webClipboard.test.ts +6 -1
- package/src/webConnectivity.test.ts +10 -1
- package/src/webCursor.test.ts +6 -1
- package/src/webDevice.test.ts +11 -1
- package/src/webDialog.test.ts +91 -50
- package/src/webFontLoading.test.ts +6 -1
- package/src/webGlRenderSurface.test.ts +6 -0
- package/src/webGlyphRasterizer.test.ts +10 -1
- package/src/webHaptics.test.ts +6 -1
- package/src/webImage.test.ts +19 -14
- package/src/webInputTarget.test.ts +7 -1
- package/src/webKeyboard.test.ts +20 -0
- package/src/webMediasession.test.ts +13 -0
- package/src/webMenu.test.ts +18 -2
- package/src/webMidi.test.ts +39 -3
- package/src/webNet.test.ts +6 -1
- package/src/webNotification.test.ts +6 -1
- package/src/webPlatform.test.ts +7 -2
- package/src/webPower.test.ts +27 -0
- package/src/webProtocol.test.ts +23 -1
- package/src/webRaster2DSurface.test.ts +10 -1
- package/src/webScreen.test.ts +6 -1
- package/src/webServiceWorkerNotification.test.ts +6 -0
- package/src/webShare.test.ts +17 -1
- package/src/webShell.test.ts +6 -1
- package/src/webStorage.test.ts +6 -1
- package/src/webStoragePersistence.test.ts +6 -0
- package/src/webVideoCapability.test.ts +10 -1
- package/src/webWgpuRenderSurface.test.ts +6 -0
- package/src/webWindow.test.ts +14 -1
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/host-web`. The `@fli
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/host-web@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/host-web@0.5.1-next.905.5fbf787](https://github.com/flighthq/flight/tree/5fbf7874064c384307542d68b4dcb6a895ff0dcf/packages/host-web)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/5fbf7874064c384307542d68b4dcb6a895ff0dcf/LICENSE.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/host-web",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.905.5fbf787",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,40 +38,40 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/app": "0.5.1-next.
|
|
42
|
-
"@flighthq/application": "0.5.1-next.
|
|
43
|
-
"@flighthq/audio": "0.5.1-next.
|
|
44
|
-
"@flighthq/bitmap": "0.5.1-next.
|
|
45
|
-
"@flighthq/device": "0.5.1-next.
|
|
46
|
-
"@flighthq/dialog": "0.5.1-next.
|
|
47
|
-
"@flighthq/entity": "0.5.1-next.
|
|
48
|
-
"@flighthq/filesystem": "0.5.1-next.
|
|
49
|
-
"@flighthq/font": "0.5.1-next.
|
|
50
|
-
"@flighthq/geolocation": "0.5.1-next.
|
|
51
|
-
"@flighthq/glyphatlas": "0.5.1-next.
|
|
52
|
-
"@flighthq/haptics": "0.5.1-next.
|
|
53
|
-
"@flighthq/image": "0.5.1-next.
|
|
54
|
-
"@flighthq/lifecycle": "0.5.1-next.
|
|
55
|
-
"@flighthq/media": "0.5.1-next.
|
|
56
|
-
"@flighthq/menu": "0.5.1-next.
|
|
57
|
-
"@flighthq/midi": "0.5.1-next.
|
|
58
|
-
"@flighthq/notification": "0.5.1-next.
|
|
59
|
-
"@flighthq/platform": "0.5.1-next.
|
|
60
|
-
"@flighthq/power": "0.5.1-next.
|
|
61
|
-
"@flighthq/protocol": "0.5.1-next.
|
|
62
|
-
"@flighthq/render": "0.5.1-next.
|
|
63
|
-
"@flighthq/render-gl": "0.5.1-next.
|
|
64
|
-
"@flighthq/render-wgpu": "0.5.1-next.
|
|
65
|
-
"@flighthq/screen": "0.5.1-next.
|
|
66
|
-
"@flighthq/sensors": "0.5.1-next.
|
|
67
|
-
"@flighthq/socket": "0.5.1-next.
|
|
68
|
-
"@flighthq/share": "0.5.1-next.
|
|
69
|
-
"@flighthq/signals": "0.5.1-next.
|
|
70
|
-
"@flighthq/statusbar": "0.5.1-next.
|
|
71
|
-
"@flighthq/storage": "0.5.1-next.
|
|
72
|
-
"@flighthq/types": "0.5.1-next.
|
|
73
|
-
"@flighthq/useragent": "0.5.1-next.
|
|
74
|
-
"@flighthq/video": "0.5.1-next.
|
|
41
|
+
"@flighthq/app": "0.5.1-next.905.5fbf787",
|
|
42
|
+
"@flighthq/application": "0.5.1-next.905.5fbf787",
|
|
43
|
+
"@flighthq/audio": "0.5.1-next.905.5fbf787",
|
|
44
|
+
"@flighthq/bitmap": "0.5.1-next.905.5fbf787",
|
|
45
|
+
"@flighthq/device": "0.5.1-next.905.5fbf787",
|
|
46
|
+
"@flighthq/dialog": "0.5.1-next.905.5fbf787",
|
|
47
|
+
"@flighthq/entity": "0.5.1-next.905.5fbf787",
|
|
48
|
+
"@flighthq/filesystem": "0.5.1-next.905.5fbf787",
|
|
49
|
+
"@flighthq/font": "0.5.1-next.905.5fbf787",
|
|
50
|
+
"@flighthq/geolocation": "0.5.1-next.905.5fbf787",
|
|
51
|
+
"@flighthq/glyphatlas": "0.5.1-next.905.5fbf787",
|
|
52
|
+
"@flighthq/haptics": "0.5.1-next.905.5fbf787",
|
|
53
|
+
"@flighthq/image": "0.5.1-next.905.5fbf787",
|
|
54
|
+
"@flighthq/lifecycle": "0.5.1-next.905.5fbf787",
|
|
55
|
+
"@flighthq/media": "0.5.1-next.905.5fbf787",
|
|
56
|
+
"@flighthq/menu": "0.5.1-next.905.5fbf787",
|
|
57
|
+
"@flighthq/midi": "0.5.1-next.905.5fbf787",
|
|
58
|
+
"@flighthq/notification": "0.5.1-next.905.5fbf787",
|
|
59
|
+
"@flighthq/platform": "0.5.1-next.905.5fbf787",
|
|
60
|
+
"@flighthq/power": "0.5.1-next.905.5fbf787",
|
|
61
|
+
"@flighthq/protocol": "0.5.1-next.905.5fbf787",
|
|
62
|
+
"@flighthq/render": "0.5.1-next.905.5fbf787",
|
|
63
|
+
"@flighthq/render-gl": "0.5.1-next.905.5fbf787",
|
|
64
|
+
"@flighthq/render-wgpu": "0.5.1-next.905.5fbf787",
|
|
65
|
+
"@flighthq/screen": "0.5.1-next.905.5fbf787",
|
|
66
|
+
"@flighthq/sensors": "0.5.1-next.905.5fbf787",
|
|
67
|
+
"@flighthq/socket": "0.5.1-next.905.5fbf787",
|
|
68
|
+
"@flighthq/share": "0.5.1-next.905.5fbf787",
|
|
69
|
+
"@flighthq/signals": "0.5.1-next.905.5fbf787",
|
|
70
|
+
"@flighthq/statusbar": "0.5.1-next.905.5fbf787",
|
|
71
|
+
"@flighthq/storage": "0.5.1-next.905.5fbf787",
|
|
72
|
+
"@flighthq/types": "0.5.1-next.905.5fbf787",
|
|
73
|
+
"@flighthq/useragent": "0.5.1-next.905.5fbf787",
|
|
74
|
+
"@flighthq/video": "0.5.1-next.905.5fbf787"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"typescript": "^5.3.0"
|
|
@@ -2,7 +2,11 @@ import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
|
2
2
|
import type { AccessibilityNode } from '@flighthq/types/contract';
|
|
3
3
|
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
createWebAccessibilityBackend,
|
|
7
|
+
initializeWebAccessibilityBackend,
|
|
8
|
+
webAccessibilityBackend,
|
|
9
|
+
} from './webAccessibility';
|
|
6
10
|
import { webHost } from './webHost';
|
|
7
11
|
|
|
8
12
|
afterEach(() => {
|
|
@@ -192,10 +196,9 @@ describe('createWebAccessibilityBackend', () => {
|
|
|
192
196
|
});
|
|
193
197
|
});
|
|
194
198
|
|
|
195
|
-
describe('
|
|
196
|
-
it('is the
|
|
197
|
-
expect(
|
|
198
|
-
expect(webHost.accessibility.provider).toBe(webAccessibilityBackend);
|
|
199
|
+
describe('initializeWebAccessibilityBackend', () => {
|
|
200
|
+
it('is the construction initializer of createWebAccessibilityBackend', () => {
|
|
201
|
+
expect(typeof initializeWebAccessibilityBackend).toBe('function');
|
|
199
202
|
});
|
|
200
203
|
});
|
|
201
204
|
|
|
@@ -206,3 +209,9 @@ function node(
|
|
|
206
209
|
): AccessibilityNode {
|
|
207
210
|
return { id, role, ...extras };
|
|
208
211
|
}
|
|
212
|
+
describe('webAccessibilityBackend', () => {
|
|
213
|
+
it('is the stable Entity provider published by webHost', () => {
|
|
214
|
+
expect(EntityRuntimeKey in webAccessibilityBackend).toBe(true);
|
|
215
|
+
expect(webHost.accessibility.provider).toBe(webAccessibilityBackend);
|
|
216
|
+
});
|
|
217
|
+
});
|
package/src/webApp.test.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
import { describe, expect, it, vi } from 'vitest';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createWebAppCapabilities,
|
|
6
|
+
initializeWebAppBadgeBackend,
|
|
7
|
+
initializeWebAppCapabilities,
|
|
8
|
+
initializeWebAppFocusBackend,
|
|
9
|
+
initializeWebAppLocaleBackend,
|
|
10
|
+
initializeWebAppNameBackend,
|
|
11
|
+
initializeWebAppQuitBackend,
|
|
12
|
+
initializeWebAppReadyBackend,
|
|
13
|
+
initializeWebAppRelaunchBackend,
|
|
14
|
+
} from './webApp';
|
|
5
15
|
|
|
6
16
|
describe('createWebAppCapabilities', () => {
|
|
7
17
|
it('creates the exact genuine web app slots as Entities', () => {
|
|
@@ -29,3 +39,50 @@ describe('createWebAppCapabilities', () => {
|
|
|
29
39
|
expect(listener).not.toHaveBeenCalled();
|
|
30
40
|
});
|
|
31
41
|
});
|
|
42
|
+
describe('initializeWebAppBadgeBackend', () => {
|
|
43
|
+
it('is the construction initializer of createWebAppBadgeBackend', () => {
|
|
44
|
+
expect(typeof initializeWebAppBadgeBackend).toBe('function');
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
describe('initializeWebAppCapabilities', () => {
|
|
49
|
+
it('is the construction initializer of createWebAppCapabilities', () => {
|
|
50
|
+
expect(typeof initializeWebAppCapabilities).toBe('function');
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
describe('initializeWebAppFocusBackend', () => {
|
|
55
|
+
it('is the construction initializer of createWebAppFocusBackend', () => {
|
|
56
|
+
expect(typeof initializeWebAppFocusBackend).toBe('function');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
describe('initializeWebAppLocaleBackend', () => {
|
|
61
|
+
it('is the construction initializer of createWebAppLocaleBackend', () => {
|
|
62
|
+
expect(typeof initializeWebAppLocaleBackend).toBe('function');
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
describe('initializeWebAppNameBackend', () => {
|
|
67
|
+
it('is the construction initializer of createWebAppNameBackend', () => {
|
|
68
|
+
expect(typeof initializeWebAppNameBackend).toBe('function');
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
describe('initializeWebAppQuitBackend', () => {
|
|
73
|
+
it('is the construction initializer of createWebAppQuitBackend', () => {
|
|
74
|
+
expect(typeof initializeWebAppQuitBackend).toBe('function');
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
describe('initializeWebAppReadyBackend', () => {
|
|
79
|
+
it('is the construction initializer of createWebAppReadyBackend', () => {
|
|
80
|
+
expect(typeof initializeWebAppReadyBackend).toBe('function');
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
describe('initializeWebAppRelaunchBackend', () => {
|
|
85
|
+
it('is the construction initializer of createWebAppRelaunchBackend', () => {
|
|
86
|
+
expect(typeof initializeWebAppRelaunchBackend).toBe('function');
|
|
87
|
+
});
|
|
88
|
+
});
|
package/src/webAudio.test.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import { webAudioBackend } from './webAudio';
|
|
3
|
+
import { initializeWebAudioBackend, webAudioBackend } from './webAudio';
|
|
4
4
|
|
|
5
|
+
describe('initializeWebAudioBackend', () => {
|
|
6
|
+
it('is the construction initializer of createWebAudioBackend', () => {
|
|
7
|
+
expect(typeof initializeWebAudioBackend).toBe('function');
|
|
8
|
+
});
|
|
9
|
+
});
|
|
5
10
|
describe('webAudioBackend', () => {
|
|
6
11
|
it('is an AudioBackend entity', () => {
|
|
7
12
|
expect(Object.hasOwn(webAudioBackend, EntityRuntimeKey)).toBe(true);
|
|
@@ -3,7 +3,11 @@ import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
|
|
|
3
3
|
import type { Bitmap, HasGraphicsBitmapEncode } from '@flighthq/types/contract';
|
|
4
4
|
import { BitmapTextureSourceKind } from '@flighthq/types/contract';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
createWebBitmapEncodeBackend,
|
|
8
|
+
initializeWebBitmapEncodeBackend,
|
|
9
|
+
webBitmapEncodeBackend,
|
|
10
|
+
} from './webBitmapEncode';
|
|
7
11
|
|
|
8
12
|
function createTestBitmap(): Bitmap {
|
|
9
13
|
const out = allocateEntity<Bitmap>();
|
|
@@ -36,6 +40,11 @@ describe('createWebBitmapEncodeBackend', () => {
|
|
|
36
40
|
});
|
|
37
41
|
});
|
|
38
42
|
|
|
43
|
+
describe('initializeWebBitmapEncodeBackend', () => {
|
|
44
|
+
it('is the construction initializer of createWebBitmapEncodeBackend', () => {
|
|
45
|
+
expect(typeof initializeWebBitmapEncodeBackend).toBe('function');
|
|
46
|
+
});
|
|
47
|
+
});
|
|
39
48
|
describe('webBitmapEncodeBackend', () => {
|
|
40
49
|
it('does not allocate a canvas or ImageData at import time', () => {
|
|
41
50
|
const createElement = vi.spyOn(document, 'createElement');
|
|
@@ -3,7 +3,11 @@ import type { HasGraphicsBitmapReadback } from '@flighthq/types/contract';
|
|
|
3
3
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
4
4
|
import { vi } from 'vitest';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
createWebBitmapReadbackBackend,
|
|
8
|
+
initializeWebBitmapReadbackBackend,
|
|
9
|
+
webBitmapReadbackBackend,
|
|
10
|
+
} from './webBitmapReadback';
|
|
7
11
|
|
|
8
12
|
function hostWith(backend: HasGraphicsBitmapReadback['graphics']['bitmapReadback']): HasGraphicsBitmapReadback {
|
|
9
13
|
return { graphics: { bitmapReadback: backend } } as HasGraphicsBitmapReadback;
|
|
@@ -26,6 +30,11 @@ describe('createWebBitmapReadbackBackend', () => {
|
|
|
26
30
|
});
|
|
27
31
|
});
|
|
28
32
|
|
|
33
|
+
describe('initializeWebBitmapReadbackBackend', () => {
|
|
34
|
+
it('is the construction initializer of createWebBitmapReadbackBackend', () => {
|
|
35
|
+
expect(typeof initializeWebBitmapReadbackBackend).toBe('function');
|
|
36
|
+
});
|
|
37
|
+
});
|
|
29
38
|
describe('webBitmapReadbackBackend', () => {
|
|
30
39
|
const host = hostWith(webBitmapReadbackBackend);
|
|
31
40
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
createWebCanvasRenderSurfaceCreator,
|
|
5
|
+
initializeWebCanvasRenderSurfaceCreator,
|
|
6
|
+
webCanvasRenderSurfaceCreator,
|
|
7
|
+
} from './webCanvasRenderSurface';
|
|
4
8
|
|
|
5
9
|
describe('createWebCanvasRenderSurfaceCreator', () => {
|
|
6
10
|
it('creates a complete host Entity', () => {
|
|
@@ -32,6 +36,11 @@ describe('createWebCanvasRenderSurfaceCreator', () => {
|
|
|
32
36
|
});
|
|
33
37
|
});
|
|
34
38
|
|
|
39
|
+
describe('initializeWebCanvasRenderSurfaceCreator', () => {
|
|
40
|
+
it('is the construction initializer of createWebCanvasRenderSurfaceCreator', () => {
|
|
41
|
+
expect(typeof initializeWebCanvasRenderSurfaceCreator).toBe('function');
|
|
42
|
+
});
|
|
43
|
+
});
|
|
35
44
|
describe('webCanvasRenderSurfaceCreator', () => {
|
|
36
45
|
it('is the reusable web-host creator', () => {
|
|
37
46
|
expect(webCanvasRenderSurfaceCreator[EntityRuntimeKey]).toEqual({ binding: null });
|
package/src/webClipboard.test.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { ClipboardFormatText, EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import { webClipboardBackend } from './webClipboard';
|
|
3
|
+
import { initializeWebClipboardBackend, webClipboardBackend } from './webClipboard';
|
|
4
4
|
import { webHost } from './webHost';
|
|
5
5
|
|
|
6
6
|
afterEach(() => vi.unstubAllGlobals());
|
|
7
7
|
|
|
8
|
+
describe('initializeWebClipboardBackend', () => {
|
|
9
|
+
it('is the construction initializer of createWebClipboardBackend', () => {
|
|
10
|
+
expect(typeof initializeWebClipboardBackend).toBe('function');
|
|
11
|
+
});
|
|
12
|
+
});
|
|
8
13
|
describe('webClipboardBackend', () => {
|
|
9
14
|
it('is the exact provider for every web clipboard capability slot', () => {
|
|
10
15
|
expect(EntityRuntimeKey in webClipboardBackend).toBe(true);
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { ConnectivityStatus } from '@flighthq/types/contract';
|
|
2
2
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createWebConnectivityBackend,
|
|
6
|
+
initializeWebConnectivityBackend,
|
|
7
|
+
webConnectivityBackend,
|
|
8
|
+
} from './webConnectivity';
|
|
5
9
|
import { webHost } from './webHost';
|
|
6
10
|
|
|
7
11
|
afterEach(() => {
|
|
@@ -88,6 +92,11 @@ describe('createWebConnectivityBackend', () => {
|
|
|
88
92
|
});
|
|
89
93
|
});
|
|
90
94
|
|
|
95
|
+
describe('initializeWebConnectivityBackend', () => {
|
|
96
|
+
it('is the construction initializer of createWebConnectivityBackend', () => {
|
|
97
|
+
expect(typeof initializeWebConnectivityBackend).toBe('function');
|
|
98
|
+
});
|
|
99
|
+
});
|
|
91
100
|
describe('webHost connectivity', () => {
|
|
92
101
|
it('publishes stable status/change/reachability slots backed by one Entity', () => {
|
|
93
102
|
expect(webHost.connectivity).toEqual({
|
package/src/webCursor.test.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
import { describe, expect, it } from 'vitest';
|
|
3
3
|
|
|
4
|
-
import { createWebCursorBackend } from './webCursor';
|
|
4
|
+
import { createWebCursorBackend, initializeWebCursorBackend } from './webCursor';
|
|
5
5
|
|
|
6
6
|
describe('createWebCursorBackend', () => {
|
|
7
7
|
it('returns an Entity', () => {
|
|
@@ -30,3 +30,8 @@ describe('createWebCursorBackend', () => {
|
|
|
30
30
|
expect(element.style.cursor).toBe('');
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
|
+
describe('initializeWebCursorBackend', () => {
|
|
34
|
+
it('is the construction initializer of createWebCursorBackend', () => {
|
|
35
|
+
expect(typeof initializeWebCursorBackend).toBe('function');
|
|
36
|
+
});
|
|
37
|
+
});
|
package/src/webDevice.test.ts
CHANGED
|
@@ -6,7 +6,12 @@ import {
|
|
|
6
6
|
} from '@flighthq/device/contract';
|
|
7
7
|
import { DeviceFormFactorDesktop, DeviceFormFactorUnknown } from '@flighthq/types/contract';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
createWebDeviceBackend,
|
|
11
|
+
enableWebSafeAreaInsets,
|
|
12
|
+
initializeWebDeviceBackend,
|
|
13
|
+
webDeviceBackend,
|
|
14
|
+
} from './webDevice';
|
|
10
15
|
|
|
11
16
|
describe('createWebDeviceBackend', () => {
|
|
12
17
|
it('fills the snapshot with sentinels without throwing (jsdom)', () => {
|
|
@@ -107,6 +112,11 @@ describe('enableWebSafeAreaInsets', () => {
|
|
|
107
112
|
});
|
|
108
113
|
});
|
|
109
114
|
|
|
115
|
+
describe('initializeWebDeviceBackend', () => {
|
|
116
|
+
it('is the construction initializer of createWebDeviceBackend', () => {
|
|
117
|
+
expect(typeof initializeWebDeviceBackend).toBe('function');
|
|
118
|
+
});
|
|
119
|
+
});
|
|
110
120
|
describe('webDeviceBackend', () => {
|
|
111
121
|
it('is a pre-constructed singleton', () => {
|
|
112
122
|
expect(webDeviceBackend).toBeDefined();
|
package/src/webDialog.test.ts
CHANGED
|
@@ -2,6 +2,12 @@ import { getFileDialogHandleOperations } from '@flighthq/dialog/contract';
|
|
|
2
2
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
+
initializeWebDirectoryOpenDialogBackend,
|
|
6
|
+
initializeWebFileOpenDialogBackend,
|
|
7
|
+
initializeWebFileSaveDialogBackend,
|
|
8
|
+
initializeWebImageOpenDialogBackend,
|
|
9
|
+
initializeWebPhotoCaptureDialogBackend,
|
|
10
|
+
initializeWebVideoCaptureDialogBackend,
|
|
5
11
|
webDirectoryOpenDialogBackend,
|
|
6
12
|
webFileOpenDialogBackend,
|
|
7
13
|
webFileSaveDialogBackend,
|
|
@@ -28,6 +34,91 @@ describe('existing web message providers', () => {
|
|
|
28
34
|
});
|
|
29
35
|
});
|
|
30
36
|
|
|
37
|
+
describe('initializeWebDirectoryOpenDialogBackend', () => {
|
|
38
|
+
it('is the construction initializer of createWebDirectoryOpenDialogBackend', () => {
|
|
39
|
+
expect(typeof initializeWebDirectoryOpenDialogBackend).toBe('function');
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe('initializeWebFileOpenDialogBackend', () => {
|
|
44
|
+
it('is the construction initializer of createWebFileOpenDialogBackend', () => {
|
|
45
|
+
expect(typeof initializeWebFileOpenDialogBackend).toBe('function');
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
describe('initializeWebFileSaveDialogBackend', () => {
|
|
50
|
+
it('is the construction initializer of createWebFileSaveDialogBackend', () => {
|
|
51
|
+
expect(typeof initializeWebFileSaveDialogBackend).toBe('function');
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
describe('initializeWebImageOpenDialogBackend', () => {
|
|
56
|
+
it('is the construction initializer of createWebImageOpenDialogBackend', () => {
|
|
57
|
+
expect(typeof initializeWebImageOpenDialogBackend).toBe('function');
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
describe('initializeWebPhotoCaptureDialogBackend', () => {
|
|
62
|
+
it('is the construction initializer of createWebPhotoCaptureDialogBackend', () => {
|
|
63
|
+
expect(typeof initializeWebPhotoCaptureDialogBackend).toBe('function');
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
describe('initializeWebVideoCaptureDialogBackend', () => {
|
|
68
|
+
it('is the construction initializer of createWebVideoCaptureDialogBackend', () => {
|
|
69
|
+
expect(typeof initializeWebVideoCaptureDialogBackend).toBe('function');
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
function mockImagePicker(width: number, height: number): { input: HTMLInputElement } {
|
|
74
|
+
const input = document.createElement('input');
|
|
75
|
+
const createElement = document.createElement.bind(document);
|
|
76
|
+
Object.defineProperty(input, 'files', {
|
|
77
|
+
configurable: true,
|
|
78
|
+
value: [new File(['image'], 'photo.png', { type: 'image/png' })],
|
|
79
|
+
});
|
|
80
|
+
class LoadedImage {
|
|
81
|
+
naturalHeight = height;
|
|
82
|
+
naturalWidth = width;
|
|
83
|
+
onerror: (() => void) | null = null;
|
|
84
|
+
onload: (() => void) | null = null;
|
|
85
|
+
|
|
86
|
+
set src(_value: string) {
|
|
87
|
+
queueMicrotask(() => this.onload?.());
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
vi.spyOn(document, 'createElement').mockImplementation(((tag: string) => {
|
|
91
|
+
if (tag === 'input') return input;
|
|
92
|
+
if (tag === 'img') return new LoadedImage();
|
|
93
|
+
return createElement(tag);
|
|
94
|
+
}) as typeof document.createElement);
|
|
95
|
+
return { input };
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function fileSystemHandle(
|
|
99
|
+
name: string,
|
|
100
|
+
text: string,
|
|
101
|
+
writable?: { abort?(reason?: unknown): Promise<void>; close(): Promise<void>; write(data: unknown): Promise<void> },
|
|
102
|
+
) {
|
|
103
|
+
return {
|
|
104
|
+
kind: 'file' as const,
|
|
105
|
+
name,
|
|
106
|
+
async createWritable() {
|
|
107
|
+
if (writable === undefined) throw new Error('not writable');
|
|
108
|
+
return writable;
|
|
109
|
+
},
|
|
110
|
+
async getFile() {
|
|
111
|
+
return {
|
|
112
|
+
async arrayBuffer() {
|
|
113
|
+
return new TextEncoder().encode(text).buffer;
|
|
114
|
+
},
|
|
115
|
+
async text() {
|
|
116
|
+
return text;
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
31
122
|
describe('webDirectoryOpenDialogBackend', () => {
|
|
32
123
|
it('is an Entity installed in the independent directory-open slot', () => {
|
|
33
124
|
expect(EntityRuntimeKey in webDirectoryOpenDialogBackend).toBe(true);
|
|
@@ -316,53 +407,3 @@ describe('webVideoCaptureDialogBackend', () => {
|
|
|
316
407
|
});
|
|
317
408
|
});
|
|
318
409
|
});
|
|
319
|
-
|
|
320
|
-
function mockImagePicker(width: number, height: number): { input: HTMLInputElement } {
|
|
321
|
-
const input = document.createElement('input');
|
|
322
|
-
const createElement = document.createElement.bind(document);
|
|
323
|
-
Object.defineProperty(input, 'files', {
|
|
324
|
-
configurable: true,
|
|
325
|
-
value: [new File(['image'], 'photo.png', { type: 'image/png' })],
|
|
326
|
-
});
|
|
327
|
-
class LoadedImage {
|
|
328
|
-
naturalHeight = height;
|
|
329
|
-
naturalWidth = width;
|
|
330
|
-
onerror: (() => void) | null = null;
|
|
331
|
-
onload: (() => void) | null = null;
|
|
332
|
-
|
|
333
|
-
set src(_value: string) {
|
|
334
|
-
queueMicrotask(() => this.onload?.());
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
vi.spyOn(document, 'createElement').mockImplementation(((tag: string) => {
|
|
338
|
-
if (tag === 'input') return input;
|
|
339
|
-
if (tag === 'img') return new LoadedImage();
|
|
340
|
-
return createElement(tag);
|
|
341
|
-
}) as typeof document.createElement);
|
|
342
|
-
return { input };
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
function fileSystemHandle(
|
|
346
|
-
name: string,
|
|
347
|
-
text: string,
|
|
348
|
-
writable?: { abort?(reason?: unknown): Promise<void>; close(): Promise<void>; write(data: unknown): Promise<void> },
|
|
349
|
-
) {
|
|
350
|
-
return {
|
|
351
|
-
kind: 'file' as const,
|
|
352
|
-
name,
|
|
353
|
-
async createWritable() {
|
|
354
|
-
if (writable === undefined) throw new Error('not writable');
|
|
355
|
-
return writable;
|
|
356
|
-
},
|
|
357
|
-
async getFile() {
|
|
358
|
-
return {
|
|
359
|
-
async arrayBuffer() {
|
|
360
|
-
return new TextEncoder().encode(text).buffer;
|
|
361
|
-
},
|
|
362
|
-
async text() {
|
|
363
|
-
return text;
|
|
364
|
-
},
|
|
365
|
-
};
|
|
366
|
-
},
|
|
367
|
-
};
|
|
368
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import { createWebFontLoadingBackend, webFontLoadingBackend } from './webFontLoading';
|
|
3
|
+
import { createWebFontLoadingBackend, initializeWebFontLoadingBackend, webFontLoadingBackend } from './webFontLoading';
|
|
4
4
|
|
|
5
5
|
describe('createWebFontLoadingBackend', () => {
|
|
6
6
|
it('returns an Entity', () => {
|
|
@@ -20,6 +20,11 @@ describe('createWebFontLoadingBackend', () => {
|
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
+
describe('initializeWebFontLoadingBackend', () => {
|
|
24
|
+
it('is the construction initializer of createWebFontLoadingBackend', () => {
|
|
25
|
+
expect(typeof initializeWebFontLoadingBackend).toBe('function');
|
|
26
|
+
});
|
|
27
|
+
});
|
|
23
28
|
describe('webFontLoadingBackend', () => {
|
|
24
29
|
it('is an Entity with all four operations', () => {
|
|
25
30
|
expect(EntityRuntimeKey in webFontLoadingBackend).toBe(true);
|
|
@@ -3,6 +3,7 @@ import * as renderGlContract from '@flighthq/render-gl/contract';
|
|
|
3
3
|
import {
|
|
4
4
|
createWebGlRenderSurfaceProvider,
|
|
5
5
|
enableHostWebGlRenderSurface,
|
|
6
|
+
initializeWebGlRenderSurfaceProvider,
|
|
6
7
|
resetHostWebGlRenderSurfaceForTest,
|
|
7
8
|
} from './webGlRenderSurface';
|
|
8
9
|
|
|
@@ -74,6 +75,11 @@ describe('enableHostWebGlRenderSurface', () => {
|
|
|
74
75
|
});
|
|
75
76
|
});
|
|
76
77
|
|
|
78
|
+
describe('initializeWebGlRenderSurfaceProvider', () => {
|
|
79
|
+
it('is the construction initializer of createWebGlRenderSurfaceProvider', () => {
|
|
80
|
+
expect(typeof initializeWebGlRenderSurfaceProvider).toBe('function');
|
|
81
|
+
});
|
|
82
|
+
});
|
|
77
83
|
describe('resetHostWebGlRenderSurfaceForTest', () => {
|
|
78
84
|
afterEach(() => {
|
|
79
85
|
resetHostWebGlRenderSurfaceForTest();
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
import { describe, expect, it } from 'vitest';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createWebGlyphRasterizerBackend,
|
|
6
|
+
initializeWebGlyphRasterizerBackend,
|
|
7
|
+
webGlyphRasterizerBackend,
|
|
8
|
+
} from './webGlyphRasterizer';
|
|
5
9
|
|
|
6
10
|
describe('createWebGlyphRasterizerBackend', () => {
|
|
7
11
|
it('constructs a backend with rasterize and measureMetrics', () => {
|
|
@@ -41,6 +45,11 @@ describe('createWebGlyphRasterizerBackend', () => {
|
|
|
41
45
|
});
|
|
42
46
|
});
|
|
43
47
|
|
|
48
|
+
describe('initializeWebGlyphRasterizerBackend', () => {
|
|
49
|
+
it('is the construction initializer of createWebGlyphRasterizerBackend', () => {
|
|
50
|
+
expect(typeof initializeWebGlyphRasterizerBackend).toBe('function');
|
|
51
|
+
});
|
|
52
|
+
});
|
|
44
53
|
describe('webGlyphRasterizerBackend', () => {
|
|
45
54
|
it('is an Entity with rasterize and measureMetrics', () => {
|
|
46
55
|
expect(EntityRuntimeKey in webGlyphRasterizerBackend).toBe(true);
|
package/src/webHaptics.test.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { webHapticsBackend } from './webHaptics';
|
|
1
|
+
import { initializeWebHapticsBackend, webHapticsBackend } from './webHaptics';
|
|
2
2
|
|
|
3
|
+
describe('initializeWebHapticsBackend', () => {
|
|
4
|
+
it('is the construction initializer of createWebHapticsBackend', () => {
|
|
5
|
+
expect(typeof initializeWebHapticsBackend).toBe('function');
|
|
6
|
+
});
|
|
7
|
+
});
|
|
3
8
|
describe('webHapticsBackend', () => {
|
|
4
9
|
it('reports unsupported and refuses every operation when navigator.vibrate is absent', () => {
|
|
5
10
|
// jsdom has no Vibration API, which is the branch every desktop browser also takes. The backend must
|
package/src/webImage.test.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Bitmap, HasGraphicsImage } from '@flighthq/types/contract';
|
|
2
2
|
import { BitmapTextureSourceKind } from '@flighthq/types/contract';
|
|
3
3
|
|
|
4
|
-
import { createWebImageBackend, webImageBackend } from './webImage';
|
|
4
|
+
import { createWebImageBackend, initializeWebImageBackend, webImageBackend } from './webImage';
|
|
5
5
|
|
|
6
6
|
function hostWith(backend = webImageBackend): HasGraphicsImage {
|
|
7
7
|
return { graphics: { image: backend } } as HasGraphicsImage;
|
|
@@ -17,6 +17,24 @@ describe('createWebImageBackend', () => {
|
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
describe('initializeWebImageBackend', () => {
|
|
21
|
+
it('is the construction initializer of createWebImageBackend', () => {
|
|
22
|
+
expect(typeof initializeWebImageBackend).toBe('function');
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
function createTestBitmap(): Bitmap {
|
|
27
|
+
return {
|
|
28
|
+
alphaType: 'straight',
|
|
29
|
+
gamut: 'srgb',
|
|
30
|
+
data: new Uint8ClampedArray(4),
|
|
31
|
+
format: 'rgba8unorm',
|
|
32
|
+
height: 1,
|
|
33
|
+
kind: BitmapTextureSourceKind,
|
|
34
|
+
version: 0,
|
|
35
|
+
width: 1,
|
|
36
|
+
} as Bitmap;
|
|
37
|
+
}
|
|
20
38
|
describe('webImageBackend', () => {
|
|
21
39
|
afterEach(() => {
|
|
22
40
|
vi.restoreAllMocks();
|
|
@@ -33,16 +51,3 @@ describe('webImageBackend', () => {
|
|
|
33
51
|
expect(webImageBackend.createImageFromBitmap).toBeDefined();
|
|
34
52
|
});
|
|
35
53
|
});
|
|
36
|
-
|
|
37
|
-
function createTestBitmap(): Bitmap {
|
|
38
|
-
return {
|
|
39
|
-
alphaType: 'straight',
|
|
40
|
-
gamut: 'srgb',
|
|
41
|
-
data: new Uint8ClampedArray(4),
|
|
42
|
-
format: 'rgba8unorm',
|
|
43
|
-
height: 1,
|
|
44
|
-
kind: BitmapTextureSourceKind,
|
|
45
|
-
version: 0,
|
|
46
|
-
width: 1,
|
|
47
|
-
} as Bitmap;
|
|
48
|
-
}
|
|
@@ -6,6 +6,7 @@ import type { EntityWithoutRuntime, HasInputPointerLock, InputPointerLockBackend
|
|
|
6
6
|
import { webHost } from './webHost';
|
|
7
7
|
import {
|
|
8
8
|
createWebInputTargetHandle,
|
|
9
|
+
initializeWebInputTargetHandle,
|
|
9
10
|
resetWebInputTargetBackendForTest,
|
|
10
11
|
webInputDropFileBackend,
|
|
11
12
|
webInputFocusBackend,
|
|
@@ -34,6 +35,12 @@ describe('createWebInputTargetHandle', () => {
|
|
|
34
35
|
});
|
|
35
36
|
});
|
|
36
37
|
|
|
38
|
+
describe('initializeWebInputTargetHandle', () => {
|
|
39
|
+
it('is the construction initializer of createWebInputTargetHandle', () => {
|
|
40
|
+
expect(typeof initializeWebInputTargetHandle).toBe('function');
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
37
44
|
describe('resetWebInputTargetBackendForTest', () => {
|
|
38
45
|
it('forgets existing target bindings', () => {
|
|
39
46
|
const element = document.createElement('div');
|
|
@@ -414,7 +421,6 @@ describe('webRenderContextBackend', () => {
|
|
|
414
421
|
expect(listener).not.toHaveBeenCalled();
|
|
415
422
|
});
|
|
416
423
|
});
|
|
417
|
-
|
|
418
424
|
describe('webRenderSurfaceBackend', () => {
|
|
419
425
|
it('sizes a bound canvas backing store and leaves a non-canvas target inert', () => {
|
|
420
426
|
const canvas = document.createElement('canvas');
|
package/src/webKeyboard.test.ts
CHANGED
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
createWebSoftKeyboardChangeBackend,
|
|
5
5
|
createWebSoftKeyboardInfoBackend,
|
|
6
6
|
createWebSoftKeyboardVisibilityBackend,
|
|
7
|
+
initializeWebSoftKeyboardChangeBackend,
|
|
8
|
+
initializeWebSoftKeyboardInfoBackend,
|
|
9
|
+
initializeWebSoftKeyboardVisibilityBackend,
|
|
7
10
|
} from './webKeyboard';
|
|
8
11
|
|
|
9
12
|
type VirtualKeyboardStub = {
|
|
@@ -214,3 +217,20 @@ describe('createWebSoftKeyboardVisibilityBackend', () => {
|
|
|
214
217
|
expect(await backend.hide()).toBe('operation-failed');
|
|
215
218
|
});
|
|
216
219
|
});
|
|
220
|
+
describe('initializeWebSoftKeyboardChangeBackend', () => {
|
|
221
|
+
it('is the construction initializer of createWebSoftKeyboardChangeBackend', () => {
|
|
222
|
+
expect(typeof initializeWebSoftKeyboardChangeBackend).toBe('function');
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
describe('initializeWebSoftKeyboardInfoBackend', () => {
|
|
227
|
+
it('is the construction initializer of createWebSoftKeyboardInfoBackend', () => {
|
|
228
|
+
expect(typeof initializeWebSoftKeyboardInfoBackend).toBe('function');
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
describe('initializeWebSoftKeyboardVisibilityBackend', () => {
|
|
233
|
+
it('is the construction initializer of createWebSoftKeyboardVisibilityBackend', () => {
|
|
234
|
+
expect(typeof initializeWebSoftKeyboardVisibilityBackend).toBe('function');
|
|
235
|
+
});
|
|
236
|
+
});
|
|
@@ -6,6 +6,8 @@ import { webHost } from './webHost';
|
|
|
6
6
|
import {
|
|
7
7
|
createWebMediaSessionActionBackend,
|
|
8
8
|
createWebMediaSessionBackend,
|
|
9
|
+
initializeWebMediaSessionActionBackend,
|
|
10
|
+
initializeWebMediaSessionBackend,
|
|
9
11
|
webMediaSessionActionBackend,
|
|
10
12
|
webMediaSessionBackend,
|
|
11
13
|
} from './webMediasession';
|
|
@@ -278,6 +280,17 @@ describe('createWebMediaSessionBackend', () => {
|
|
|
278
280
|
});
|
|
279
281
|
});
|
|
280
282
|
|
|
283
|
+
describe('initializeWebMediaSessionActionBackend', () => {
|
|
284
|
+
it('is the construction initializer of createWebMediaSessionActionBackend', () => {
|
|
285
|
+
expect(typeof initializeWebMediaSessionActionBackend).toBe('function');
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
describe('initializeWebMediaSessionBackend', () => {
|
|
290
|
+
it('is the construction initializer of createWebMediaSessionBackend', () => {
|
|
291
|
+
expect(typeof initializeWebMediaSessionBackend).toBe('function');
|
|
292
|
+
});
|
|
293
|
+
});
|
|
281
294
|
describe('web media-session command ownership', () => {
|
|
282
295
|
it('releases only lanes it published and never touches action handlers', () => {
|
|
283
296
|
const session = installFakeMediaSession();
|
package/src/webMenu.test.ts
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
initializeWebMenuHighlightBackend,
|
|
5
|
+
initializeWebMenuPopupBackend,
|
|
6
|
+
webMenuHighlightBackend,
|
|
7
|
+
webMenuPopupBackend,
|
|
8
|
+
} from './webMenu';
|
|
9
|
+
|
|
10
|
+
describe('initializeWebMenuHighlightBackend', () => {
|
|
11
|
+
it('is the construction initializer of createWebMenuHighlightBackend', () => {
|
|
12
|
+
expect(typeof initializeWebMenuHighlightBackend).toBe('function');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
describe('initializeWebMenuPopupBackend', () => {
|
|
17
|
+
it('is the construction initializer of createWebMenuPopupBackend', () => {
|
|
18
|
+
expect(typeof initializeWebMenuPopupBackend).toBe('function');
|
|
19
|
+
});
|
|
20
|
+
});
|
|
4
21
|
|
|
5
22
|
describe('webMenuHighlightBackend', () => {
|
|
6
23
|
it('is an Entity provider', () => {
|
|
@@ -27,7 +44,6 @@ describe('webMenuHighlightBackend', () => {
|
|
|
27
44
|
expect(() => unsubscribeSecond()).not.toThrow();
|
|
28
45
|
});
|
|
29
46
|
});
|
|
30
|
-
|
|
31
47
|
describe('webMenuPopupBackend', () => {
|
|
32
48
|
it('is an Entity provider', () => {
|
|
33
49
|
expect(EntityRuntimeKey in webMenuPopupBackend).toBe(true);
|
package/src/webMidi.test.ts
CHANGED
|
@@ -5,6 +5,13 @@ import { describe, expect, it, vi } from 'vitest';
|
|
|
5
5
|
|
|
6
6
|
import { webHost } from './webHost';
|
|
7
7
|
import * as webMidi from './webMidi';
|
|
8
|
+
import {
|
|
9
|
+
initializeWebMidiAccessBackend,
|
|
10
|
+
initializeWebMidiAccessCapabilities,
|
|
11
|
+
initializeWebMidiEventAttachment,
|
|
12
|
+
initializeWebMidiPermissionAccessCapabilities,
|
|
13
|
+
initializeWebMidiPermissionBackend,
|
|
14
|
+
} from './webMidi';
|
|
8
15
|
|
|
9
16
|
describe('createWebMidiAccessCapabilities', () => {
|
|
10
17
|
it('constructs only the access profile and requests basic MIDI with zero options', async () => {
|
|
@@ -120,9 +127,9 @@ describe('createWebMidiPermissionAccessCapabilities', () => {
|
|
|
120
127
|
});
|
|
121
128
|
});
|
|
122
129
|
|
|
123
|
-
describe('
|
|
124
|
-
it('is
|
|
125
|
-
expect(
|
|
130
|
+
describe('initializeWebMidiAccessBackend', () => {
|
|
131
|
+
it('is the construction initializer of createWebMidiAccessBackend', () => {
|
|
132
|
+
expect(typeof initializeWebMidiAccessBackend).toBe('function');
|
|
126
133
|
});
|
|
127
134
|
});
|
|
128
135
|
|
|
@@ -226,3 +233,32 @@ function requiredWebFunction(name: string): (...args: any[]) => any {
|
|
|
226
233
|
if (typeof value !== 'function') throw new TypeError(`${name} is not exported`);
|
|
227
234
|
return value as (...args: any[]) => any;
|
|
228
235
|
}
|
|
236
|
+
describe('initializeWebMidiAccessCapabilities', () => {
|
|
237
|
+
it('is the construction initializer of createWebMidiAccessCapabilities', () => {
|
|
238
|
+
expect(typeof initializeWebMidiAccessCapabilities).toBe('function');
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
describe('initializeWebMidiEventAttachment', () => {
|
|
243
|
+
it('is the construction initializer of createWebMidiEventAttachment', () => {
|
|
244
|
+
expect(typeof initializeWebMidiEventAttachment).toBe('function');
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
describe('initializeWebMidiPermissionAccessCapabilities', () => {
|
|
249
|
+
it('is the construction initializer of createWebMidiPermissionAccessCapabilities', () => {
|
|
250
|
+
expect(typeof initializeWebMidiPermissionAccessCapabilities).toBe('function');
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
describe('initializeWebMidiPermissionBackend', () => {
|
|
255
|
+
it('is the construction initializer of createWebMidiPermissionBackend', () => {
|
|
256
|
+
expect(typeof initializeWebMidiPermissionBackend).toBe('function');
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
describe('webHost midi', () => {
|
|
261
|
+
it('is structurally empty and cannot acquire hardware in default construction', () => {
|
|
262
|
+
expect((webHost as unknown as { midi: object }).midi).toEqual({});
|
|
263
|
+
});
|
|
264
|
+
});
|
package/src/webNet.test.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSignal } from '@flighthq/signals/contract';
|
|
2
2
|
import type { NetProgress, NetRequest } from '@flighthq/types/contract';
|
|
3
3
|
|
|
4
|
-
import { createWebNetBackend, webNetBackend } from './webNet';
|
|
4
|
+
import { createWebNetBackend, initializeWebNetBackend, webNetBackend } from './webNet';
|
|
5
5
|
|
|
6
6
|
interface FakeResponseInit {
|
|
7
7
|
status?: number;
|
|
@@ -276,6 +276,11 @@ describe('createWebNetBackend', () => {
|
|
|
276
276
|
});
|
|
277
277
|
});
|
|
278
278
|
|
|
279
|
+
describe('initializeWebNetBackend', () => {
|
|
280
|
+
it('is the construction initializer of createWebNetBackend', () => {
|
|
281
|
+
expect(typeof initializeWebNetBackend).toBe('function');
|
|
282
|
+
});
|
|
283
|
+
});
|
|
279
284
|
describe('webNetBackend', () => {
|
|
280
285
|
it('is a pre-instantiated NetBackend const', () => {
|
|
281
286
|
expect(webNetBackend).not.toBeNull();
|
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
WebPageNotificationInstance,
|
|
8
8
|
} from '@flighthq/types/contract';
|
|
9
9
|
|
|
10
|
-
import { createWebPageNotificationCapabilities } from './webNotification';
|
|
10
|
+
import { createWebPageNotificationCapabilities, initializeWebPageNotificationCapabilities } from './webNotification';
|
|
11
11
|
|
|
12
12
|
interface FakeWebNotification extends WebPageNotificationInstance {
|
|
13
13
|
options?: Readonly<WebNotificationOptions>;
|
|
@@ -108,3 +108,8 @@ describe('createWebPageNotificationCapabilities', () => {
|
|
|
108
108
|
expect(secondCloses).toBe(2);
|
|
109
109
|
});
|
|
110
110
|
});
|
|
111
|
+
describe('initializeWebPageNotificationCapabilities', () => {
|
|
112
|
+
it('is the construction initializer of createWebPageNotificationCapabilities', () => {
|
|
113
|
+
expect(typeof initializeWebPageNotificationCapabilities).toBe('function');
|
|
114
|
+
});
|
|
115
|
+
});
|
package/src/webPlatform.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createPlatformInfo } from '@flighthq/platform/contract';
|
|
2
2
|
|
|
3
|
-
import { createWebPlatformBackend, webPlatformBackend } from './webPlatform';
|
|
3
|
+
import { createWebPlatformBackend, initializeWebPlatformBackend, webPlatformBackend } from './webPlatform';
|
|
4
4
|
|
|
5
5
|
describe('createWebPlatformBackend', () => {
|
|
6
6
|
it('produces a backend that fills the out info', () => {
|
|
@@ -55,6 +55,12 @@ describe('createWebPlatformBackend', () => {
|
|
|
55
55
|
});
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
+
describe('initializeWebPlatformBackend', () => {
|
|
59
|
+
it('is the construction initializer of createWebPlatformBackend', () => {
|
|
60
|
+
expect(typeof initializeWebPlatformBackend).toBe('function');
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
58
64
|
describe('web backend UA detection', () => {
|
|
59
65
|
function withUserAgent(ua: string, fn: () => void): void {
|
|
60
66
|
const original = navigator.userAgent;
|
|
@@ -300,7 +306,6 @@ describe('web backend UA detection', () => {
|
|
|
300
306
|
});
|
|
301
307
|
});
|
|
302
308
|
});
|
|
303
|
-
|
|
304
309
|
describe('webPlatformBackend', () => {
|
|
305
310
|
it('is a pre-constructed singleton', () => {
|
|
306
311
|
expect(webPlatformBackend).toBeDefined();
|
package/src/webPower.test.ts
CHANGED
|
@@ -2,6 +2,10 @@ import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
createWebPowerReadings,
|
|
5
|
+
initializeWebPowerCapabilities,
|
|
6
|
+
initializeWebPowerKeepAwakeBackend,
|
|
7
|
+
initializeWebPowerReadings,
|
|
8
|
+
initializeWebPowerSuspensionBackend,
|
|
5
9
|
webPowerCapabilities,
|
|
6
10
|
webPowerKeepAwakeBackend,
|
|
7
11
|
webPowerSuspensionBackend,
|
|
@@ -76,6 +80,29 @@ describe('createWebPowerReadings status', () => {
|
|
|
76
80
|
});
|
|
77
81
|
});
|
|
78
82
|
|
|
83
|
+
describe('initializeWebPowerCapabilities', () => {
|
|
84
|
+
it('is the construction initializer of createWebPowerCapabilities', () => {
|
|
85
|
+
expect(typeof initializeWebPowerCapabilities).toBe('function');
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe('initializeWebPowerKeepAwakeBackend', () => {
|
|
90
|
+
it('is the construction initializer of createWebPowerKeepAwakeBackend', () => {
|
|
91
|
+
expect(typeof initializeWebPowerKeepAwakeBackend).toBe('function');
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
describe('initializeWebPowerReadings', () => {
|
|
96
|
+
it('is the construction initializer of createWebPowerReadings', () => {
|
|
97
|
+
expect(typeof initializeWebPowerReadings).toBe('function');
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
describe('initializeWebPowerSuspensionBackend', () => {
|
|
101
|
+
it('is the construction initializer of createWebPowerSuspensionBackend', () => {
|
|
102
|
+
expect(typeof initializeWebPowerSuspensionBackend).toBe('function');
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
79
106
|
describe('webPowerCapabilities', () => {
|
|
80
107
|
// ★ EXACT SLOT COVERAGE for W. The four absent slots are the point: web previously implemented all of
|
|
81
108
|
// them with inert subscriptions and constant sentinels, which no structural probe could tell from a
|
package/src/webProtocol.test.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
import { describe, expect, it, vi } from 'vitest';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createWebProtocolCapabilities,
|
|
6
|
+
initializeWebProtocolCapabilities,
|
|
7
|
+
initializeWebProtocolLaunchBackend,
|
|
8
|
+
initializeWebProtocolRegistrationBackend,
|
|
9
|
+
} from './webProtocol';
|
|
5
10
|
|
|
6
11
|
describe('createWebProtocolCapabilities', () => {
|
|
7
12
|
it('creates only launch and registration as Entities', () => {
|
|
@@ -21,3 +26,20 @@ describe('createWebProtocolCapabilities', () => {
|
|
|
21
26
|
expect(registerProtocolHandler).toHaveBeenCalledExactlyOnceWith('flight', location.origin + '/?url=%s');
|
|
22
27
|
});
|
|
23
28
|
});
|
|
29
|
+
describe('initializeWebProtocolCapabilities', () => {
|
|
30
|
+
it('is the construction initializer of createWebProtocolCapabilities', () => {
|
|
31
|
+
expect(typeof initializeWebProtocolCapabilities).toBe('function');
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
describe('initializeWebProtocolLaunchBackend', () => {
|
|
36
|
+
it('is the construction initializer of createWebProtocolLaunchBackend', () => {
|
|
37
|
+
expect(typeof initializeWebProtocolLaunchBackend).toBe('function');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe('initializeWebProtocolRegistrationBackend', () => {
|
|
42
|
+
it('is the construction initializer of createWebProtocolRegistrationBackend', () => {
|
|
43
|
+
expect(typeof initializeWebProtocolRegistrationBackend).toBe('function');
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
createWebRaster2DSurfaceProvider,
|
|
5
|
+
initializeWebRaster2DSurfaceProvider,
|
|
6
|
+
webRaster2DSurfaceProvider,
|
|
7
|
+
} from './webRaster2DSurface';
|
|
4
8
|
|
|
5
9
|
describe('createWebRaster2DSurfaceProvider', () => {
|
|
6
10
|
it('returns an Entity', () => {
|
|
@@ -45,6 +49,11 @@ describe('createWebRaster2DSurfaceProvider', () => {
|
|
|
45
49
|
});
|
|
46
50
|
});
|
|
47
51
|
|
|
52
|
+
describe('initializeWebRaster2DSurfaceProvider', () => {
|
|
53
|
+
it('is the construction initializer of createWebRaster2DSurfaceProvider', () => {
|
|
54
|
+
expect(typeof initializeWebRaster2DSurfaceProvider).toBe('function');
|
|
55
|
+
});
|
|
56
|
+
});
|
|
48
57
|
describe('webRaster2DSurfaceProvider', () => {
|
|
49
58
|
it('is an Entity', () => {
|
|
50
59
|
expect(EntityRuntimeKey in webRaster2DSurfaceProvider).toBe(true);
|
package/src/webScreen.test.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { createScreenInfo } from '@flighthq/screen/contract';
|
|
|
2
2
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
3
3
|
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
4
4
|
|
|
5
|
-
import { createWebScreenCapabilities } from './webScreen';
|
|
5
|
+
import { createWebScreenCapabilities, initializeWebScreenCapabilities } from './webScreen';
|
|
6
6
|
|
|
7
7
|
afterEach(() => vi.restoreAllMocks());
|
|
8
8
|
|
|
@@ -63,3 +63,8 @@ describe('createWebScreenCapabilities', () => {
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
|
+
describe('initializeWebScreenCapabilities', () => {
|
|
67
|
+
it('is the construction initializer of createWebScreenCapabilities', () => {
|
|
68
|
+
expect(typeof initializeWebScreenCapabilities).toBe('function');
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
11
|
createWebServiceWorkerNotificationCapabilities,
|
|
12
|
+
initializeWebServiceWorkerNotificationCapabilities,
|
|
12
13
|
notifyWebServiceWorkerNotificationEvent,
|
|
13
14
|
} from './webServiceWorkerNotification';
|
|
14
15
|
|
|
@@ -112,6 +113,11 @@ describe('createWebServiceWorkerNotificationCapabilities', () => {
|
|
|
112
113
|
});
|
|
113
114
|
});
|
|
114
115
|
|
|
116
|
+
describe('initializeWebServiceWorkerNotificationCapabilities', () => {
|
|
117
|
+
it('is the construction initializer of createWebServiceWorkerNotificationCapabilities', () => {
|
|
118
|
+
expect(typeof initializeWebServiceWorkerNotificationCapabilities).toBe('function');
|
|
119
|
+
});
|
|
120
|
+
});
|
|
115
121
|
describe('notifyWebServiceWorkerNotificationEvent', () => {
|
|
116
122
|
it('routes real action/click/close events without fabricating reply', async () => {
|
|
117
123
|
const { api } = fakeServiceWorker();
|
package/src/webShare.test.ts
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
3
|
import { webHost } from './webHost';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
initializeWebShareContentBackend,
|
|
6
|
+
initializeWebShareFilesBackend,
|
|
7
|
+
webShareContentBackend,
|
|
8
|
+
webShareFilesBackend,
|
|
9
|
+
} from './webShare';
|
|
5
10
|
|
|
6
11
|
afterEach(() => vi.unstubAllGlobals());
|
|
7
12
|
|
|
13
|
+
describe('initializeWebShareContentBackend', () => {
|
|
14
|
+
it('is the construction initializer of createWebShareContentBackend', () => {
|
|
15
|
+
expect(typeof initializeWebShareContentBackend).toBe('function');
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
describe('initializeWebShareFilesBackend', () => {
|
|
19
|
+
it('is the construction initializer of createWebShareFilesBackend', () => {
|
|
20
|
+
expect(typeof initializeWebShareFilesBackend).toBe('function');
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
8
24
|
describe('Web Share providers', () => {
|
|
9
25
|
it('are Entity-composed and exposed through their honest host slots', () => {
|
|
10
26
|
expect(EntityRuntimeKey in webShareContentBackend).toBe(true);
|
package/src/webShell.test.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
|
-
import { webShellExternalBackend } from './webShell';
|
|
3
|
+
import { initializeWebShellExternalBackend, webShellExternalBackend } from './webShell';
|
|
4
4
|
|
|
5
5
|
afterEach(() => vi.unstubAllGlobals());
|
|
6
6
|
|
|
7
|
+
describe('initializeWebShellExternalBackend', () => {
|
|
8
|
+
it('is the construction initializer of createWebShellExternalBackend', () => {
|
|
9
|
+
expect(typeof initializeWebShellExternalBackend).toBe('function');
|
|
10
|
+
});
|
|
11
|
+
});
|
|
7
12
|
describe('webShellExternalBackend', () => {
|
|
8
13
|
it('is a stable Entity', () => {
|
|
9
14
|
expect(EntityRuntimeKey in webShellExternalBackend).toBe(true);
|
package/src/webStorage.test.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
2
2
|
|
|
3
3
|
import { webHost } from './webHost';
|
|
4
|
-
import { webStorageBackend } from './webStorage';
|
|
4
|
+
import { initializeWebStorageBackend, webStorageBackend } from './webStorage';
|
|
5
5
|
|
|
6
6
|
function namedError(name: string): Error {
|
|
7
7
|
const error = new Error(name);
|
|
@@ -9,6 +9,11 @@ function namedError(name: string): Error {
|
|
|
9
9
|
return error;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
describe('initializeWebStorageBackend', () => {
|
|
13
|
+
it('is the construction initializer of createWebStorageBackend', () => {
|
|
14
|
+
expect(typeof initializeWebStorageBackend).toBe('function');
|
|
15
|
+
});
|
|
16
|
+
});
|
|
12
17
|
describe('webStorageBackend', () => {
|
|
13
18
|
beforeEach(() => localStorage.clear());
|
|
14
19
|
afterEach(() => vi.restoreAllMocks());
|
|
@@ -8,6 +8,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
|
8
8
|
import {
|
|
9
9
|
createWebWindowStoragePersistenceCapabilities,
|
|
10
10
|
createWebWorkerStoragePersistenceCapabilities,
|
|
11
|
+
initializeWebWorkerStoragePersistenceCapabilities,
|
|
11
12
|
} from './webStoragePersistence';
|
|
12
13
|
|
|
13
14
|
describe('createWebWindowStoragePersistenceCapabilities', () => {
|
|
@@ -159,3 +160,8 @@ function windowApi(options: Readonly<FakeOptions> = {}) {
|
|
|
159
160
|
const api: WebWindowStoragePersistenceApi = { ...worker.api, persist };
|
|
160
161
|
return { ...worker, api, persist };
|
|
161
162
|
}
|
|
163
|
+
describe('initializeWebWorkerStoragePersistenceCapabilities', () => {
|
|
164
|
+
it('is the construction initializer of createWebWorkerStoragePersistenceCapabilities', () => {
|
|
165
|
+
expect(typeof initializeWebWorkerStoragePersistenceCapabilities).toBe('function');
|
|
166
|
+
});
|
|
167
|
+
});
|
|
@@ -2,7 +2,11 @@ import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
|
2
2
|
import { canPlayVideoType } from '@flighthq/video/contract';
|
|
3
3
|
import { describe, expect, it, vi } from 'vitest';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
createWebVideoCapabilityBackend,
|
|
7
|
+
initializeWebVideoCapabilityBackend,
|
|
8
|
+
webVideoCapabilityBackend,
|
|
9
|
+
} from './webVideoCapability';
|
|
6
10
|
|
|
7
11
|
describe('createWebVideoCapabilityBackend', () => {
|
|
8
12
|
it('constructs a backend with canPlayType and createVideoElement', () => {
|
|
@@ -47,6 +51,11 @@ describe('createWebVideoCapabilityBackend', () => {
|
|
|
47
51
|
});
|
|
48
52
|
});
|
|
49
53
|
|
|
54
|
+
describe('initializeWebVideoCapabilityBackend', () => {
|
|
55
|
+
it('is the construction initializer of createWebVideoCapabilityBackend', () => {
|
|
56
|
+
expect(typeof initializeWebVideoCapabilityBackend).toBe('function');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
50
59
|
describe('webVideoCapabilityBackend', () => {
|
|
51
60
|
it('is an Entity with canPlayType and createVideoElement', () => {
|
|
52
61
|
expect(EntityRuntimeKey in webVideoCapabilityBackend).toBe(true);
|
|
@@ -6,6 +6,7 @@ import type { GlRenderSurfaceProvider, WgpuRenderSurfaceProvider } from '@flight
|
|
|
6
6
|
import {
|
|
7
7
|
createWebWgpuRenderSurfaceProvider,
|
|
8
8
|
enableHostWebWgpuRenderSurface,
|
|
9
|
+
initializeWebWgpuRenderSurfaceProvider,
|
|
9
10
|
resetHostWebWgpuRenderSurfaceForTest,
|
|
10
11
|
} from './webWgpuRenderSurface';
|
|
11
12
|
|
|
@@ -139,6 +140,11 @@ describe('GL and WGPU surface provider independence', () => {
|
|
|
139
140
|
});
|
|
140
141
|
});
|
|
141
142
|
|
|
143
|
+
describe('initializeWebWgpuRenderSurfaceProvider', () => {
|
|
144
|
+
it('is the construction initializer of createWebWgpuRenderSurfaceProvider', () => {
|
|
145
|
+
expect(typeof initializeWebWgpuRenderSurfaceProvider).toBe('function');
|
|
146
|
+
});
|
|
147
|
+
});
|
|
142
148
|
describe('resetHostWebWgpuRenderSurfaceForTest', () => {
|
|
143
149
|
afterEach(() => {
|
|
144
150
|
resetHostWebWgpuRenderSurfaceForTest();
|
package/src/webWindow.test.ts
CHANGED
|
@@ -5,6 +5,8 @@ import { webHost } from './webHost';
|
|
|
5
5
|
import {
|
|
6
6
|
createWebFullscreenTargetHandle,
|
|
7
7
|
createWebWindowResizeTargetHandle,
|
|
8
|
+
initializeWebFullscreenTargetHandle,
|
|
9
|
+
initializeWebWindowResizeTargetHandle,
|
|
8
10
|
resetWebWindowBackendForTest,
|
|
9
11
|
webFullscreenBackend,
|
|
10
12
|
webWindowBackend,
|
|
@@ -47,6 +49,18 @@ describe('createWebWindowResizeTargetHandle', () => {
|
|
|
47
49
|
});
|
|
48
50
|
});
|
|
49
51
|
|
|
52
|
+
describe('initializeWebFullscreenTargetHandle', () => {
|
|
53
|
+
it('is the construction initializer of createWebFullscreenTargetHandle', () => {
|
|
54
|
+
expect(typeof initializeWebFullscreenTargetHandle).toBe('function');
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe('initializeWebWindowResizeTargetHandle', () => {
|
|
59
|
+
it('is the construction initializer of createWebWindowResizeTargetHandle', () => {
|
|
60
|
+
expect(typeof initializeWebWindowResizeTargetHandle).toBe('function');
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
50
64
|
describe('resetWebWindowBackendForTest', () => {
|
|
51
65
|
it('clears fullscreen targets and subscribed listeners', async () => {
|
|
52
66
|
const element = document.createElement('div');
|
|
@@ -62,7 +76,6 @@ describe('resetWebWindowBackendForTest', () => {
|
|
|
62
76
|
expect(callback).not.toHaveBeenCalled();
|
|
63
77
|
});
|
|
64
78
|
});
|
|
65
|
-
|
|
66
79
|
describe('webFullscreenBackend', () => {
|
|
67
80
|
it('requests fullscreen for the arbitrary element carried by the opaque handle', async () => {
|
|
68
81
|
const element = document.createElement('div');
|