Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: components/filesystem/files_test_base.h

Issue 2123363002: ShellTest -> ServiceTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/filesystem/BUILD.gn ('k') | components/filesystem/files_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "components/filesystem/public/interfaces/file_system.mojom.h" 12 #include "components/filesystem/public/interfaces/file_system.mojom.h"
13 #include "mojo/public/cpp/bindings/binding.h" 13 #include "mojo/public/cpp/bindings/binding.h"
14 #include "services/shell/public/cpp/shell_test.h" 14 #include "services/shell/public/cpp/service_test.h"
15 15
16 namespace filesystem { 16 namespace filesystem {
17 17
18 template <typename... Args> void IgnoreAllArgs(Args&&... args) {} 18 template <typename... Args> void IgnoreAllArgs(Args&&... args) {}
19 19
20 template <typename... Args> 20 template <typename... Args>
21 void DoCaptures(Args*... out_args, Args... in_args) { 21 void DoCaptures(Args*... out_args, Args... in_args) {
22 IgnoreAllArgs((*out_args = std::move(in_args))...); 22 IgnoreAllArgs((*out_args = std::move(in_args))...);
23 } 23 }
24 24
25 template <typename T1> 25 template <typename T1>
26 base::Callback<void(T1)> Capture(T1* t1) { 26 base::Callback<void(T1)> Capture(T1* t1) {
27 return base::Bind(&DoCaptures<T1>, t1); 27 return base::Bind(&DoCaptures<T1>, t1);
28 } 28 }
29 29
30 template <typename T1, typename T2> 30 template <typename T1, typename T2>
31 base::Callback<void(T1, T2)> Capture(T1* t1, T2* t2) { 31 base::Callback<void(T1, T2)> Capture(T1* t1, T2* t2) {
32 return base::Bind(&DoCaptures<T1, T2>, t1, t2); 32 return base::Bind(&DoCaptures<T1, T2>, t1, t2);
33 } 33 }
34 34
35 template <typename T1, typename T2, typename T3> 35 template <typename T1, typename T2, typename T3>
36 base::Callback<void(T1, T2, T3)> Capture(T1* t1, T2* t2, T3* t3) { 36 base::Callback<void(T1, T2, T3)> Capture(T1* t1, T2* t2, T3* t3) {
37 return base::Bind(&DoCaptures<T1, T2, T3>, t1, t2, t3); 37 return base::Bind(&DoCaptures<T1, T2, T3>, t1, t2, t3);
38 } 38 }
39 39
40 class FilesTestBase : public shell::test::ShellTest { 40 class FilesTestBase : public shell::test::ServiceTest {
41 public: 41 public:
42 FilesTestBase(); 42 FilesTestBase();
43 ~FilesTestBase() override; 43 ~FilesTestBase() override;
44 44
45 // Overridden from shell::test::ShellTest: 45 // Overridden from shell::test::ServiceTest:
46 void SetUp() override; 46 void SetUp() override;
47 47
48 protected: 48 protected:
49 // Note: This has an out parameter rather than returning the |DirectoryPtr|, 49 // Note: This has an out parameter rather than returning the |DirectoryPtr|,
50 // since |ASSERT_...()| doesn't work with return values. 50 // since |ASSERT_...()| doesn't work with return values.
51 void GetTemporaryRoot(mojom::DirectoryPtr* directory); 51 void GetTemporaryRoot(mojom::DirectoryPtr* directory);
52 52
53 mojom::FileSystemPtr& files() { return files_; } 53 mojom::FileSystemPtr& files() { return files_; }
54 54
55 private: 55 private:
56 mojom::FileSystemPtr files_; 56 mojom::FileSystemPtr files_;
57 57
58 DISALLOW_COPY_AND_ASSIGN(FilesTestBase); 58 DISALLOW_COPY_AND_ASSIGN(FilesTestBase);
59 }; 59 };
60 60
61 } // namespace filesystem 61 } // namespace filesystem
62 62
63 #endif // COMPONENTS_FILESYSTEM_FILES_TEST_BASE_H_ 63 #endif // COMPONENTS_FILESYSTEM_FILES_TEST_BASE_H_
OLDNEW
« no previous file with comments | « components/filesystem/BUILD.gn ('k') | components/filesystem/files_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698