-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web worker Tests #147
Web worker Tests #147
Conversation
Interesting, so inside a web worker, localStorage backend is broken... I guess web workers are a bit of a special case... do any localStorage-only browsers support web workers? I'd think not. |
@@ -1,7 +1,7 @@ | |||
/*global exports:true, require:true */ | |||
var path = require('path'); | |||
|
|||
module.exports = exports = function(grunt) { | |||
module.exports = exports = function (grunt) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh? ^_^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, my auto code formatter can be a too aggressive sometimes...thought I had disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No prob :-) I’ve added the Gruntfile to the jshint checker, though it doesn’t even seem to complain about that one, so maybe I need to make it more aggressive! ^_^
This is great; I'm going to check this out locally and go through this. Will try to merge today. 👍 |
Seems there's some bug with slimerjs and web workers, you're right. I can't seem to fix it easily, so I'm going to skip the tests in slimer (we do this already; it's a bit buggy). At some point I'd like to move to a more reliable (and also cross-platform) testing platform, so maybe we'll fix this then ( #148). I've tweaked some of your code locally; I'll push it and merge it in soon. |
See the release here: https://github.com/mozilla/localForage/releases/tag/0.8.0 |
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:
localstorage
is not available within a workerIndexDB
localstorage
is not available within a workerlocalstorage
is not available within a workerI'm not exactly sure why but it seems that in Firefox
localForage
forces the driver tolocalStorageWrapper
within a worker even when explicitly set toasyncStorage
orwebSQLStorage
.Also, I added two new grunt tasks:
grunt serve
andgrunt test-webworker
. The former just keeps theconnect
servers running for manual testing and the later just runstest/test.webworker.coffee
.Anyway, let me know if there is anything more to do.
Thanks again,
Luke