OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |