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