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

Unified Diff: content/public/test/mock_render_process_host.h

Issue 2766263009: Convert content ConnectionFilter to OnBindInterface (Closed)
Patch Set: . Created 3 years, 8 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 | « content/public/common/service_manager_connection.h ('k') | content/public/test/mock_render_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/mock_render_process_host.h
diff --git a/content/public/test/mock_render_process_host.h b/content/public/test/mock_render_process_host.h
index 455953b531d5f28ac63eb229ee6c55db9171c7e7..efac1f0553052c49b17227d342c8f570b79bcd3f 100644
--- a/content/public/test/mock_render_process_host.h
+++ b/content/public/test/mock_render_process_host.h
@@ -32,6 +32,8 @@ class RenderWidgetHost;
// IPC messages are sent into the message sink for inspection by tests.
class MockRenderProcessHost : public RenderProcessHost {
public:
+ using InterfaceBinder = base::Callback<void(mojo::ScopedMessagePipeHandle)>;
+
explicit MockRenderProcessHost(BrowserContext* browser_context);
~MockRenderProcessHost() override;
@@ -99,7 +101,8 @@ class MockRenderProcessHost : public RenderProcessHost {
const WebRtcRtpPacketCallback& packet_callback) override;
#endif
void ResumeDeferredNavigation(const GlobalRequestID& request_id) override;
- service_manager::InterfaceProvider* GetRemoteInterfaces() override;
+ void BindInterface(const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle interface_pipe) override;
std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator()
override;
const base::TimeTicks& GetInitTimeForNavigationMetrics() const override;
@@ -145,10 +148,8 @@ class MockRenderProcessHost : public RenderProcessHost {
void GetAudioOutputControllers(
const GetAudioOutputControllersCallback& callback) const override {}
- void SetRemoteInterfaces(
- std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces) {
- remote_interfaces_ = std::move(remote_interfaces);
- }
+ void OverrideBinderForTesting(const std::string& interface_name,
+ const InterfaceBinder& binder);
private:
// Stores IPC messages that would have been sent to the renderer.
@@ -169,9 +170,9 @@ class MockRenderProcessHost : public RenderProcessHost {
bool is_process_backgrounded_;
std::unique_ptr<base::ProcessHandle> process_handle;
int worker_ref_count_;
- std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces_;
std::unique_ptr<mojo::AssociatedInterfacePtr<mojom::Renderer>>
renderer_interface_;
+ std::map<std::string, InterfaceBinder> binder_overrides_;
DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHost);
};
« no previous file with comments | « content/public/common/service_manager_connection.h ('k') | content/public/test/mock_render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698