blob: 5bd768b352a14432f7d9b49882e10b210dff64bf [file] [log] [blame]
// Copyright 2015 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.
#include "mojo/edk/test/scoped_test_dir.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
namespace mojo {
namespace test {
ScopedTestDir::ScopedTestDir() {
CHECK(temp_dir_.CreateUniqueTempDir());
}
ScopedTestDir::~ScopedTestDir() {}
util::ScopedFILE ScopedTestDir::CreateFile() {
base::FilePath unused;
return util::ScopedFILE(
base::CreateAndOpenTemporaryFileInDir(temp_dir_.path(), &unused));
}
} // namespace test
} // namespace mojo