Hey Mac folks. I've spent the majority of this week going through our Cocoa controllers and helper classes in chrome/browser/cocoa and adding unit tests. There are still some gaps which I'll continue to fill in next week, but we're at the point where we really need to get serious about adding tests for anything new that we write.
To that end, jrg and I have created some helper classes to make this much easier: BrowserTestHelper - creates a test Browser and Profile which can be passed to many of our UI controllers CocoaTestHelper - initializes cocoa, creates a window, and sets things up so loading nibs works With these two helpers, it should be simple to instantiate your controller and its associated views (even if from a nib) and test out the core functionality. That said, there are some things that are difficult to test (anything involving CoreAnimation, for starters), but at least it's a start. The code coverage tools jrg is working on should also help point out gaps. I'd like to ask reviewers to be more aware of unit tests when doing reviews, and if nothing else, getting a bug filed for missing tests so we can track them and get external contributors to help out. Tests are something small that can be good first bugs for people wanting to get involved. Let me know if you have any questions about what to do when writing a unit test or how to use the helpers. Happy testing! -- Mike Pinkerton Mac Weenie [email protected] --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: [email protected] View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---
