Bug 906734 - Put TestHarness.h profile directories under runcppunittest's temp directory. r=Waldo, a=test-only
authorTed Mielczarek <ted@mielczarek.org>
Tue, 20 Aug 2013 11:59:51 -0400
changeset 148434 af82c387aced05f3b7b62327b40ddbe8ed141148
parent 148433 a4186bd9159193d938dc4145c07fa41799ee31d4
child 148435 dc4285f36240706319954efd3b326e5acf938b75
push id2799
push userryanvm@gmail.com
push dateFri, 23 Aug 2013 20:44:41 +0000
treeherdermozilla-beta@dc4285f36240 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo, test-only
bugs906734
milestone24.0
Bug 906734 - Put TestHarness.h profile directories under runcppunittest's temp directory. r=Waldo, a=test-only
xpcom/tests/TestHarness.h
--- a/xpcom/tests/TestHarness.h
+++ b/xpcom/tests/TestHarness.h
@@ -160,18 +160,20 @@ class ScopedXPCOM : public nsIDirectoryS
     already_AddRefed<nsIFile> GetProfileDirectory()
     {
       if (mProfD) {
         nsCOMPtr<nsIFile> copy = mProfD;
         return copy.forget();
       }
 
       // Create a unique temporary folder to use for this test.
+      // Note that runcppunittests.py will run tests with a temp
+      // directory as the cwd, so just put something under that.
       nsCOMPtr<nsIFile> profD;
-      nsresult rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR,
+      nsresult rv = NS_GetSpecialDirectory(NS_OS_CURRENT_PROCESS_DIR,
                                            getter_AddRefs(profD));
       NS_ENSURE_SUCCESS(rv, nullptr);
 
       rv = profD->Append(NS_LITERAL_STRING("cpp-unit-profd"));
       NS_ENSURE_SUCCESS(rv, nullptr);
 
       rv = profD->CreateUnique(nsIFile::DIRECTORY_TYPE, 0755);
       NS_ENSURE_SUCCESS(rv, nullptr);