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

Side by Side Diff: content/public/test/fake_associated_interface_provider_impl.h

Issue 2606593002: [ServiceWorker] Associate interfaces.
Patch Set: Fix unit tests Created 3 years, 12 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_PUBLIC_TEST_FAKE_ASSOCIATED_INTERFACE_PROVIDER_IMPL_H_
6 #define CONTENT_PUBLIC_TEST_FAKE_ASSOCIATED_INTERFACE_PROVIDER_IMPL_H_
7
8 #include "content/public/common/associated_interface_provider.h"
9
10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h"
12 #include "content/public/test/foo_interface.mojom.h"
13 #include "mojo/public/cpp/bindings/associated_group_controller.h"
14
15 namespace content {
16
17 class FakeAssociatedInterfaceProviderImpl : public AssociatedInterfaceProvider {
18 public:
19 FakeAssociatedInterfaceProviderImpl();
20 ~FakeAssociatedInterfaceProviderImpl() override;
21
22 // AssociatedInterfaceProvider:
23 void GetInterface(const std::string& name,
24 mojo::ScopedInterfaceEndpointHandle handle) override;
25 mojo::AssociatedGroup* GetAssociatedGroup() override;
26 void OverrideBinderForTesting(
27 const std::string& name,
28 const base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>& binder)
29 override;
30
31 private:
32 mojom::FooInterfaceAssociatedPtr foo_ptr_;
33 scoped_refptr<mojo::AssociatedGroupController> remote_controller_;
34
35 using BinderMap =
36 std::map<std::string,
37 base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>>;
38 BinderMap binders_;
39
40 DISALLOW_COPY_AND_ASSIGN(FakeAssociatedInterfaceProviderImpl);
41 };
42
43 } // namespace content
44
45 #endif // CONTENT_PUBLIC_TEST_FAKE_ASSOCIATED_INTERFACE_PROVIDER_IMPL_H_
OLDNEW
« 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