OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_TEST_UTIL_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_TEST_UTIL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class RunLoop; | 15 class RunLoop; |
16 } | 16 } |
17 | 17 |
18 namespace fileapi { | 18 namespace storage { |
19 class FileSystemURL; | 19 class FileSystemURL; |
20 } | 20 } |
21 | 21 |
22 namespace sync_file_system { | 22 namespace sync_file_system { |
23 | 23 |
24 template <typename T> | 24 template <typename T> |
25 struct TypeTraits { | 25 struct TypeTraits { |
26 typedef T ParamType; | 26 typedef T ParamType; |
27 }; | 27 }; |
28 | 28 |
29 template <> | 29 template <> |
30 struct TypeTraits<fileapi::FileSystemURL> { | 30 struct TypeTraits<storage::FileSystemURL> { |
31 typedef const fileapi::FileSystemURL& ParamType; | 31 typedef const storage::FileSystemURL& ParamType; |
32 }; | 32 }; |
33 | 33 |
34 template <typename T> | 34 template <typename T> |
35 struct TypeTraits<std::vector<T> > { | 35 struct TypeTraits<std::vector<T> > { |
36 typedef const std::vector<T>& ParamType; | 36 typedef const std::vector<T>& ParamType; |
37 }; | 37 }; |
38 | 38 |
39 template <typename Arg1, typename Arg2, typename Param1, typename Param2> | 39 template <typename Arg1, typename Arg2, typename Param1, typename Param2> |
40 void ReceiveResult2(bool* done, | 40 void ReceiveResult2(bool* done, |
41 Arg1* arg1_out, | 41 Arg1* arg1_out, |
(...skipping 24 matching lines...) Expand all Loading... |
66 typedef typename TypeTraits<Arg1>::ParamType Param1; | 66 typedef typename TypeTraits<Arg1>::ParamType Param1; |
67 typedef typename TypeTraits<Arg2>::ParamType Param2; | 67 typedef typename TypeTraits<Arg2>::ParamType Param2; |
68 return base::Bind(&ReceiveResult2<Arg1, Arg2, Param1, Param2>, | 68 return base::Bind(&ReceiveResult2<Arg1, Arg2, Param1, Param2>, |
69 base::Owned(new bool(false)), | 69 base::Owned(new bool(false)), |
70 arg1_out, arg2_out); | 70 arg1_out, arg2_out); |
71 } | 71 } |
72 | 72 |
73 } // namespace sync_file_system | 73 } // namespace sync_file_system |
74 | 74 |
75 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_TEST_UTIL_H_ | 75 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_TEST_UTIL_H_ |
OLD | NEW |