Firefox/Projects/TabCandy/Work: Difference between revisions

no edit summary
No edit summary
Line 64: Line 64:


All of our JavaScript files get concatenated into a single tabcandy.js, so error line numbers don't line up with the original source files. You can, however, go to chrome://browser/content/tabview.js, hit "view source", and then command+L is "go to line".  
All of our JavaScript files get concatenated into a single tabcandy.js, so error line numbers don't line up with the original source files. You can, however, go to chrome://browser/content/tabview.js, hit "view source", and then command+L is "go to line".  
= Tests =
Tabcandy test locations:
* Our tests are located in '''browser/base/content/test/tabview''' with a small number in '''browser/base/content/test'''
Here are some tips on writing tests for Tab Candy:
* Using setTimeout() to delay a finish() call is frowned upon. It covers up the underlying problem(s), and has a high potential of causing intermittent unit test failures.
* To close a window, register an observer with the window watcher, as shown in the whenWindowObservesOnce() call in this attachment: https://bugzilla.mozilla.org/attachment.cgi?id=475327&action=diff and then call finish() once you've received a proper "domwindowclosed" notification for that window.
Here are some troubleshooting tips:
* If your test spawns a window, you may notice that you get unexpected failures in the private browsing tests even if you properly clean it up. This is caused by unresolved closed windows in the session store. To remove this symptom from affecting later tests, use code such as that shown in this attachment: https://bugzilla.mozilla.org/attachment.cgi?id=475838&action=diff to clear the session store's record of closed windows before calling finish().


= Mercurial Queues =
= Mercurial Queues =
2

edits