Load sharing and external-player tools on demand
This commit is contained in:
@@ -57,3 +57,14 @@ test('watch-party facade keeps playback decisions synchronous before and after l
|
||||
context.window.YT={Party:{guestActive:()=>true,intercept:action=>action==='next',nextDJ:()=>true}};
|
||||
for(const method of ['guestActive','intercept','nextDJ'])assert.equal(context.api[method]('next'),true);
|
||||
});
|
||||
|
||||
test('Share and External stay behind lazy entry proxies',()=>{
|
||||
assert.match(app,/const Share = Lazy\.proxy\('feature:share-external'/);
|
||||
assert.match(app,/const External = Lazy\.proxy\('feature:share-external'/);
|
||||
const chunk=readFileSync(join(__dirname,'share-external.js'),'utf8');
|
||||
const context=require('node:vm').createContext({window:{},navigator:{userAgent:''},location:{origin:'https://fixture.test'},isUploadId:()=>false});
|
||||
require('node:vm').runInContext(chunk,context);
|
||||
assert.equal(typeof context.window.YT.Share.open,'function');
|
||||
const text=context.window.YT.External.m3u([{id:'benchmedia01',title:'Fixture'}]);
|
||||
assert.match(text,/#EXTM3U/);assert.match(text,/benchmedia01/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user