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

Issue 6478005: GTTF: Use a fresh TestingBrowserProcess for each test, part #1 (Closed)

Created:
9 years, 10 months ago by Paweł Hajdan Jr.
Modified:
9 years, 7 months ago
Reviewers:
sky
CC:
chromium-reviews, michaeln, Ilya Sherman, pam+watch_chromium.org, Paweł Hajdan Jr., James Hawkins, dhollowa
Visibility:
Public.

Description

GTTF: Use a fresh TestingBrowserProcess for each test, part #1 This is going to be done in multiple steps, because lots of tests depend on global TestingBrowserProcess. However, the current solution is very error-prone, and may lead to state being carried from one test to another (via NotificationService), resulting in crashes. In theory the ScopedTestingBrowserProcess could be made empty for now, but re-initializing g_browser_process inside it has two benefits: 1) It verifies that changing g_browser_process actually works. 2) It protects at least a subset of tests from carrying state. BUG=61062 TEST=unit_tests, possibly more Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=74926

Patch Set 1 #

Patch Set 2 : base class #

Total comments: 7

Patch Set 3 : make more tests use the new base class #

Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -19 lines) Patch
M chrome/browser/app_controller_mac_unittest.mm View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/appcache/chrome_appcache_service_unittest.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_unittest.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_unittest.cc View 1 6 chunks +11 lines, -3 lines 0 comments Download
M chrome/browser/autocomplete/history_contents_provider_unittest.cc View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/autocomplete/history_quick_provider_unittest.cc View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/autocomplete/history_url_provider_unittest.cc View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/autocomplete/keyword_provider_unittest.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/autocomplete/search_provider_unittest.cc View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/autocomplete_history_manager_unittest.cc View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/autofill/autofill_dialog_controller_mac_unittest.mm View 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/autofill/autofill_download_unittest.cc View 1 3 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/autofill/autofill_manager_unittest.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/autofill/autofill_metrics_unittest.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/autofill/personal_data_manager_unittest.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/automation/automation_provider_unittest.cc View 1 2 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/background_contents_service_unittest.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/background_mode_manager_unittest.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/background_page_tracker_unittest.cc View 1 4 chunks +9 lines, -4 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/testing_browser_process.h View 1 chunk +14 lines, -0 lines 0 comments Download
M chrome/test/testing_browser_process.cc View 1 chunk +23 lines, -0 lines 0 comments Download
A chrome/test/testing_browser_process_test.h View 1 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Paweł Hajdan Jr.
9 years, 10 months ago (2011-02-09 21:40:50 UTC) #1
sky
This is pretty invasive. Isn't there a way to inject g_browser_process before each test is ...
9 years, 10 months ago (2011-02-09 22:06:32 UTC) #2
Paweł Hajdan Jr.
PTAL After the chat, I've added a base class where it was possible. In one ...
9 years, 10 months ago (2011-02-14 10:16:24 UTC) #3
sky
How come you didn't use the superclass more often? http://codereview.chromium.org/6478005/diff/6005/chrome/browser/appcache/chrome_appcache_service_unittest.cc File chrome/browser/appcache/chrome_appcache_service_unittest.cc (right): http://codereview.chromium.org/6478005/diff/6005/chrome/browser/appcache/chrome_appcache_service_unittest.cc#newcode19 chrome/browser/appcache/chrome_appcache_service_unittest.cc:19: ...
9 years, 10 months ago (2011-02-14 17:01:19 UTC) #4
Paweł Hajdan Jr.
PTAL
9 years, 10 months ago (2011-02-14 20:56:28 UTC) #5
sky
9 years, 10 months ago (2011-02-14 21:49:42 UTC) #6
LGTM

Powered by Google App Engine
This is Rietveld 408576698