chromium/third_party/webrtc/test/testsupport/file_utils_unittest.cc

/*
 *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include "test/testsupport/file_utils.h"

#include <stdio.h>

#include <algorithm>
#include <fstream>
#include <string>

#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "rtc_base/checks.h"
#include "rtc_base/crypto_random.h"
#include "test/gmock.h"
#include "test/gtest.h"

#ifdef WIN32
#define chdir
#endif

EndsWith;

namespace webrtc {
namespace test {

namespace {

std::string Path(absl::string_view path) {}

// Remove files and directories in a directory non-recursively and writes the
// number of deleted items in `num_deleted_entries`.
void CleanDir(absl::string_view dir, size_t* num_deleted_entries) {}

void WriteStringInFile(absl::string_view what, absl::string_view file_path) {}

}  // namespace

// Test fixture to restore the working directory between each test, since some
// of them change it with chdir during execution (not restored by the
// gtest framework).
class FileUtilsTest : public ::testing::Test {};

std::string FileUtilsTest::original_working_dir_ =;

// The location will vary depending on where the webrtc checkout is on the
// system, but it should end as described above and be an absolute path.
std::string ExpectedRootDirByPlatform() {}

TEST_F(FileUtilsTest, OutputPathFromUnchangedWorkingDir) {}

// Tests with current working directory set to a directory higher up in the
// directory tree than the project root dir.
TEST_F(FileUtilsTest, OutputPathFromRootWorkingDir) {}

TEST_F(FileUtilsTest, RandomOutputPathFromUnchangedWorkingDir) {}

TEST_F(FileUtilsTest, RandomOutputPathFromRootWorkingDir) {}

TEST_F(FileUtilsTest, TempFilename) {}

TEST_F(FileUtilsTest, GenerateTempFilename) {}

// Only tests that the code executes
#if defined(WEBRTC_IOS)
#define MAYBE_CreateDir
#else
#define MAYBE_CreateDir
#endif
TEST_F(FileUtilsTest, MAYBE_CreateDir) {}

TEST_F(FileUtilsTest, WorkingDirReturnsValue) {}

TEST_F(FileUtilsTest, ResourcePathReturnsCorrectPath) {}

TEST_F(FileUtilsTest, ResourcePathFromRootWorkingDir) {}

TEST_F(FileUtilsTest, GetFileSizeExistingFile) {}

TEST_F(FileUtilsTest, GetFileSizeNonExistingFile) {}

TEST_F(FileUtilsTest, DirExists) {}

TEST_F(FileUtilsTest, WriteReadDeleteFilesAndDirs) {}

TEST_F(FileUtilsTest, DirNameStripsFilename) {}

TEST_F(FileUtilsTest, DirNameKeepsStrippingRightmostPathComponent) {}

TEST_F(FileUtilsTest, DirNameDoesntCareIfAPathEndsInPathSeparator) {}

TEST_F(FileUtilsTest, DirNameStopsAtRoot) {}

TEST_F(FileUtilsTest, JoinFilenameDoesNotAppendExtraPathDelimiterIfExists) {}

TEST_F(FileUtilsTest, JoinFilenameAppendsPathDelimiterIfMissing) {}

}  // namespace test
}  // namespace webrtc