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

Unified Diff: content/browser/leveldb_wrapper_impl_unittest.cc

Issue 2695333002: Mojo C++ bindings: remove usage of AssociatedGroup from content/ (Closed)
Patch Set: . Created 3 years, 10 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
Index: content/browser/leveldb_wrapper_impl_unittest.cc
diff --git a/content/browser/leveldb_wrapper_impl_unittest.cc b/content/browser/leveldb_wrapper_impl_unittest.cc
index 012d436305d9f77bf74bb94656f80615876da214..c47fa313310016f85a6f512748c952f17e44f440 100644
--- a/content/browser/leveldb_wrapper_impl_unittest.cc
+++ b/content/browser/leveldb_wrapper_impl_unittest.cc
@@ -27,13 +27,10 @@ const size_t kTestSizeLimit = 512;
class GetAllCallback : public mojom::LevelDBWrapperGetAllCallback {
public:
static mojom::LevelDBWrapperGetAllCallbackAssociatedPtrInfo CreateAndBind(
- mojo::AssociatedGroup* associated_group,
bool* result,
const base::Closure& callback) {
mojom::LevelDBWrapperGetAllCallbackAssociatedPtrInfo ptr_info;
- mojom::LevelDBWrapperGetAllCallbackAssociatedRequest request;
- associated_group->CreateAssociatedInterface(
- mojo::AssociatedGroup::WILL_PASS_PTR, &ptr_info, &request);
+ auto request = mojo::MakeRequest(&ptr_info);
mojo::MakeStrongAssociatedBinding(
base::WrapUnique(new GetAllCallback(result, callback)),
std::move(request));
@@ -109,7 +106,7 @@ class LevelDBWrapperImplTest : public testing::Test,
level_db_wrapper_.Bind(mojo::MakeRequest(&level_db_wrapper_ptr_));
mojom::LevelDBObserverAssociatedPtrInfo ptr_info;
- observer_binding_.Bind(&ptr_info, associated_group());
+ observer_binding_.Bind(&ptr_info);
level_db_wrapper_ptr_->AddObserver(std::move(ptr_info));
}
@@ -135,9 +132,6 @@ class LevelDBWrapperImplTest : public testing::Test,
void clear_mock_data() { mock_data_.clear(); }
mojom::LevelDBWrapper* wrapper() { return level_db_wrapper_ptr_.get(); }
- mojo::AssociatedGroup* associated_group() {
- return level_db_wrapper_ptr_.associated_group();
- }
bool GetSync(const std::vector<uint8_t>& key, std::vector<uint8_t>* result) {
base::RunLoop run_loop;
@@ -256,9 +250,8 @@ TEST_F(LevelDBWrapperImplTest, GetAll) {
base::RunLoop run_loop;
bool result = false;
EXPECT_TRUE(wrapper()->GetAll(
- GetAllCallback::CreateAndBind(associated_group(), &result,
- run_loop.QuitClosure()),
- &status, &data));
+ GetAllCallback::CreateAndBind(&result, run_loop.QuitClosure()), &status,
+ &data));
EXPECT_EQ(leveldb::mojom::DatabaseError::OK, status);
EXPECT_EQ(2u, data.size());
EXPECT_FALSE(result);
« no previous file with comments | « content/browser/indexed_db/indexed_db_callbacks.cc ('k') | content/browser/loader/downloaded_temp_file_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698