#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/storage_monitor/storage_monitor_linux.h"
#include <mntent.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <memory>
#include <string>
#include "base/check.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/test/task_environment.h"
#include "components/storage_monitor/mock_removable_storage_observer.h"
#include "components/storage_monitor/removable_device_constants.h"
#include "components/storage_monitor/storage_info.h"
#include "components/storage_monitor/storage_monitor.h"
#include "components/storage_monitor/test_storage_monitor.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace storage_monitor {
namespace {
const char kValidFS[] = …;
const char kInvalidFS[] = …;
const char kInvalidPath[] = …;
const char kDeviceDCIM1[] = …;
const char kDeviceDCIM2[] = …;
const char kDeviceDCIM3[] = …;
const char kDeviceNoDCIM[] = …;
const char kDeviceFixed[] = …;
const char kInvalidDevice[] = …;
const char kMountPointA[] = …;
const char kMountPointB[] = …;
const char kMountPointC[] = …;
struct TestDeviceData { … };
const TestDeviceData kTestDeviceData[] = …;
std::unique_ptr<StorageInfo> GetDeviceInfo(const base::FilePath& device_path,
const base::FilePath& mount_point) { … }
uint64_t GetDevicePartitionSize(const std::string& device) { … }
std::string GetDeviceId(const std::string& device) { … }
class TestStorageMonitorLinux : public StorageMonitorLinux { … };
class StorageMonitorLinuxTest : public testing::Test { … };
TEST_F(StorageMonitorLinuxTest, DISABLED_BasicAttachDetach) { … }
TEST_F(StorageMonitorLinuxTest, Removable) { … }
TEST_F(StorageMonitorLinuxTest, SwapMountPoints) { … }
TEST_F(StorageMonitorLinuxTest, MultiDevicesMultiMountPoints) { … }
TEST_F(StorageMonitorLinuxTest, MultipleMountPointsWithNonDCIMDevices) { … }
TEST_F(StorageMonitorLinuxTest, DeviceLookUp) { … }
TEST_F(StorageMonitorLinuxTest, DevicePartitionSize) { … }
}
}