// 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. #ifndef COMPONENTS_FILESYSTEM_FILES_TEST_BASE_H_ #define COMPONENTS_FILESYSTEM_FILES_TEST_BASE_H_ #include #include "base/bind.h" #include "base/macros.h" #include "components/filesystem/public/interfaces/file_system.mojom.h" #include "mojo/public/cpp/bindings/binding.h" #include "services/service_manager/public/cpp/service_test.h" namespace filesystem { template void IgnoreAllArgs(Args&&... args) {} template void DoCaptures(Args*... out_args, Args... in_args) { IgnoreAllArgs((*out_args = std::move(in_args))...); } template base::Callback Capture(T1* t1) { return base::Bind(&DoCaptures, t1); } template base::Callback Capture(T1* t1, T2* t2) { return base::Bind(&DoCaptures, t1, t2); } template base::Callback Capture(T1* t1, T2* t2, T3* t3) { return base::Bind(&DoCaptures, t1, t2, t3); } class FilesTestBase : public service_manager::test::ServiceTest { public: FilesTestBase(); ~FilesTestBase() override; // Overridden from service_manager::test::ServiceTest: void SetUp() override; protected: // Note: This has an out parameter rather than returning the |DirectoryPtr|, // since |ASSERT_...()| doesn't work with return values. void GetTemporaryRoot(mojom::DirectoryPtr* directory); mojom::FileSystemPtr& files() { return files_; } private: mojom::FileSystemPtr files_; DISALLOW_COPY_AND_ASSIGN(FilesTestBase); }; } // namespace filesystem #endif // COMPONENTS_FILESYSTEM_FILES_TEST_BASE_H_