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

Issue 189443008: Use TestingProfile::Builder::AddTestingFactory at ChromeRenderViewHostTestHarness (Closed)

Created:
6 years, 9 months ago by Joao da Silva
Modified:
6 years, 9 months ago
CC:
chromium-reviews, blundell
Visibility:
Public.

Description

Use TestingProfile::Builder::AddTestingFactory at ChromeRenderViewHostTestHarness This test harness is overriding the SigninManagerFactory for its TestingProfiles too late, after the Profile has already been created. Any services that depend on the SigninManager and get created with the Profile are thus left with a dead pointer (e.g. UserPolicySigninService). This change sets the fake factory before the TestingProfile gets created. It also makes ChromeRenderViewHostTestHarness more consistent by using the fake factory for every TestingProfile created, not just the first one. BUG=345617 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=256379

Patch Set 1 #

Patch Set 2 : . #

Total comments: 7

Patch Set 3 : use TestingProfile::Builder::AddTestingFactory #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -8 lines) Patch
M chrome/test/base/chrome_render_view_host_test_harness.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/test/base/chrome_render_view_host_test_harness.cc View 1 2 2 chunks +4 lines, -7 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Joao da Silva
Hi Pawel, can you have a look? This fixes the crashes found by https://codereview.chromium.org/187693002. The ...
6 years, 9 months ago (2014-03-07 20:27:30 UTC) #1
Paweł Hajdan Jr.
https://codereview.chromium.org/189443008/diff/20001/components/browser_context_keyed_service/browser_context_keyed_service_factory.h File components/browser_context_keyed_service/browser_context_keyed_service_factory.h (right): https://codereview.chromium.org/189443008/diff/20001/components/browser_context_keyed_service/browser_context_keyed_service_factory.h#newcode53 components/browser_context_keyed_service/browser_context_keyed_service_factory.h:53: void RemoveTestingFactory(content::BrowserContext* context); This can easily make the code ...
6 years, 9 months ago (2014-03-07 22:08:12 UTC) #2
Joao da Silva
https://codereview.chromium.org/189443008/diff/20001/components/browser_context_keyed_service/browser_context_keyed_service_factory.h File components/browser_context_keyed_service/browser_context_keyed_service_factory.h (right): https://codereview.chromium.org/189443008/diff/20001/components/browser_context_keyed_service/browser_context_keyed_service_factory.h#newcode53 components/browser_context_keyed_service/browser_context_keyed_service_factory.h:53: void RemoveTestingFactory(content::BrowserContext* context); On 2014/03/07 22:08:12, Paweł Hajdan Jr. ...
6 years, 9 months ago (2014-03-07 23:29:20 UTC) #3
Andrew T Wilson (Slow)
I still need to look at the code, but it looks like you're changing ChromeRenderViewHostTestHarness ...
6 years, 9 months ago (2014-03-10 12:24:09 UTC) #4
Andrew T Wilson (Slow)
I think that you can fix the issue you're concerned about just my modifying ChromeRenderViewHostTestHarness ...
6 years, 9 months ago (2014-03-10 12:30:45 UTC) #5
blundell
https://codereview.chromium.org/189443008/diff/20001/chrome/test/base/chrome_render_view_host_test_harness.cc File chrome/test/base/chrome_render_view_host_test_harness.cc (right): https://codereview.chromium.org/189443008/diff/20001/chrome/test/base/chrome_render_view_host_test_harness.cc#newcode64 chrome/test/base/chrome_render_view_host_test_harness.cc:64: TestingProfile* profile = new TestingProfile(); +1, great catch Drew. ...
6 years, 9 months ago (2014-03-11 12:02:46 UTC) #6
Joao da Silva
Thanks for the hint Drew! TestingProfile::Builder::AddTestingFactory is exactly what we needed. Now I'm embarrassed I ...
6 years, 9 months ago (2014-03-11 17:10:02 UTC) #7
Paweł Hajdan Jr.
LGTM
6 years, 9 months ago (2014-03-11 17:57:41 UTC) #8
Joao da Silva
The CQ bit was checked by joaodasilva@chromium.org
6 years, 9 months ago (2014-03-11 18:16:41 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/joaodasilva@chromium.org/189443008/40001
6 years, 9 months ago (2014-03-11 18:30:22 UTC) #10
commit-bot: I haz the power
6 years, 9 months ago (2014-03-12 01:27:58 UTC) #11
Message was sent while issue was closed.
Change committed as 256379

Powered by Google App Engine
This is Rietveld 408576698