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

Unified Diff: content/public/browser/web_contents_binding_set.h

Issue 2752283004: Add the ability to override WebContentsBindingSet binders for testing (Closed)
Patch Set: . Created 3 years, 9 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
Index: content/public/browser/web_contents_binding_set.h
diff --git a/content/public/browser/web_contents_binding_set.h b/content/public/browser/web_contents_binding_set.h
index 1d3290f08da84962f30407f06d9636dde8efad60..b8d5ff2782dec94da6597a23fbd049dead25e5d2 100644
--- a/content/public/browser/web_contents_binding_set.h
+++ b/content/public/browser/web_contents_binding_set.h
@@ -25,7 +25,7 @@ class WebContentsImpl;
// Base class for something which owns a mojo::AssociatedBindingSet on behalf
// of a WebContents. See WebContentsFrameBindingSet<T> below.
class CONTENT_EXPORT WebContentsBindingSet {
- protected:
+ public:
class CONTENT_EXPORT Binder {
public:
virtual ~Binder() {}
@@ -35,6 +35,11 @@ class CONTENT_EXPORT WebContentsBindingSet {
mojo::ScopedInterfaceEndpointHandle handle);
};
+ void SetBinderForTesting(std::unique_ptr<Binder> binder) {
+ binder_for_testing_ = std::move(binder);
+ }
+
+ protected:
WebContentsBindingSet(WebContents* web_contents,
const std::string& interface_name,
std::unique_ptr<Binder> binder);
@@ -49,6 +54,7 @@ class CONTENT_EXPORT WebContentsBindingSet {
const base::Closure remove_callback_;
std::unique_ptr<Binder> binder_;
+ std::unique_ptr<Binder> binder_for_testing_;
DISALLOW_COPY_AND_ASSIGN(WebContentsBindingSet);
};
« no previous file with comments | « content/browser/web_contents_binding_set_browsertest.cc ('k') | content/public/browser/web_contents_binding_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698