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

Unified Diff: components/arc/test/fake_arc_bridge_instance.h

Issue 2379223004: Switch from Delegate to Observer. (Closed)
Patch Set: Rebase Created 4 years, 2 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/arc/test/fake_arc_bridge_bootstrap.cc ('k') | components/arc/test/fake_arc_bridge_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/test/fake_arc_bridge_instance.h
diff --git a/components/arc/test/fake_arc_bridge_instance.h b/components/arc/test/fake_arc_bridge_instance.h
deleted file mode 100644
index 1ebe2ac7503345d97e453d252e9002e4f84d9f28..0000000000000000000000000000000000000000
--- a/components/arc/test/fake_arc_bridge_instance.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_
-#define COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_
-
-#include "base/callback_forward.h"
-#include "base/macros.h"
-#include "components/arc/arc_bridge_service.h"
-#include "components/arc/common/arc_bridge.mojom.h"
-#include "mojo/public/cpp/bindings/binding.h"
-
-namespace arc {
-
-class FakeArcBridgeInstance : public mojom::ArcBridgeInstance {
- public:
- class Delegate {
- public:
- virtual ~Delegate() = default;
- virtual void OnStopped(ArcBridgeService::StopReason reason) = 0;
- };
-
- FakeArcBridgeInstance();
- ~FakeArcBridgeInstance() override;
-
- void set_delegate(Delegate* delegate) { delegate_ = delegate; }
-
- // Finalizes the connection between the host and the instance, and signals
- // the host that the boot sequence has finished.
- void Bind(mojo::InterfaceRequest<mojom::ArcBridgeInstance> interface_request);
-
- // Resets the binding. Useful to simulate a restart.
- void Unbind();
-
- // ArcBridgeInstance:
- void Init(mojom::ArcBridgeHostPtr host) override;
-
- // Ensures the call to Init() has been dispatched.
- void WaitForInitCall();
-
- // The number of times Init() has been called.
- int init_calls() const { return init_calls_; }
-
- // Stops the instance.
- void Stop(ArcBridgeService::StopReason reason);
-
- private:
- Delegate* delegate_ = nullptr;
-
- // Keeps quit closure to wake the running nested RunLoop.
- base::Closure quit_closure_;
-
- // Mojo endpoints.
- mojo::Binding<mojom::ArcBridgeInstance> binding_;
- mojom::ArcBridgeHostPtr host_ptr_;
- int init_calls_ = 0;
-
- DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeInstance);
-};
-
-} // namespace arc
-
-#endif // COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_
« no previous file with comments | « components/arc/test/fake_arc_bridge_bootstrap.cc ('k') | components/arc/test/fake_arc_bridge_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698