summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
Diffstat (limited to 'o3d')
-rw-r--r--o3d/utils/cross/temporary_file.cc8
-rw-r--r--o3d/utils/cross/temporary_file_test.cc15
2 files changed, 18 insertions, 5 deletions
diff --git a/o3d/utils/cross/temporary_file.cc b/o3d/utils/cross/temporary_file.cc
index afb4b61..fb9e8de 100644
--- a/o3d/utils/cross/temporary_file.cc
+++ b/o3d/utils/cross/temporary_file.cc
@@ -39,6 +39,12 @@
namespace o3d {
+// TODO(gspencer): Remove this. This is a hack to prevent needing to
+// merge all of chrome's base code into the google code O3D tree.
+#ifndef GYP_BUILD
+#define CreateTemporaryFile CreateTemporaryFileName
+#endif
+
namespace {
void DeletePath(const FilePath& path) {
if (!path.empty()) {
@@ -57,7 +63,7 @@ TemporaryFile::TemporaryFile(const FilePath& file_to_manage)
bool TemporaryFile::Create(TemporaryFile* temporary_file) {
FilePath temporary_path;
- if (file_util::CreateTemporaryFileName(&temporary_path)) {
+ if (file_util::CreateTemporaryFile(&temporary_path)) {
temporary_file->Reset(temporary_path);
} else {
return false;
diff --git a/o3d/utils/cross/temporary_file_test.cc b/o3d/utils/cross/temporary_file_test.cc
index bdbe492..d9ae361 100644
--- a/o3d/utils/cross/temporary_file_test.cc
+++ b/o3d/utils/cross/temporary_file_test.cc
@@ -40,6 +40,13 @@
namespace o3d {
+// TODO(gspencer): Remove this once scons build is dead. This is a
+// hack to prevent needing to merge all of chrome's base code into the
+// google code O3D tree.
+#ifndef GYP_BUILD
+#define CreateTemporaryFile CreateTemporaryFileName
+#endif
+
class TemporaryFileTest : public testing::Test {
};
@@ -50,7 +57,7 @@ TEST_F(TemporaryFileTest, BasicConstruction) {
TEST_F(TemporaryFileTest, BasicFunction) {
FilePath path;
- file_util::CreateTemporaryFileName(&path);
+ file_util::CreateTemporaryFile(&path);
EXPECT_TRUE(file_util::PathExists(path));
{
TemporaryFile temporary_file(path);
@@ -64,8 +71,8 @@ TEST_F(TemporaryFileTest, BasicFunction) {
TEST_F(TemporaryFileTest, Reset) {
FilePath path;
FilePath path1;
- file_util::CreateTemporaryFileName(&path);
- file_util::CreateTemporaryFileName(&path1);
+ file_util::CreateTemporaryFile(&path);
+ file_util::CreateTemporaryFile(&path1);
EXPECT_TRUE(file_util::PathExists(path));
EXPECT_TRUE(file_util::PathExists(path1));
{
@@ -86,7 +93,7 @@ TEST_F(TemporaryFileTest, Reset) {
TEST_F(TemporaryFileTest, Release) {
FilePath path;
- file_util::CreateTemporaryFileName(&path);
+ file_util::CreateTemporaryFile(&path);
EXPECT_TRUE(file_util::PathExists(path));
{
TemporaryFile temporary_file(path);