mozilla / pluotsorbet

[ARCHIVED] PluotSorbet is a J2ME-compatible virtual machine written in JavaScript.
GNU General Public License v2.0
238 stars 46 forks source link

tests fail in the browser from file: URL after clearing storage #392

Open mykmelez opened 10 years ago

mykmelez commented 10 years ago

Tests fail when run in the browser from a file: URL after clearing storage with the following exception:

java.lang.NullPointerException:

  • java/lang/Throwable.(), bci=8
  • java/lang/Exception.(), bci=5
  • java/lang/RuntimeException.(), bci=5
  • java/lang/NullPointerException.(), bci=5
  • java/lang/NullPointerException.RaiseExceptionSynthetic(), bci=9
  • com/sun/midp/publickeystore/TestWebPublicKeyStore.test(), bci=9
  • RunTests.startApp(), bci=135
  • javax/microedition/midlet/MIDletTunnelImpl.callStartApp(), bci=4
  • com/sun/midp/midlet/MIDletPeer.startApp(), bci=12
  • com/sun/midp/midlet/MIDletStateHandler.startSuite(), bci=252
  • com/sun/midp/main/AbstractMIDletSuiteLoader.startSuite(), bci=54
  • com/sun/midp/main/CldcMIDletSuiteLoader.startSuite(), bci=11
  • com/sun/midp/main/AbstractMIDletSuiteLoader.runMIDletSuite(), bci=146
  • com/sun/midp/main/MIDletSuiteLoader.main(), bci=15
marco-c commented 10 years ago

Maybe somehow the _main.ks file isn't there? Could you try running fs.list("/", console.info.bind(console)) in the web console and see if the file is there?

mykmelez commented 10 years ago

The file isn't there!

marco-c commented 10 years ago

Could you do the same with _fs.exists("/main.ks", console.info.bind(console)) and _fs.stat("/main.ks", (stat) => console.info(stat.isDir))? Just to make sure it's not a FS problem.

mykmelez commented 10 years ago

fs.exists("/_main.ks", console.info.bind(console)) true fs.stat("/_main.ks", (stat) => console.info(stat.isDir)) false

marco-c commented 10 years ago

Last two tests: _asyncStorage.getItem("/main.ks", (blob) => console.info(blob instanceof Blob)); _asyncStorage.getItem("/", (list) => console.info(list.indexOf("main.ks")));

mykmelez commented 10 years ago

asyncStorage.getItem("/_main.ks", (blob) => console.info(blob instanceof Blob)); true asyncStorage.getItem("/", (list) => console.info(list.indexOf("_main.ks"))); 1

Erm, but:

fs.list("/", console.info.bind(console)); Persistent,_main.ks

Whereas the first time I tried that, it printed an empty string to the console. So the file now exists, but I'm still seeing the exception.

marco-c commented 10 years ago

I can reproduce this problem using Nightly.