mozilla/localForage — pull request #147 by wmluke (2014-05-05 21:21:24+00:00)
Title: Web worker Tests

Hi @tofumatt,

Here are some unit tests to flush out worker support mentioned in #144.

I ran most of my testing manually in Chrome (v34.0.1847.131), Safari (v7.0.3), and Firefox (v29.0). Then I followed up with the casperjs/slimerjs tests.

Test Results:
* Chrome:
* asyncStorage: pass
* webSQLStorage: pass
* localStorageWrapper: fails but this is expected as `localstorage` is not available within a worker
* Safari:
* asyncStorage: fail but this is expected as Safari doesn't yet support `IndexDB`
* webSQLStorage: pass
* localStorageWrapper: fails but this is expected as `localstorage` is not available within a worker
* Firefox/Casper:
* asyncStorage: fail
* webSQLStorage: fail
* localStorageWrapper: fails but this is expected as `localstorage` is not available within a worker

I'm exactly sure why but it seems that in Firefox `localForage` forces the driver to `localStorageWrapper` within a worker even when explicitly set to `asyncStorage` or `webSQLStorage`.

Also, I added two new grunt tasks: `grunt serve` and `grunt test-webworker`. The former just keeps the `connect` servers running for manual testing and the later just runs `test/test.webworker.coffee`.

Anyway, let me know if there is anything more to do.

Thanks again,
Luke