danwent / Perspectives

Perspectives Firefox Extension
http://perspectives-project.org
66 stars 19 forks source link

Refactor unit tests #74

Closed daveschaefer closed 10 years ago

daveschaefer commented 11 years ago

Currently we have a number of unit tests in test/test.html. Some of them require special permissions, however, and make a call to netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"). That function was removed in Fx 17, so the tests no longer run.

We need to update our tests so we can run them properly, quickly, and into the forseeable future. If we're going to support multiple platforms we'll need to make sure they can all run them too.

daveschaefer commented 11 years ago

This turned out to be pretty easy. If we copy the test files inside the plugin directory before building you can run the tests after installation by visiting a URI like 'chrome://perspectives/content/test/test.html'. The tests then have the same permissions as the rest of the code, and are actually calling and executing the code as it would run.

I'll update this as part of the 4.4 release.

daveschaefer commented 11 years ago

This needs to be done sooner so we can reliably test releases. Fix this as part of the next update.

daveschaefer commented 11 years ago

Unit tests have been rescued as part of Milestone 4.3.6 , and the release of the same number. The localization tests are temporarily gone, however, and need to be re-added. I'm going to vote for changing them to be python, so if you're working on both client and server you only need to have one language installed (instead of having both python and perl).

daveschaefer commented 10 years ago

Localization tests have been moved! They now reside in test/checkloc.py and run at build time as part of the normal process. You just have to type 'make' and you'll get output if anything doesn't work :) wahoo!

It is great to get this finally finished. It should now be easy to get the German localizations added ( #84 ). I will do that soon.

I'll close this ticket when the next release is actually out. But the code is now in the depot! (just need to pull from my branch)

daveschaefer commented 10 years ago

Fixed! This is now finished in 4.4.1 :)