Index: components/leveldb/leveldb_service_unittest.cc |
diff --git a/components/leveldb/leveldb_service_unittest.cc b/components/leveldb/leveldb_service_unittest.cc |
index 9e510aea9bb503171288132324ef30ad1261b5ff..6a738c6851dc2917e39d1e83a75f5c20e7354024 100644 |
--- a/components/leveldb/leveldb_service_unittest.cc |
+++ b/components/leveldb/leveldb_service_unittest.cc |
@@ -10,16 +10,27 @@ |
#include "components/leveldb/public/interfaces/leveldb.mojom.h" |
#include "mojo/common/common_type_converters.h" |
#include "mojo/public/cpp/bindings/binding_set.h" |
-#include "mojo/util/capture_util.h" |
#include "services/shell/public/cpp/shell_connection.h" |
#include "services/shell/public/cpp/shell_test.h" |
using filesystem::mojom::FileError; |
-using mojo::Capture; |
namespace leveldb { |
namespace { |
+template <typename T1> |
+mojo::Callback<void(T1)> Capture(T1* t1) { |
+ return [t1](T1 got_t1) { *t1 = std::move(got_t1); }; |
+} |
+ |
+template <typename T1, typename T2> |
+mojo::Callback<void(T1, T2)> Capture(T1* t1, T2* t2) { |
+ return [t1, t2](T1 got_t1, T2 got_t2) { |
+ *t1 = std::move(got_t1); |
+ *t2 = std::move(got_t2); |
+ }; |
+} |
+ |
class LevelDBServiceTest : public shell::test::ShellTest { |
public: |
LevelDBServiceTest() : ShellTest("exe:leveldb_service_unittests") {} |
@@ -43,7 +54,7 @@ class LevelDBServiceTest : public shell::test::ShellTest { |
// since |ASSERT_...()| doesn't work with return values. |
void GetTempDirectory(filesystem::mojom::DirectoryPtr* directory) { |
FileError error = FileError::FAILED; |
- files()->OpenTempDirectory(GetProxy(directory), mojo::Capture(&error)); |
+ files()->OpenTempDirectory(GetProxy(directory), Capture(&error)); |
ASSERT_TRUE(files().WaitForIncomingResponse()); |
ASSERT_EQ(FileError::OK, error); |
} |