#include <memory>
#include <optional>
#include <vector>
#include "base/files/file.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_future.h"
#include "content/browser/media/cdm_storage_common.h"
#include "content/browser/media/media_license_manager.h"
#include "content/browser/storage_partition_impl.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_renderer_host.h"
#include "media/cdm/cdm_type.h"
#include "media/mojo/mojom/cdm_storage.mojom.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "url/gurl.h"
CdmFile;
CdmStorage;
namespace content {
namespace {
const media::CdmType kTestCdmType{ … };
const char kTestOrigin[] = …;
void SimulateNavigation(raw_ptr<RenderFrameHost, DanglingUntriaged>* rfh,
const GURL& url) { … }
}
class CdmStorageTest
: public RenderViewHostTestHarness,
public testing::WithParamInterface<std::tuple<bool, bool>> { … };
TEST_P(CdmStorageTest, InvalidFileName) { … }
TEST_P(CdmStorageTest, InvalidFileNameEmpty) { … }
TEST_P(CdmStorageTest, InvalidFileNameStartWithUnderscore) { … }
TEST_P(CdmStorageTest, InvalidFileNameTooLong) { … }
TEST_P(CdmStorageTest, OpenFile) { … }
TEST_P(CdmStorageTest, OpenFileLocked) { … }
TEST_P(CdmStorageTest, MultipleFiles) { … }
TEST_P(CdmStorageTest, WriteThenReadFile) { … }
TEST_P(CdmStorageTest, ReadThenWriteEmptyFile) { … }
TEST_P(CdmStorageTest, ParallelRead) { … }
TEST_P(CdmStorageTest, ParallelWrite) { … }
TEST_P(CdmStorageTest, VerifyMigrationWorks) { … }
INSTANTIATE_TEST_SUITE_P(…);
}