summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorpastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-09 16:24:13 +0000
committerpastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-09 16:24:13 +0000
commit3d93375bc82a42fdb7d60037903a10a3c3a5cabd (patch)
tree30e22daf84bdf55b98606e73da3b533c9dddf65c /base
parent3db37a849fa96a6b16cd47b96a81cfd2b6d01182 (diff)
downloadchromium_src-3d93375bc82a42fdb7d60037903a10a3c3a5cabd.zip
chromium_src-3d93375bc82a42fdb7d60037903a10a3c3a5cabd.tar.gz
chromium_src-3d93375bc82a42fdb7d60037903a10a3c3a5cabd.tar.bz2
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
Diffstat (limited to 'base')
-rw-r--r--base/test/scoped_path_override.h10
1 files changed, 6 insertions, 4 deletions
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();