From 3d93375bc82a42fdb7d60037903a10a3c3a5cabd Mon Sep 17 00:00:00 2001 From: "pastarmovj@chromium.org" Date: Tue, 9 Oct 2012 16:24:13 +0000 Subject: Update all unit tests that override paths to use the ScopedPathOverride. This makes sure that overrides are removed when tests are over and don't pollute the global singleton state shared by all tests. BUG=149161 TEST=All unit tests should still pass. Review URL: https://chromiumcodereview.appspot.com/10947008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160855 0039d316-1c4b-4281-b951-d872f2087c98 --- base/test/scoped_path_override.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'base') diff --git a/base/test/scoped_path_override.h b/base/test/scoped_path_override.h index ee990a29..cf5c810 100644 --- a/base/test/scoped_path_override.h +++ b/base/test/scoped_path_override.h @@ -12,13 +12,15 @@ class FilePath; namespace base { -// Sets the given |locale| on construction, and restores the previous locale -// on destruction. This class is intended to be used by tests that need to -// override paths to ensure their overrides are properly handled and reverted -// when the scope of the test is left. +// Sets a path override on construction, and removes it when the object goes out +// of scope. This class is intended to be used by tests that need to override +// paths to ensure their overrides are properly handled and reverted when the +// scope of the test is left. class ScopedPathOverride { public: + // Contructor that intializes the override to a scoped temp directory. explicit ScopedPathOverride(int key); + // Constructor that would use a path provided by the user. ScopedPathOverride(int key, const FilePath& dir); ~ScopedPathOverride(); -- cgit v1.1