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"
12 namespace filesystem
{
14 class FilesTestBase
: public mojo::test::ApplicationTestBase
,
15 public filesystem::FileSystemClient
{
18 ~FilesTestBase() override
;
20 // Overridden from mojo::test::ApplicationTestBase:
21 void SetUp() override
;
23 // Overridden from FileSystemClient:
24 void OnFileSystemShutdown() override
;
27 // Note: This has an out parameter rather than returning the |DirectoryPtr|,
28 // since |ASSERT_...()| doesn't work with return values.
29 void GetTemporaryRoot(DirectoryPtr
* directory
);
31 FileSystemPtr
& files() { return files_
; }
34 mojo::Binding
<filesystem::FileSystemClient
> binding_
;
37 DISALLOW_COPY_AND_ASSIGN(FilesTestBase
);
40 } // namespace filesystem
42 #endif // COMPONENTS_FILESYSTEM_FILES_TEST_BASE_H_