Skip to content
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

User Agent strings #34

Open
matthewhudson opened this issue Sep 12, 2013 · 6 comments
Open

User Agent strings #34

matthewhudson opened this issue Sep 12, 2013 · 6 comments

Comments

@matthewhudson
Copy link
Owner

I need to compile a list of target devices to test against.

@miketaylr
Copy link
Contributor

So here's the official UA strings for Firefox OS devices. Note there may be variations of these in the future with device info added, will update when I get wind of those. And naturally, the rv number will increase as Gecko is updated.

Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0
Mozilla/5.0 (Tablet; rv:18.0) Gecko/18.0 Firefox/18.0

Reference: https://wiki.mozilla.org/B2G/User_Agent

@miketaylr
Copy link
Contributor

btw, you should totally steal test data from @jdalton: https://github.com/bestiejs/platform.js/blob/master/test/test.js#L158 :P

@matthewhudson
Copy link
Owner Author

@miketaylr That's remarkably useful! Thanks! BTW, speaking of tests - happen to have any feedback on #17

I'm struggling to comeup with the best way to test this library.

@jdalton
Copy link

jdalton commented Sep 18, 2013

Take it all :D (the tests that is)

@matthewhudson
Copy link
Owner Author

@jdalton I'm willing to bet you have some wisdom as to the best way to test this library (issue #7). I attempted using Phantom + Qunit but didn't get too far due to the need to change the User Agent for each test and the need to "reload" the library (or start a new phantom "instance").

Any advice you might be able to provide would be greatly appreciated. I'm not sure how to proceed at the moment.

@jdalton
Copy link

jdalton commented Sep 19, 2013

I hacked around it a bit. I should really add a runInContext method like I have in Lo-Dash and Benchmark.js. It allows you to provided your own mocked global object (or a foreign global object) and use it to grab values from. I did this in platform's test file by dynamically manipulating platform's source for the test, but really I should add the runInContext method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants