diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-10 01:12:26 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-10 01:12:26 +0000 |
commit | 04dd0d690d0992bba0cc656da4e49d024b1700d6 (patch) | |
tree | 2b1590a7321ac454dab9c0f3702c1f16160c0e60 | |
parent | 1290af9df599257e3cc3112504ed944ed3a00ce7 (diff) | |
download | chromium_src-04dd0d690d0992bba0cc656da4e49d024b1700d6.zip chromium_src-04dd0d690d0992bba0cc656da4e49d024b1700d6.tar.gz chromium_src-04dd0d690d0992bba0cc656da4e49d024b1700d6.tar.bz2 |
Revert 96098 - ui_tests began crashing
GTTF: Use a fresh TestingBrowserProcess for each test, part #5
For a detailed description see part #1, http://codereview.chromium.org/6478005/
This CL fixes the bug fully on Windows. More platforms will follow.
BUG=61062
TEST=unit_tests, possibly more
Review URL: http://codereview.chromium.org/7601006
TBR=phajdan.jr@chromium.org
Review URL: http://codereview.chromium.org/7552029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96107 0039d316-1c4b-4281-b951-d872f2087c98
19 files changed, 36 insertions, 77 deletions
diff --git a/chrome/browser/bookmarks/bookmark_node_data_unittest.cc b/chrome/browser/bookmarks/bookmark_node_data_unittest.cc index 58c97b1..b9c58bb 100644 --- a/chrome/browser/bookmarks/bookmark_node_data_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_node_data_unittest.cc @@ -9,14 +9,13 @@ #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_node_data.h" #include "chrome/test/base/testing_profile.h" -#include "chrome/test/testing_browser_process_test.h" #include "content/browser/browser_thread.h" #include "googleurl/src/gurl.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/dragdrop/os_exchange_data_provider_win.h" -class BookmarkNodeDataTest : public TestingBrowserProcessTest { +class BookmarkNodeDataTest : public testing::Test { public: BookmarkNodeDataTest() : ui_thread_(BrowserThread::UI, &loop_), diff --git a/chrome/browser/browsing_data_database_helper_browsertest.cc b/chrome/browser/browsing_data_database_helper_browsertest.cc index 462e697..39699f6 100644 --- a/chrome/browser/browsing_data_database_helper_browsertest.cc +++ b/chrome/browser/browsing_data_database_helper_browsertest.cc @@ -6,9 +6,8 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/browsing_data_database_helper.h" #include "chrome/browser/browsing_data_helper_browsertest.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/browser.h" #include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/testing_profile.h" #include "chrome/test/base/ui_test_utils.h" #include "content/browser/browser_thread.h" @@ -25,7 +24,7 @@ class BrowsingDataDatabaseHelperTest : public InProcessBrowserTest { public: virtual void CreateDatabases() { webkit_database::DatabaseTracker* db_tracker = - browser()->profile()->GetDatabaseTracker(); + testing_profile_.GetDatabaseTracker(); string16 db_name = ASCIIToUTF16("db"); string16 description = ASCIIToUTF16("db_description"); int64 size; @@ -47,6 +46,9 @@ class BrowsingDataDatabaseHelperTest : public InProcessBrowserTest { db_tracker->GetAllOriginsInfo(&origins); ASSERT_EQ(2U, origins.size()); } + + protected: + TestingProfile testing_profile_; }; // Called back by BrowsingDataDatabaseHelper on the UI thread once the database @@ -75,7 +77,7 @@ class StopTestOnCallback { IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, FetchData) { CreateDatabases(); scoped_refptr<BrowsingDataDatabaseHelper> database_helper( - new BrowsingDataDatabaseHelper(browser()->profile())); + new BrowsingDataDatabaseHelper(&testing_profile_)); StopTestOnCallback stop_test_on_callback(database_helper); database_helper->StartFetching( NewCallback(&stop_test_on_callback, &StopTestOnCallback::Callback)); @@ -93,7 +95,7 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, CannedAddDatabase) { const char db3[] = "db3"; scoped_refptr<CannedBrowsingDataDatabaseHelper> helper( - new CannedBrowsingDataDatabaseHelper(browser()->profile())); + new CannedBrowsingDataDatabaseHelper(&testing_profile_)); helper->AddDatabase(origin1, db1, ""); helper->AddDatabase(origin1, db2, ""); helper->AddDatabase(origin2, db3, ""); @@ -120,7 +122,7 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, CannedUnique) { const char db[] = "db1"; scoped_refptr<CannedBrowsingDataDatabaseHelper> helper( - new CannedBrowsingDataDatabaseHelper(browser()->profile())); + new CannedBrowsingDataDatabaseHelper(&testing_profile_)); helper->AddDatabase(origin, db, ""); helper->AddDatabase(origin, db, ""); diff --git a/chrome/browser/browsing_data_indexed_db_helper_browsertest.cc b/chrome/browser/browsing_data_indexed_db_helper_browsertest.cc index b1f9ead..bd570e4 100644 --- a/chrome/browser/browsing_data_indexed_db_helper_browsertest.cc +++ b/chrome/browser/browsing_data_indexed_db_helper_browsertest.cc @@ -12,9 +12,8 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/browsing_data_helper_browsertest.h" #include "chrome/browser/browsing_data_indexed_db_helper.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/browser.h" #include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" namespace { @@ -22,6 +21,8 @@ typedef BrowsingDataHelperCallback<BrowsingDataIndexedDBHelper::IndexedDBInfo> TestCompletionCallback; class BrowsingDataIndexedDBHelperTest : public InProcessBrowserTest { + protected: + TestingProfile testing_profile_; }; IN_PROC_BROWSER_TEST_F(BrowsingDataIndexedDBHelperTest, CannedAddIndexedDB) { @@ -34,7 +35,7 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataIndexedDBHelperTest, CannedAddIndexedDB) { FILE_PATH_LITERAL("http_host2_1.indexeddb.leveldb"); scoped_refptr<CannedBrowsingDataIndexedDBHelper> helper( - new CannedBrowsingDataIndexedDBHelper(browser()->profile())); + new CannedBrowsingDataIndexedDBHelper(&testing_profile_)); helper->AddIndexedDB(origin1, description); helper->AddIndexedDB(origin2, description); @@ -57,7 +58,7 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataIndexedDBHelperTest, CannedUnique) { FILE_PATH_LITERAL("http_host1_1.indexeddb.leveldb"); scoped_refptr<CannedBrowsingDataIndexedDBHelper> helper( - new CannedBrowsingDataIndexedDBHelper(browser()->profile())); + new CannedBrowsingDataIndexedDBHelper(&testing_profile_)); helper->AddIndexedDB(origin, description); helper->AddIndexedDB(origin, description); diff --git a/chrome/browser/browsing_data_local_storage_helper_browsertest.cc b/chrome/browser/browsing_data_local_storage_helper_browsertest.cc index af7e968..5440f7d 100644 --- a/chrome/browser/browsing_data_local_storage_helper_browsertest.cc +++ b/chrome/browser/browsing_data_local_storage_helper_browsertest.cc @@ -12,9 +12,8 @@ #include "base/test/thread_test_helper.h" #include "chrome/browser/browsing_data_helper_browsertest.h" #include "chrome/browser/browsing_data_local_storage_helper.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/browser.h" #include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/testing_profile.h" #include "chrome/test/base/ui_test_utils.h" #include "content/browser/in_process_webkit/webkit_context.h" #include "content/browser/in_process_webkit/webkit_thread.h" @@ -53,11 +52,12 @@ class BrowsingDataLocalStorageHelperTest : public InProcessBrowserTest { } FilePath GetLocalStoragePathForTestingProfile() { - FilePath storage_path(browser()->profile()->GetPath()); + FilePath storage_path(testing_profile_.GetPath()); storage_path = storage_path.Append( DOMStorageContext::kLocalStorageDirectory); return storage_path; } + TestingProfile testing_profile_; }; // This class is notified by BrowsingDataLocalStorageHelper on the UI thread @@ -101,7 +101,7 @@ class StopTestOnCallback { IN_PROC_BROWSER_TEST_F(BrowsingDataLocalStorageHelperTest, CallbackCompletes) { scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_helper( - new BrowsingDataLocalStorageHelper(browser()->profile())); + new BrowsingDataLocalStorageHelper(&testing_profile_)); CreateLocalStorageFilesForTest(); StopTestOnCallback stop_test_on_callback(local_storage_helper); local_storage_helper->StartFetching( @@ -112,7 +112,7 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataLocalStorageHelperTest, CallbackCompletes) { IN_PROC_BROWSER_TEST_F(BrowsingDataLocalStorageHelperTest, DeleteSingleFile) { scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_helper( - new BrowsingDataLocalStorageHelper(browser()->profile())); + new BrowsingDataLocalStorageHelper(&testing_profile_)); CreateLocalStorageFilesForTest(); local_storage_helper->DeleteLocalStorageFile( GetLocalStoragePathForTestingProfile().Append(FilePath(kTestFile0))); @@ -145,7 +145,7 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataLocalStorageHelperTest, FILE_PATH_LITERAL("http_host2_1.localstorage"); scoped_refptr<CannedBrowsingDataLocalStorageHelper> helper( - new CannedBrowsingDataLocalStorageHelper(browser()->profile())); + new CannedBrowsingDataLocalStorageHelper(&testing_profile_)); helper->AddLocalStorage(origin1); helper->AddLocalStorage(origin2); @@ -167,7 +167,7 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataLocalStorageHelperTest, CannedUnique) { FILE_PATH_LITERAL("http_host1_1.localstorage"); scoped_refptr<CannedBrowsingDataLocalStorageHelper> helper( - new CannedBrowsingDataLocalStorageHelper(browser()->profile())); + new CannedBrowsingDataLocalStorageHelper(&testing_profile_)); helper->AddLocalStorage(origin); helper->AddLocalStorage(origin); diff --git a/chrome/browser/extensions/extension_bookmarks_unittest.cc b/chrome/browser/extensions/extension_bookmarks_unittest.cc index d218c3e..6eea596 100644 --- a/chrome/browser/extensions/extension_bookmarks_unittest.cc +++ b/chrome/browser/extensions/extension_bookmarks_unittest.cc @@ -9,11 +9,9 @@ #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/extensions/extension_bookmark_helpers.h" #include "chrome/browser/extensions/extension_bookmarks_module_constants.h" -#include "chrome/test/testing_browser_process_test.h" - namespace keys = extension_bookmarks_module_constants; -class ExtensionBookmarksTest : public TestingBrowserProcessTest { +class ExtensionBookmarksTest : public testing::Test { public: virtual void SetUp() { model_.reset(new BookmarkModel(NULL)); diff --git a/chrome/browser/extensions/extension_cookies_unittest.cc b/chrome/browser/extensions/extension_cookies_unittest.cc index fb6da64..699c5e9 100644 --- a/chrome/browser/extensions/extension_cookies_unittest.cc +++ b/chrome/browser/extensions/extension_cookies_unittest.cc @@ -11,7 +11,6 @@ #include "chrome/browser/extensions/extension_cookies_api_constants.h" #include "chrome/browser/extensions/extension_cookies_helpers.h" #include "chrome/test/base/testing_profile.h" -#include "chrome/test/testing_browser_process_test.h" #include "googleurl/src/gurl.h" namespace keys = extension_cookies_api_constants; @@ -62,7 +61,7 @@ class OtrTestingProfile : public TestingProfile { } // namespace -class ExtensionCookiesTest : public TestingBrowserProcessTest { +class ExtensionCookiesTest : public testing::Test { }; TEST_F(ExtensionCookiesTest, StoreIdProfileConversion) { diff --git a/chrome/browser/extensions/extension_process_manager_unittest.cc b/chrome/browser/extensions/extension_process_manager_unittest.cc index 8847a52..4f7aef2 100644 --- a/chrome/browser/extensions/extension_process_manager_unittest.cc +++ b/chrome/browser/extensions/extension_process_manager_unittest.cc @@ -5,7 +5,6 @@ #include "chrome/browser/extensions/extension_process_manager.h" #include "chrome/browser/extensions/extension_error_reporter.h" #include "chrome/test/base/testing_profile.h" -#include "chrome/test/testing_browser_process_test.h" #include "content/browser/site_instance.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -13,7 +12,7 @@ namespace { // make the test a PlatformTest to setup autorelease pools properly on mac -class ExtensionProcessManagerTest : public TestingBrowserProcessTest { +class ExtensionProcessManagerTest : public testing::Test { public: static void SetUpTestCase() { ExtensionErrorReporter::Init(false); // no noisy errors diff --git a/chrome/browser/intents/web_intents_registry_unittest.cc b/chrome/browser/intents/web_intents_registry_unittest.cc index 55ae6aa..d8aa4cb 100644 --- a/chrome/browser/intents/web_intents_registry_unittest.cc +++ b/chrome/browser/intents/web_intents_registry_unittest.cc @@ -7,10 +7,9 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/intents/web_intents_registry.h" #include "chrome/browser/webdata/web_data_service.h" -#include "chrome/test/testing_browser_process_test.h" #include "testing/gtest/include/gtest/gtest.h" -class WebIntentsRegistryTest : public TestingBrowserProcessTest { +class WebIntentsRegistryTest : public testing::Test { public: WebIntentsRegistryTest() : ui_thread_(BrowserThread::UI, &message_loop_), diff --git a/chrome/browser/password_manager/password_store_win_unittest.cc b/chrome/browser/password_manager/password_store_win_unittest.cc index 72d8ec6..6b187c2 100644 --- a/chrome/browser/password_manager/password_store_win_unittest.cc +++ b/chrome/browser/password_manager/password_store_win_unittest.cc @@ -22,7 +22,6 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/signaling_task.h" #include "chrome/test/base/testing_profile.h" -#include "chrome/test/testing_browser_process_test.h" #include "content/browser/browser_thread.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -52,7 +51,7 @@ public: typedef std::vector<PasswordForm*> VectorOfForms; -class PasswordStoreWinTest : public TestingBrowserProcessTest { +class PasswordStoreWinTest : public testing::Test { protected: PasswordStoreWinTest() : ui_thread_(BrowserThread::UI, &message_loop_), diff --git a/chrome/browser/policy/enterprise_metrics_browsertest.cc b/chrome/browser/policy/enterprise_metrics_browsertest.cc index ef7ed75..3ecfc684 100644 --- a/chrome/browser/policy/enterprise_metrics_browsertest.cc +++ b/chrome/browser/policy/enterprise_metrics_browsertest.cc @@ -22,7 +22,6 @@ #include "chrome/browser/policy/proto/device_management_local.pb.h" #include "chrome/browser/policy/user_policy_cache.h" #include "chrome/browser/policy/user_policy_token_cache.h" -#include "chrome/test/testing_browser_process_test.h" #include "content/browser/browser_thread.h" #include "net/url_request/url_request_status.h" #include "testing/gmock/include/gmock/gmock.h" @@ -114,7 +113,7 @@ class DeviceManagementBackendTestHelper { // in its own process to make sure the counters are not initialized before the // test runs, and that the StatisticsRecorder instance created for the test // doesn't interfere with counters in other tests. -class EnterpriseMetricsTest : public TestingBrowserProcessTest { +class EnterpriseMetricsTest : public testing::Test { public: EnterpriseMetricsTest() : ui_thread_(BrowserThread::UI, &loop_), diff --git a/chrome/browser/profiles/avatar_menu_model_unittest.cc b/chrome/browser/profiles/avatar_menu_model_unittest.cc index 2e1683d..e02151e 100644 --- a/chrome/browser/profiles/avatar_menu_model_unittest.cc +++ b/chrome/browser/profiles/avatar_menu_model_unittest.cc @@ -9,7 +9,6 @@ #include "chrome/browser/profiles/avatar_menu_model_observer.h" #include "chrome/browser/profiles/profile_info_interface.h" #include "chrome/common/chrome_notification_types.h" -#include "chrome/test/testing_browser_process_test.h" #include "content/common/notification_service.h" #include "grit/theme_resources.h" #include "testing/gtest/include/gtest/gtest.h" @@ -67,7 +66,7 @@ class MockObserver : public AvatarMenuModelObserver { int count_; }; -class AvatarMenuModelTest : public TestingBrowserProcessTest { +class AvatarMenuModelTest : public testing::Test { public: FakeProfileInfo* cache() { return &cache_; diff --git a/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc b/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc index f1a80ae5..24649bd 100644 --- a/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc +++ b/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc @@ -11,7 +11,6 @@ #include "chrome/browser/ui/views/accessibility_event_router_views.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/test/base/testing_profile.h" -#include "chrome/test/testing_browser_process_test.h" #include "content/common/notification_registrar.h" #include "content/common/notification_service.h" #include "testing/gtest/include/gtest/gtest.h" @@ -90,7 +89,7 @@ class AccessibilityWindowDelegate : public views::WidgetDelegate { }; class AccessibilityEventRouterViewsTest - : public TestingBrowserProcessTest, + : public testing::Test, public NotificationObserver { public: virtual void SetUp() { diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_test.cc index 0a99146..a4cc211 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_test.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_test.cc @@ -14,7 +14,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/views/bookmarks/bookmark_context_menu.h" #include "chrome/test/base/testing_profile.h" -#include "chrome/test/testing_browser_process_test.h" #include "content/browser/browser_thread.h" #include "content/browser/tab_contents/page_navigator.h" #include "grit/generated_resources.h" @@ -49,7 +48,7 @@ class TestingPageNavigator : public PageNavigator { } // namespace -class BookmarkContextMenuTest : public TestingBrowserProcessTest { +class BookmarkContextMenuTest : public testing::Test { public: BookmarkContextMenuTest() : ui_thread_(BrowserThread::UI, &message_loop_), diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc index 90163ec..5d7aaa8 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc @@ -11,7 +11,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/views/bookmarks/bookmark_editor_view.h" #include "chrome/test/base/testing_profile.h" -#include "chrome/test/testing_browser_process_test.h" #include "content/browser/browser_thread.h" #include "testing/gtest/include/gtest/gtest.h" @@ -20,7 +19,7 @@ using base::TimeDelta; // Base class for bookmark editor tests. Creates a BookmarkModel and populates // it with test data. -class BookmarkEditorViewTest : public TestingBrowserProcessTest { +class BookmarkEditorViewTest : public testing::Test { public: BookmarkEditorViewTest() : ui_thread_(BrowserThread::UI, &message_loop_), diff --git a/chrome/browser/ui/views/extensions/browser_action_drag_data_unittest.cc b/chrome/browser/ui/views/extensions/browser_action_drag_data_unittest.cc index 36966f4..7e57cee 100644 --- a/chrome/browser/ui/views/extensions/browser_action_drag_data_unittest.cc +++ b/chrome/browser/ui/views/extensions/browser_action_drag_data_unittest.cc @@ -5,7 +5,6 @@ #include "base/pickle.h" #include "chrome/browser/ui/views/extensions/browser_action_drag_data.h" #include "chrome/test/base/testing_profile.h" -#include "chrome/test/testing_browser_process_test.h" #include "googleurl/src/gurl.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/dragdrop/os_exchange_data.h" @@ -20,7 +19,7 @@ ui::OSExchangeData::Provider* CloneProvider(const ui::OSExchangeData& data) { } // namespace -typedef TestingBrowserProcessTest BrowserActionDragDataTest; +typedef testing::Test BrowserActionDragDataTest; TEST_F(BrowserActionDragDataTest, ArbitraryFormat) { TestingProfile profile; diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index baa136e..034408f 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1509,6 +1509,8 @@ 'browser/net/url_fixer_upper_unittest.cc', 'browser/net/url_info_unittest.cc', 'browser/notifications/desktop_notification_service_unittest.cc', + 'browser/notifications/desktop_notifications_unittest.cc', + 'browser/notifications/desktop_notifications_unittest.h', 'browser/notifications/notification_exceptions_table_model_unittest.cc', 'browser/notifications/notifications_prefs_cache_unittest.cc', 'browser/parsers/metadata_parser_filebase_unittest.cc', @@ -2112,6 +2114,7 @@ }], ['chromeos==1', { 'sources/': [ + ['exclude', '^browser/notifications/desktop_notifications_unittest.cc'], ['exclude', '^browser/password_manager/native_backend_gnome_x_unittest.cc'], ['exclude', '^browser/renderer_host/gtk_key_bindings_handler_unittest.cc'], # TODO(thestig) Enable PrintPreviewUI tests on CrOS when @@ -2556,8 +2559,6 @@ 'browser/magic_iframe_browsertest.cc', 'browser/net/cookie_policy_browsertest.cc', 'browser/net/ftp_browsertest.cc', - 'browser/notifications/desktop_notifications_unittest.cc', - 'browser/notifications/desktop_notifications_unittest.h', 'browser/plugin_data_remover_browsertest.cc', 'browser/policy/device_management_backend_mock.cc', 'browser/policy/device_management_backend_mock.h', @@ -2669,7 +2670,6 @@ ], }, { #else: OS == "chromeos" 'sources!': [ - 'browser/notifications/desktop_notifications_unittest.cc', 'browser/service/service_process_control_browsertest.cc', 'browser/ui/webui/print_preview.js', ], diff --git a/chrome/test/base/chrome_test_suite.cc b/chrome/test/base/chrome_test_suite.cc index 50f962e..e177b43 100644 --- a/chrome/test/base/chrome_test_suite.cc +++ b/chrome/test/base/chrome_test_suite.cc @@ -110,11 +110,7 @@ void ChromeTestSuite::Initialize() { chrome::RegisterPathProvider(); content::RegisterPathProvider(); ui::RegisterPathProvider(); - -#if !defined(OS_WIN) - // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. g_browser_process = new TestingBrowserProcess; -#endif if (!browser_dir_.empty()) { PathService::Override(base::DIR_EXE, browser_dir_); @@ -160,11 +156,8 @@ void ChromeTestSuite::Shutdown() { base::mac::SetOverrideAppBundle(NULL); #endif -#if !defined(OS_WIN) - // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. delete g_browser_process; g_browser_process = NULL; -#endif // Tear down shared StatsTable; prevents unit_tests from leaking it. base::StatsTable::set_current(NULL); diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc index 4c26825..ff23d0b 100644 --- a/chrome/test/base/in_process_browser_test.cc +++ b/chrome/test/base/in_process_browser_test.cc @@ -94,17 +94,10 @@ void InProcessBrowserTest::SetUp() { ASSERT_TRUE(CreateUserDataDirectory()) << "Could not create user data directory."; -#if defined(OS_WIN) - // This is not really Windows-specific, the transition is just being done - // in stages, and Windows is first. See below for more info. - DCHECK(!g_browser_process); -#else - // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. // The unit test suite creates a testingbrowser, but we want the real thing. // Delete the current one. We'll install the testing one in TearDown. delete g_browser_process; g_browser_process = NULL; -#endif // Allow subclasses the opportunity to make changes to the default user data // dir before running any tests. @@ -225,15 +218,9 @@ bool InProcessBrowserTest::CreateUserDataDirectory() { } void InProcessBrowserTest::TearDown() { -#if defined(OS_WIN) - // This is not really Windows-specific, the transition is just being done - // in stages, and Windows is first. See below for more info. - DCHECK(!g_browser_process); -#else // Reinstall testing browser process. delete g_browser_process; g_browser_process = new TestingBrowserProcess(); -#endif browser_shutdown::delete_resources_on_shutdown = true; diff --git a/chrome/test/testing_browser_process.cc b/chrome/test/testing_browser_process.cc index f707d8e..244a3ff 100644 --- a/chrome/test/testing_browser_process.cc +++ b/chrome/test/testing_browser_process.cc @@ -269,11 +269,6 @@ void TestingBrowserProcess::SetDevToolsManager(DevToolsManager* manager) { } ScopedTestingBrowserProcess::ScopedTestingBrowserProcess() { -#if defined(OS_WIN) - // This is not really Windows-specific, the transition is just being done - // in stages, and Windows is first. See below for more info. - DCHECK(!g_browser_process); -#else // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. // ChromeTestSuite sets up a global TestingBrowserProcess // for all tests. We need to get rid of it, because it contains @@ -281,7 +276,7 @@ ScopedTestingBrowserProcess::ScopedTestingBrowserProcess() { // per thread. DCHECK(g_browser_process); delete g_browser_process; -#endif + browser_process_.reset(new TestingBrowserProcess); g_browser_process = browser_process_.get(); } @@ -289,15 +284,9 @@ ScopedTestingBrowserProcess::ScopedTestingBrowserProcess() { ScopedTestingBrowserProcess::~ScopedTestingBrowserProcess() { DCHECK_EQ(browser_process_.get(), g_browser_process); -#if defined(OS_WIN) - // This is not really Windows-specific, the transition is just being done - // in stages, and Windows is first. See below for more info. - g_browser_process = NULL; -#else // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. // After the transition is over, we should just // reset |g_browser_process| to NULL. browser_process_.reset(); g_browser_process = new TestingBrowserProcess(); -#endif } |