Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / components / filesystem / files_test_base.h
blob43ffccfa1e372666531c9f10ed8bdf905c2eb21c
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_FILESYSTEM_FILES_TEST_BASE_H_
6 #define COMPONENTS_FILESYSTEM_FILES_TEST_BASE_H_
8 #include "base/macros.h"
9 #include "components/filesystem/public/interfaces/file_system.mojom.h"
10 #include "mojo/application/public/cpp/application_test_base.h"
11 #include "mojo/public/cpp/bindings/binding.h"
13 namespace filesystem {
15 class FilesTestBase : public mojo::test::ApplicationTestBase,
16 public filesystem::FileSystemClient {
17 public:
18 FilesTestBase();
19 ~FilesTestBase() override;
21 // Overridden from mojo::test::ApplicationTestBase:
22 void SetUp() override;
24 // Overridden from FileSystemClient:
25 void OnFileSystemShutdown() override;
27 protected:
28 // Note: This has an out parameter rather than returning the |DirectoryPtr|,
29 // since |ASSERT_...()| doesn't work with return values.
30 void GetTemporaryRoot(DirectoryPtr* directory);
32 FileSystemPtr& files() { return files_; }
34 private:
35 mojo::Binding<filesystem::FileSystemClient> binding_;
36 FileSystemPtr files_;
38 DISALLOW_COPY_AND_ASSIGN(FilesTestBase);
41 } // namespace filesystem
43 #endif // COMPONENTS_FILESYSTEM_FILES_TEST_BASE_H_