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

Unified Diff: components/leveldb/leveldb_service_unittest.cc

Issue 2008383002: Remove a bunch of stuff in //mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/filesystem/files_test_base.cc ('k') | components/leveldb/remote_iterator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « components/filesystem/files_test_base.cc ('k') | components/leveldb/remote_iterator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698