The googletest documentation (https://github.com/google/googletest/blob/master/googletest/docs/FAQ.md#should-i-use-the-constructordestructor-of-the-test-fixture-or-the-set-uptear-down-function) advises putting the initialization code in the constructor, except in a few special cases (which don't seem relevant for any of our tests). Most of the unit tests in our code base, however, seem to put the initialization code in SetUp, and have empty constructors. Where should we put the initialization code in new test fixtures? Why?
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
content::RenderViewHostTestHarness does most of its setup in SetUp(); e.g., that is where its BrowserContext, WebContents, and TestBrowserThreadBundle instances are instantiated. Presumably, most tests that subclass this class (or subclass ChromeRenderViewHostTestHarness, which is itself a subclass of this class) must necessarily do their own setup in their SetUp() methods as a consequence.