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

Side by Side Diff: components/arc/test/fake_arc_bridge_instance.h

Issue 2135223002: Use spin runloop instead of WaitForIncomingMethodCall() for test codes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase only Created 4 years, 5 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
« no previous file with comments | « no previous file | components/arc/test/fake_arc_bridge_instance.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_ 5 #ifndef COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_
6 #define COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_ 6 #define COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_
7 7
8 #include "base/callback_forward.h"
8 #include "base/macros.h" 9 #include "base/macros.h"
9 #include "components/arc/arc_bridge_service.h" 10 #include "components/arc/arc_bridge_service.h"
10 #include "components/arc/common/arc_bridge.mojom.h" 11 #include "components/arc/common/arc_bridge.mojom.h"
11 #include "mojo/public/cpp/bindings/binding.h" 12 #include "mojo/public/cpp/bindings/binding.h"
12 13
13 namespace arc { 14 namespace arc {
14 15
15 class FakeArcBridgeInstance : public mojom::ArcBridgeInstance { 16 class FakeArcBridgeInstance : public mojom::ArcBridgeInstance {
16 public: 17 public:
17 class Delegate { 18 class Delegate {
(...skipping 22 matching lines...) Expand all
40 41
41 // The number of times Init() has been called. 42 // The number of times Init() has been called.
42 int init_calls() const { return init_calls_; } 43 int init_calls() const { return init_calls_; }
43 44
44 // Stops the instance. 45 // Stops the instance.
45 void Stop(ArcBridgeService::StopReason reason); 46 void Stop(ArcBridgeService::StopReason reason);
46 47
47 private: 48 private:
48 Delegate* delegate_ = nullptr; 49 Delegate* delegate_ = nullptr;
49 50
51 // Keeps quit closure to wake the running nested RunLoop.
52 base::Closure quit_closure_;
53
50 // Mojo endpoints. 54 // Mojo endpoints.
51 mojo::Binding<mojom::ArcBridgeInstance> binding_; 55 mojo::Binding<mojom::ArcBridgeInstance> binding_;
52 mojom::ArcBridgeHostPtr host_ptr_; 56 mojom::ArcBridgeHostPtr host_ptr_;
53 int init_calls_ = 0; 57 int init_calls_ = 0;
54 58
55 DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeInstance); 59 DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeInstance);
56 }; 60 };
57 61
58 } // namespace arc 62 } // namespace arc
59 63
60 #endif // COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_ 64 #endif // COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_
OLDNEW
« no previous file with comments | « no previous file | components/arc/test/fake_arc_bridge_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698