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

Side by Side Diff: mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc

Issue 2080513002: Deletes mojo::Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include <stdint.h> 5 #include <stdint.h>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h"
9 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 11 #include "base/run_loop.h"
11 #include "mojo/public/cpp/bindings/binding.h" 12 #include "mojo/public/cpp/bindings/binding.h"
12 #include "mojo/public/cpp/bindings/strong_binding.h" 13 #include "mojo/public/cpp/bindings/strong_binding.h"
13 #include "mojo/public/interfaces/bindings/tests/math_calculator.mojom.h" 14 #include "mojo/public/interfaces/bindings/tests/math_calculator.mojom.h"
14 #include "mojo/public/interfaces/bindings/tests/sample_interfaces.mojom.h" 15 #include "mojo/public/interfaces/bindings/tests/sample_interfaces.mojom.h"
15 #include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h" 16 #include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h"
16 #include "mojo/public/interfaces/bindings/tests/scoping.mojom.h" 17 #include "mojo/public/interfaces/bindings/tests/scoping.mojom.h"
17 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
18 19
19 namespace mojo { 20 namespace mojo {
20 namespace test { 21 namespace test {
21 namespace { 22 namespace {
22 23
23 typedef mojo::Callback<void(double)> CalcCallback; 24 typedef base::Callback<void(double)> CalcCallback;
24 25
25 class MathCalculatorImpl : public math::Calculator { 26 class MathCalculatorImpl : public math::Calculator {
26 public: 27 public:
27 explicit MathCalculatorImpl(InterfaceRequest<math::Calculator> request) 28 explicit MathCalculatorImpl(InterfaceRequest<math::Calculator> request)
28 : total_(0.0), binding_(this, std::move(request)) {} 29 : total_(0.0), binding_(this, std::move(request)) {}
29 ~MathCalculatorImpl() override {} 30 ~MathCalculatorImpl() override {}
30 31
31 void CloseMessagePipe() { binding_.Close(); } 32 void CloseMessagePipe() { binding_.Close(); }
32 33
33 void WaitForIncomingMethodCall() { binding_.WaitForIncomingMethodCall(); } 34 void WaitForIncomingMethodCall() { binding_.WaitForIncomingMethodCall(); }
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 bool called = false; 733 bool called = false;
733 base::RunLoop loop; 734 base::RunLoop loop;
734 ptr->Ping(base::Bind(&SetFlagAndRunClosure, &called, loop.QuitClosure())); 735 ptr->Ping(base::Bind(&SetFlagAndRunClosure, &called, loop.QuitClosure()));
735 loop.Run(); 736 loop.Run();
736 EXPECT_TRUE(called); 737 EXPECT_TRUE(called);
737 } 738 }
738 739
739 } // namespace 740 } // namespace
740 } // namespace test 741 } // namespace test
741 } // namespace mojo 742 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/handle_passing_unittest.cc ('k') | mojo/public/cpp/bindings/tests/request_response_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698