From 79457797443d45463b92abcda0124706bdf1aff5 Mon Sep 17 00:00:00 2001 From: "phajdan.jr@chromium.org" Date: Tue, 15 Feb 2011 07:35:37 +0000 Subject: 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 Review URL: http://codereview.chromium.org/6478005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74926 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/testing_browser_process_test.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 chrome/test/testing_browser_process_test.h (limited to 'chrome/test/testing_browser_process_test.h') diff --git a/chrome/test/testing_browser_process_test.h b/chrome/test/testing_browser_process_test.h new file mode 100644 index 0000000..0bdb417 --- /dev/null +++ b/chrome/test/testing_browser_process_test.h @@ -0,0 +1,18 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_TEST_TESTING_BROWSER_PROCESS_TEST_H_ +#define CHROME_TEST_TESTING_BROWSER_PROCESS_TEST_H_ +#pragma once + +#include "chrome/test/testing_browser_process.h" +#include "testing/gtest/include/gtest/gtest.h" + +// Base class for tests that need |g_browser_process| to be initialized. +class TestingBrowserProcessTest : public testing::Test { + private: + ScopedTestingBrowserProcess browser_process_; +}; + +#endif // CHROME_TEST_TESTING_BROWSER_PROCESS_TEST_H_ -- cgit v1.1