Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Issue 468493003: Admixtures in BrowserTestBase (Closed)

Created:
6 years, 4 months ago by Lisa Ignatyeva
Modified:
6 years, 2 months ago
CC:
chromium-reviews, nkostylev+watch_chromium.org, jam, darin-cc_chromium.org, oshima+watch_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

BrowserTestBase was modified so it now supports adding admixtures for tests: a class BrowserTestBase::Admixture is added. BrowserTestBase::Admixture can be used to add some features not related directly to the testing process in order not to make the test class too complicated and to set up them in a proper time (at the same time when the corresponding set ups for the main test are run). BUG=395653

Patch Set 1 #

Patch Set 2 : added missing comments #

Patch Set 3 : divided CL into two and just made this part better #

Patch Set 4 : minor style fixes #

Total comments: 12

Patch Set 5 : minor fixes #

Total comments: 8

Patch Set 6 : more minor fixes #

Patch Set 7 : empty line removed #

Patch Set 8 : teardown fixes #

Patch Set 9 : fixed teardown fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -3 lines) Patch
M chrome/test/base/in_process_browser_test.cc View 1 2 3 4 5 6 7 8 3 chunks +20 lines, -0 lines 0 comments Download
M content/public/test/browser_test_base.h View 1 2 3 4 5 4 chunks +34 lines, -0 lines 0 comments Download
M content/public/test/browser_test_base.cc View 1 2 3 4 5 6 7 8 5 chunks +19 lines, -3 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
Lisa Ignatyeva
6 years, 4 months ago (2014-08-13 07:47:34 UTC) #1
Lisa Ignatyeva
CL was splitted into two parts, here remains implementing Admixtures.
6 years, 4 months ago (2014-08-15 14:14:25 UTC) #2
dzhioev (left Google)
https://codereview.chromium.org/468493003/diff/60001/content/public/test/browser_test_base.h File content/public/test/browser_test_base.h (right): https://codereview.chromium.org/468493003/diff/60001/content/public/test/browser_test_base.h#newcode43 content/public/test/browser_test_base.h:43: virtual void SetUpInProcessBrowserTestFixture() = 0; Add a default implementation ...
6 years, 4 months ago (2014-08-15 14:37:14 UTC) #3
Lisa Ignatyeva
https://codereview.chromium.org/468493003/diff/60001/content/public/test/browser_test_base.h File content/public/test/browser_test_base.h (right): https://codereview.chromium.org/468493003/diff/60001/content/public/test/browser_test_base.h#newcode43 content/public/test/browser_test_base.h:43: virtual void SetUpInProcessBrowserTestFixture() = 0; On 2014/08/15 14:37:14, dzhioev ...
6 years, 4 months ago (2014-08-15 16:12:37 UTC) #4
dzhioev (left Google)
https://codereview.chromium.org/468493003/diff/80001/chrome/test/base/in_process_browser_test.cc File chrome/test/base/in_process_browser_test.cc (right): https://codereview.chromium.org/468493003/diff/80001/chrome/test/base/in_process_browser_test.cc#newcode435 chrome/test/base/in_process_browser_test.cc:435: (*it)->SetUpInProcessBrowserTestFixture(); We should call SetUpOnMainThread here, not SetUpInProcessBrowserTestFixture. https://codereview.chromium.org/468493003/diff/80001/content/public/test/browser_test_base.cc ...
6 years, 4 months ago (2014-08-18 12:11:47 UTC) #5
Lisa Ignatyeva
Ouch, I felt like having fixed that all Friday evening, should be more careful. https://codereview.chromium.org/468493003/diff/80001/chrome/test/base/in_process_browser_test.cc ...
6 years, 4 months ago (2014-08-18 12:20:42 UTC) #6
Lisa Ignatyeva
Fixed the order of calling TearDown* for admixtures and the test.
6 years, 4 months ago (2014-08-18 13:18:41 UTC) #7
dzhioev (left Google)
LGTM. Scott, PTAL. Rationale for this change: we want to have ability to create test ...
6 years, 4 months ago (2014-08-18 14:59:21 UTC) #8
Lisa Ignatyeva
The CQ bit was checked by elizavetai@chromium.org
6 years, 4 months ago (2014-08-18 15:01:12 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/elizavetai@chromium.org/468493003/160001
6 years, 4 months ago (2014-08-18 15:01:34 UTC) #10
Lisa Ignatyeva
The CQ bit was unchecked by elizavetai@chromium.org
6 years, 4 months ago (2014-08-18 15:21:20 UTC) #11
dzhioev (left Google)
Scott, friendly ping.
6 years, 3 months ago (2014-09-01 16:54:12 UTC) #12
sky
Can you motivate why this is better than subclassing? Generally tests that need additional functionality ...
6 years, 3 months ago (2014-09-02 17:46:05 UTC) #13
dzhioev (left Google)
On 2014/09/02 17:46:05, sky wrote: > Can you motivate why this is better than subclassing? ...
6 years, 3 months ago (2014-09-02 17:57:32 UTC) #14
sky
Put a common superclass in between them. On Tue, Sep 2, 2014 at 10:57 AM, ...
6 years, 3 months ago (2014-09-02 18:05:48 UTC) #15
dzhioev (left Google)
I don't get it. Can you please explain in more details? Problem: we have classes ...
6 years, 3 months ago (2014-09-02 18:33:44 UTC) #16
sky
Introduce C that is a superclass of A and B with the common functionality you ...
6 years, 3 months ago (2014-09-02 19:20:33 UTC) #17
Lisa Ignatyeva
Yes, this appeared as a generalized solution for quite a local problem. What I'm trying ...
6 years, 3 months ago (2014-09-03 09:10:20 UTC) #18
sky
Can you point me at some follow on patches? That we're going to start doing ...
6 years, 3 months ago (2014-09-03 15:56:06 UTC) #19
Denis Kuznetsov (DE-MUC)
Document is here: http://goto/test-oobe-with-screenshots We want to use golden-testing in chromeos Out-of-box flow, as there ...
6 years, 3 months ago (2014-09-03 18:34:24 UTC) #20
sky
This is big enough and at one point could effect anyone on the team (primarily ...
6 years, 3 months ago (2014-09-03 20:14:53 UTC) #21
Denis Kuznetsov (DE-MUC)
> Also, I'm still not seeing why gold images necessitates the changes in > this ...
6 years, 3 months ago (2014-09-04 09:41:31 UTC) #22
sky
Like I said, I'm still not seeing why a new subclass or helper class won't ...
6 years, 3 months ago (2014-09-04 13:16:22 UTC) #23
Lisa Ignatyeva
You can look at this one https://codereview.chromium.org/441263002/ On 2014/09/04 13:16:22, sky wrote: > Like I ...
6 years, 3 months ago (2014-09-05 09:29:45 UTC) #24
sky
On Fri, Sep 5, 2014 at 2:29 AM, <elizavetai@chromium.org> wrote: > You can look at ...
6 years, 3 months ago (2014-09-05 18:05:05 UTC) #25
michaelpg
Here is an change I tried and didn't like, where Lisa's CL would have made ...
6 years, 3 months ago (2014-09-10 20:10:49 UTC) #26
sky
6 years, 3 months ago (2014-09-10 21:55:58 UTC) #27
I was opposed to the additional complexity without a compelling
reason. I asked for a compelling reason and none were presented. If
there is a compelling reasons that can't be solved in a traditional
way than I am ok with the complexity. It was my thinking that golden
image testing would likely be quite invasive anyway, so that adding in
the necessary calls into a helper class isn't were the burden is.

  -Scott

On Wed, Sep 10, 2014 at 1:10 PM,  <michaelpg@chromium.org> wrote:
> Here is an change I tried and didn't like, where Lisa's CL would have made
> this
> change unnecessary:
>
> https://codereview.chromium.org/270563002/
>
> LoginManagerTest derives from InProcessBrowserTest to let tests easily
> handle
> user registration, login, etc. This requires a bunch of setup and teardown
> logic.
>
> I wanted to write a WebUITest that can use this functionality. The "local"
> solution which you supported at the time was to move all of the common logic
> out
> of LoginManagerTest and put it in a helper class, LoginManagerTestHelper.
> The
> result is that most of the code is moved, LoginManagerTest creates a
> LoginManagerTestHelper, and each function from InProcessBrowserTest that
> LoginManagerTest overrides simply calls the same function in
> LoginManagerTestHelper.
>
> My test can then derive from WebUITest and also use a
> LoginManagerTestHelper,
> again passing all of the setup and teardown calls to the helper.
>
> I decided not to land the change and just write a more verbose test,
> forgoing
> the convenience of WebUITest. It did make sense to remove most of the logic
> from
> LoginManagerTest so it can be used without inheritance, but the amount of
> custom
> spaghetti code that generates is problematic. And doing the same thing for
> other
> subclasses of BrowserTestBase just amounts to needless duplication and
> fragility. I think providing "generic" admixture support in one place (the
> base
> class) is the right thing to do.
>
>
>
> On 2014/09/04 13:16:22, sky wrote:
>>
>> Like I said, I'm still not seeing why a new subclass or helper class
>> won't work here. If you send me the follow on patches that would help.
>
>
>> On Thu, Sep 4, 2014 at 2:41 AM,  <mailto:antrim@chromium.org> wrote:
>> >> Also, I'm still not seeing why gold images necessitates the changes in
>> >> this patchset. Seems to me if you're going to be snapshoting you're
>> >> going to need to snapshot at specific points in the test cycle that is
>> >> going to require lots of changes to each test. Seems like this would
>> >> be best addressed by a class that each tests that wants this
>> >> functionality creates and calls to at the appropriate points.
>> >
>> >
>> > That's exactly what we want to do.
>> > The issue is that that class needs to affect test setup at several
>> > stages
>> > (change command line, initialize necessary stuctures at right time,
>> > etc).
>> > So we want to extend BrowserTestBase so that this setup could be done
>> > easy
>> > (by
>> > just registering one mixin rather that overriding several setup methods
>> > in
>> > each
>> > test).
>> >
>> > https://codereview.chromium.org/468493003/
>
>
>> To unsubscribe from this group and stop receiving emails from it, send an
>
> email
>>
>> to mailto:chromium-reviews+unsubscribe@chromium.org.
>
>
>
> https://codereview.chromium.org/468493003/

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698