| 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 "extensions/renderer/api_event_handler.h" | 5 #include "extensions/renderer/bindings/api_event_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/optional.h" | 10 #include "base/optional.h" |
| 11 #include "base/test/mock_callback.h" | 11 #include "base/test/mock_callback.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "extensions/common/event_filtering_info.h" | 13 #include "extensions/common/event_filtering_info.h" |
| 14 #include "extensions/renderer/api_binding_test.h" | 14 #include "extensions/renderer/bindings/api_binding_test.h" |
| 15 #include "extensions/renderer/api_binding_test_util.h" | 15 #include "extensions/renderer/bindings/api_binding_test_util.h" |
| 16 #include "gin/arguments.h" | 16 #include "gin/arguments.h" |
| 17 #include "gin/converter.h" | 17 #include "gin/converter.h" |
| 18 #include "gin/public/context_holder.h" | 18 #include "gin/public/context_holder.h" |
| 19 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
| 20 | 20 |
| 21 namespace extensions { | 21 namespace extensions { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 using MockEventChangeHandler = ::testing::StrictMock< | 25 using MockEventChangeHandler = ::testing::StrictMock< |
| (...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 "(function(event, listener) { event.removeListener(listener); })"; | 1028 "(function(event, listener) { event.removeListener(listener); })"; |
| 1029 v8::Local<v8::Value> args[] = {event, listener}; | 1029 v8::Local<v8::Value> args[] = {event, listener}; |
| 1030 RunFunction(FunctionFromString(context, kRemoveListener), context, | 1030 RunFunction(FunctionFromString(context, kRemoveListener), context, |
| 1031 arraysize(args), args); | 1031 arraysize(args), args); |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 EXPECT_EQ(0u, handler.GetNumEventListenersForTesting(kEventName, context)); | 1034 EXPECT_EQ(0u, handler.GetNumEventListenersForTesting(kEventName, context)); |
| 1035 } | 1035 } |
| 1036 | 1036 |
| 1037 } // namespace extensions | 1037 } // namespace extensions |
| OLD | NEW |