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

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

Issue 2606593002: [ServiceWorker] Associate interfaces.
Patch Set: Fix unit tests Created 4 years 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
Index: content/public/test/fake_associated_interface_provider_impl.h
diff --git a/content/public/test/fake_associated_interface_provider_impl.h b/content/public/test/fake_associated_interface_provider_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..29dc4cdaced5e71916cd1883335eab95cf68fe80
--- /dev/null
+++ b/content/public/test/fake_associated_interface_provider_impl.h
@@ -0,0 +1,45 @@
+// Copyright 2016 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 CONTENT_PUBLIC_TEST_FAKE_ASSOCIATED_INTERFACE_PROVIDER_IMPL_H_
+#define CONTENT_PUBLIC_TEST_FAKE_ASSOCIATED_INTERFACE_PROVIDER_IMPL_H_
+
+#include "content/public/common/associated_interface_provider.h"
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "content/public/test/foo_interface.mojom.h"
+#include "mojo/public/cpp/bindings/associated_group_controller.h"
+
+namespace content {
+
+class FakeAssociatedInterfaceProviderImpl : public AssociatedInterfaceProvider {
+ public:
+ FakeAssociatedInterfaceProviderImpl();
+ ~FakeAssociatedInterfaceProviderImpl() override;
+
+ // AssociatedInterfaceProvider:
+ void GetInterface(const std::string& name,
+ mojo::ScopedInterfaceEndpointHandle handle) override;
+ mojo::AssociatedGroup* GetAssociatedGroup() override;
+ void OverrideBinderForTesting(
+ const std::string& name,
+ const base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>& binder)
+ override;
+
+ private:
+ mojom::FooInterfaceAssociatedPtr foo_ptr_;
+ scoped_refptr<mojo::AssociatedGroupController> remote_controller_;
+
+ using BinderMap =
+ std::map<std::string,
+ base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>>;
+ BinderMap binders_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeAssociatedInterfaceProviderImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_TEST_FAKE_ASSOCIATED_INTERFACE_PROVIDER_IMPL_H_
« no previous file with comments | « content/public/browser/render_process_host.h ('k') | content/public/test/fake_associated_interface_provider_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698