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

Side by Side Diff: extensions/renderer/api_binding_unittest.cc

Issue 2768093002: [Reland][Extensions Bindings] Add support for filtered events (Closed)
Patch Set: Fix 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 unified diff | Download patch
« no previous file with comments | « extensions/renderer/api_binding_js_util.cc ('k') | extensions/renderer/api_bindings_system.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/memory/ptr_util.h" 6 #include "base/memory/ptr_util.h"
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "extensions/renderer/api_binding.h" 10 #include "extensions/renderer/api_binding.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 "}]"; 115 "}]";
116 116
117 const char kError[] = "Uncaught TypeError: Invalid invocation"; 117 const char kError[] = "Uncaught TypeError: Invalid invocation";
118 118
119 bool AllowAllAPIs(const std::string& name) { 119 bool AllowAllAPIs(const std::string& name) {
120 return true; 120 return true;
121 } 121 }
122 122
123 void OnEventListenersChanged(const std::string& event_name, 123 void OnEventListenersChanged(const std::string& event_name,
124 binding::EventListenersChanged change, 124 binding::EventListenersChanged change,
125 const base::DictionaryValue* filter,
125 v8::Local<v8::Context> context) {} 126 v8::Local<v8::Context> context) {}
126 127
127 } // namespace 128 } // namespace
128 129
129 class APIBindingUnittest : public APIBindingTest { 130 class APIBindingUnittest : public APIBindingTest {
130 public: 131 public:
131 void OnFunctionCall(std::unique_ptr<APIRequestHandler::Request> request, 132 void OnFunctionCall(std::unique_ptr<APIRequestHandler::Request> request,
132 v8::Local<v8::Context> context) { 133 v8::Local<v8::Context> context) {
133 last_request_ = std::move(request); 134 last_request_ = std::move(request);
134 } 135 }
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 1099
1099 blink::WebScopedUserGesture user_gesture(nullptr); 1100 blink::WebScopedUserGesture user_gesture(nullptr);
1100 RunFunction(function, context, arraysize(argv), argv); 1101 RunFunction(function, context, arraysize(argv), argv);
1101 ASSERT_TRUE(last_request()); 1102 ASSERT_TRUE(last_request());
1102 EXPECT_TRUE(last_request()->has_user_gesture); 1103 EXPECT_TRUE(last_request()->has_user_gesture);
1103 1104
1104 reset_last_request(); 1105 reset_last_request();
1105 } 1106 }
1106 1107
1107 } // namespace extensions 1108 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/api_binding_js_util.cc ('k') | extensions/renderer/api_bindings_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698