blob: 04499496b2b7f54e4c300bf8ba5d6e2767ff1094 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// 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 "base/macros.h"
#include "components/filesystem/public/interfaces/file_system.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/shell/public/cpp/application_test_base.h"
namespace filesystem {
class FilesTestBase : public mojo::test::ApplicationTestBase,
public filesystem::FileSystemClient {
public:
FilesTestBase();
~FilesTestBase() override;
// Overridden from mojo::test::ApplicationTestBase:
void SetUp() override;
// Overridden from FileSystemClient:
void OnFileSystemShutdown() override;
protected:
// Note: This has an out parameter rather than returning the |DirectoryPtr|,
// since |ASSERT_...()| doesn't work with return values.
void GetTemporaryRoot(DirectoryPtr* directory);
FileSystemPtr& files() { return files_; }
private:
mojo::Binding<filesystem::FileSystemClient> binding_;
FileSystemPtr files_;
DISALLOW_COPY_AND_ASSIGN(FilesTestBase);
};
} // namespace filesystem
#endif // COMPONENTS_FILESYSTEM_FILES_TEST_BASE_H_
|