On Wed, Nov 4, 2009 at 08:56, Aaron Boodman <a...@chromium.org> wrote:

> Why don't you pass an Extension instance?


It's in a test. Mocking an Extension is not trivial as well. :( Or maybe...
I didn't read all of the extensions unit tests, maybe it's not that hard.


> It seems like you are violating the contract of that notification by not
> doing so, and even
> if you solve this problem, other similar problems would be likely to happen
> again in the future.


I see. Hmm... the test assumes that the only listener is BlacklistManager,
because the idea of the unit test is to test it in isolation. In the
browser_test I'm obviously not making that assumption, and it's using
ExtensionsService with real Extensions etc.

Please also note that the BlacklistManager unit test will only send
EXTENSION_LOADED notification, without pairing EXTENSION_UNLOADED. This is
going to cause problems anyway at some point if there are other, unexpected
listeners.

If the Extension was easily mocked, I would pass a real instance anyway.
What do you think I should do (for the unit test)?

And the PluginService and PluginList in current shape used in unit_tests is
just flakiness waiting to happen. It would be nice to fix that even if it's
not blocking the privacy blacklists patch.

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to