mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-05-21 10:51:14 -04:00
Update to latest version of storage which fixes issue where an HTML 404 page was being returned for missing asset data. Update VM to handle null assets properly.
This commit is contained in:
parent
2481f28191
commit
11f938f8a9
8 changed files with 48 additions and 27 deletions
test/integration
|
@ -23,13 +23,6 @@ let vm;
|
|||
|
||||
tap.beforeEach(() => {
|
||||
const storage = makeTestStorage();
|
||||
|
||||
// This line removes the webhelper from the list of available helpers.
|
||||
// W/o the following line, this fails because storage doesn't handle the case
|
||||
// where none of the tools have isGetSupported: true
|
||||
// TODO: Remove this line when the related storage bug is resolved so that
|
||||
// storage gracefully handles non-browser situations where assets are missing.
|
||||
storage._helpers = [storage._helpers[0]];
|
||||
|
||||
vm = new VirtualMachine();
|
||||
vm.attachStorage(storage);
|
||||
|
@ -88,8 +81,8 @@ test('load and then save sb3 project with missing costume file', t => {
|
|||
|
||||
test('serializeCostume does not save data for missing costume', t => {
|
||||
const costumeDescs = serializeCostumes(vm.runtime);
|
||||
|
||||
t.equal(costumeDescs.length, 1); // Should only have one costume, the backdrop
|
||||
|
||||
t.not(costumeDescs[0].fileName, `${missingCostumeAssetId}.svg`);
|
||||
|
||||
t.end();
|
||||
|
|
|
@ -27,13 +27,6 @@ let vm;
|
|||
|
||||
tap.beforeEach(() => {
|
||||
const storage = makeTestStorage();
|
||||
|
||||
// This line removes the webhelper from the list of available helpers.
|
||||
// W/o the following line, this fails because storage doesn't handle the case
|
||||
// where none of the tools have isGetSupported: true
|
||||
// TODO: Remove this line when the related storage bug is resolved so that
|
||||
// storage gracefully handles non-browser situations where assets are missing.
|
||||
storage._helpers = [storage._helpers[0]];
|
||||
|
||||
vm = new VirtualMachine();
|
||||
vm.attachStorage(storage);
|
||||
|
@ -86,6 +79,7 @@ test('load and then save sprite3 with missing vector costume file', t => {
|
|||
|
||||
test('serializeCostume does not save data for missing costume', t => {
|
||||
const costumeDescs = serializeCostumes(vm.runtime, vm.runtime.targets[2].id);
|
||||
|
||||
t.equal(costumeDescs.length, 0);
|
||||
|
||||
t.end();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue