forked from EXT/VR180-Web-Player
This commit is contained in:
@@ -53,6 +53,24 @@ test('MediaTextureManager assigns and clears material maps', () => {
|
||||
assert.equal(manager.current, null);
|
||||
});
|
||||
|
||||
test('MediaTextureManager can switch sources before creating the next texture', () => {
|
||||
const firstSource = { name: 'first' };
|
||||
const secondSource = { name: 'second' };
|
||||
const createdFrom = [];
|
||||
const manager = new MediaTextureManager(firstSource, (source) => {
|
||||
createdFrom.push(source);
|
||||
return createTexture(source.name);
|
||||
}, () => true);
|
||||
|
||||
const firstTexture = manager.create();
|
||||
manager.setSource(secondSource);
|
||||
const secondTexture = manager.create();
|
||||
|
||||
assert.equal(firstTexture.disposed, true);
|
||||
assert.equal(secondTexture.name, 'second');
|
||||
assert.deepEqual(createdFrom, [firstSource, secondSource]);
|
||||
});
|
||||
|
||||
test('MediaTextureManager only marks textures dirty when the update predicate allows it', () => {
|
||||
const video = createVideo();
|
||||
const manager = new MediaTextureManager(
|
||||
|
||||
Reference in New Issue
Block a user