Index: components/arc/test/fake_app_instance.h |
diff --git a/components/arc/test/fake_app_instance.h b/components/arc/test/fake_app_instance.h |
index fd5b6d6f772cb487d3668fdb4d99ec95708d8552..e3b220cd34ea1fc2b8b2f5a0a1e74e2a6e707da3 100644 |
--- a/components/arc/test/fake_app_instance.h |
+++ b/components/arc/test/fake_app_instance.h |
@@ -79,6 +79,10 @@ |
explicit FakeAppInstance(mojom::AppHost* app_host); |
~FakeAppInstance() override; |
+ void Bind(mojo::InterfaceRequest<mojom::AppInstance> interface_request) { |
+ binding_.Bind(std::move(interface_request)); |
+ } |
+ |
// mojom::AppInstance overrides: |
void Init(mojom::AppHostPtr host_ptr) override {} |
void RefreshAppList() override; |
@@ -148,9 +152,24 @@ |
return shortcut_icon_requests_; |
} |
+ // This method can be called on tests when a method is intended to |
+ // be called across a Mojo proxy. |
+ void WaitForIncomingMethodCall(); |
+ |
+ // As part of the initialization process, the instance side calls |
+ // mojom::AppHost::OnAppInstanceReady(), which in turn calls |
+ // mojom::AppInstance::Init() and |
+ // mojom::AppInstance::RefreshAppList(). This method should be called after a |
+ // call |
+ // to mojom::ArcBridgeHost::OnAppInstanceReady() to make sure all method calls |
+ // have |
+ // been dispatched. |
+ void WaitForOnAppInstanceReady(); |
+ |
private: |
using TaskIdToInfo = std::map<int32_t, std::unique_ptr<Request>>; |
// Mojo endpoints. |
+ mojo::Binding<mojom::AppInstance> binding_; |
mojom::AppHost* app_host_; |
// Number of RefreshAppList calls. |
int refresh_app_list_count_ = 0; |