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

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

Issue 2146573005: Revert of arc: Use the new InstanceHolder for unittests (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@bridge_refactor_first
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/arc/arc_bridge_service_impl.cc ('k') | components/arc/test/fake_app_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « components/arc/arc_bridge_service_impl.cc ('k') | components/arc/test/fake_app_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698