Release Vulpes OS 2.7-preview.22
This commit is contained in:
parent
200d1fb235
commit
a138f97877
294 changed files with 515786 additions and 187 deletions
|
|
@ -36,7 +36,7 @@ test('a composer button retains input and other buttons dismiss only after click
|
|||
const {runInNewContext}=await import('node:vm');
|
||||
const source=await readFile(new URL('../host/actors/VulpesChild.sys.mjs',import.meta.url),'utf8');
|
||||
const events=[];
|
||||
const Actor=runInNewContext(source.replace(/^import .*;\n/, '').replace('export class','class')+';VulpesChild',{
|
||||
const Actor=runInNewContext(source.replace(/^import .*;\n/gm, '').replace('export class','class')+';VulpesChild',{
|
||||
JSWindowActorChild:class{},Services:{cpmm:{sharedData:{get:()=>true}}}
|
||||
});
|
||||
const actor=new Actor();actor.sendAsyncMessage=(...args)=>events.push(args);
|
||||
|
|
@ -47,3 +47,24 @@ test('a composer button retains input and other buttons dismiss only after click
|
|||
actor.handleEvent({type:'pointerdown',target:button});actor.handleEvent({type:'click',target:button});
|
||||
assert.equal(events.length,1,'send keeps the composer focused');
|
||||
});
|
||||
|
||||
test('physical keypad suppresses the virtual IME without affecting touch hosts',()=>{
|
||||
const {input,events,field}=setup();input.runtime.hardwareKeyboard=true;
|
||||
input.changed(field,{text:'private text'});
|
||||
assert.equal(input.focus,null);assert.equal(events.length,0);
|
||||
input.runtime.hardwareKeyboard=false;input.changed(field,{text:''});
|
||||
assert.equal(events[0][0],'input-focus');
|
||||
});
|
||||
|
||||
test('an external input uses its visible owner, without gaining keyboard permissions',async()=>{
|
||||
const {input,keyboard}=setup();const web={};let visible=true;
|
||||
input.runtime.inputIdentity=actor=>actor===web && visible?{id:'marketplace'}:actor.app;
|
||||
web.sendQuery=async()=>({text:'test'});
|
||||
input.changed(web,{text:''});
|
||||
assert.equal((await input.request(keyboard,{operation:'key',id:1})).text,'test');
|
||||
await assert.rejects(input.request(web,{operation:'state'}),/PERMISSION_DENIED/);
|
||||
visible=false;
|
||||
await assert.rejects(input.request(keyboard,{operation:'key',id:1}),/INPUT_CONTEXT_EXPIRED/);
|
||||
assert.equal(input.focus,null);
|
||||
input.changed(web,{text:'hidden'});assert.equal(input.focus,null);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue